Goto

Collaborating Authors

 huggingface transformer


Magneton: Optimizing Energy Efficiency of ML Systems via Differential Energy Debugging

Pan, Yi, Qian, Wenbo, Xie, Dedong, Hu, Ruiyan, Hu, Yigong, Kasikci, Baris

arXiv.org Artificial Intelligence

The training and deployment of machine learning (ML) models have become extremely energy-intensive. While existing optimization efforts focus primarily on hardware energy efficiency, a significant but overlooked source of inefficiency is software energy waste caused by poor software design. This often includes redundant or poorly designed operations that consume more energy without improving performance. These inefficiencies arise in widely used ML frameworks and applications, yet developers often lack the visibility and tools to detect and diagnose them. We propose differential energy debugging, a novel approach that leverages the observation that competing ML systems often implement similar functionality with vastly different energy consumption. Building on this insight, we design and implement Magneton, an energy profiler that compares energy consumption between similar ML systems at the operator level and automatically pinpoints code regions and configuration choices responsible for excessive energy use. Applied to 9 popular ML systems spanning LLM inference, general ML frameworks, and image generation, Magneton detects and diagnoses 16 known cases of software energy inefficiency and further discovers 8 previously unknown cases, 7 of which have been confirmed by developers.


TencentPretrain: A Scalable and Flexible Toolkit for Pre-training Models of Different Modalities

Zhao, Zhe, Li, Yudong, Hou, Cheng, Zhao, Jing, Tian, Rong, Liu, Weijie, Chen, Yiren, Sun, Ningyuan, Liu, Haoyan, Mao, Weiquan, Guo, Han, Guo, Weigang, Wu, Taiqiang, Zhu, Tao, Shi, Wenhang, Chen, Chen, Huang, Shan, Chen, Sihong, Liu, Liqun, Li, Feifei, Chen, Xiaoshuai, Sun, Xingwu, Kang, Zhanhui, Du, Xiaoyong, Shen, Linlin, Yan, Kimmo

arXiv.org Artificial Intelligence

Recently, the success of pre-training in text domain has been fully extended to vision, audio, and cross-modal scenarios. The proposed pre-training models of different modalities are showing a rising trend of homogeneity in their model structures, which brings the opportunity to implement different pre-training models within a uniform framework. In this paper, we present TencentPretrain, a toolkit supporting pre-training models of different modalities. The core feature of TencentPretrain is the modular design. The toolkit uniformly divides pre-training models into 5 components: embedding, encoder, target embedding, decoder, and target. As almost all of common modules are provided in each component, users can choose the desired modules from different components to build a complete pre-training model. The modular design enables users to efficiently reproduce existing pre-training models or build brand-new one. We test the toolkit on text, vision, and audio benchmarks and show that it can match the performance of the original implementations.


Easy Object Detection with Python, HuggingFace Transformers and Machine Learning – MachineCurve

#artificialintelligence

If you're into machine learning, it's a term that rings a bell. Indeed, You Only Look Once has been one of the default ways for object detection in the past few years. Driven by the progress made in ConvNets, many versions of the object detection method have been created already. These days, however, there is a competitor on the horizon – and it's the use of Transformer based models in computer vision. More specifically, the use of Transformers for object detection. In today's tutorial, you'll be learning about this type of Transformer model.


How to get high score using MMBT and CLIP in Hateful Memes Competition

#artificialintelligence

The additional stage of Hateful Memes Competition from Facebook ended a few months ago. My team was lucky enough to take part in this competition and even get pretty good results (we took tenth place). How we did it and what methods we used -- I'll tell you in this article. At first glance, the problem that had to be solved in the competition is quite simple -- to determine whether a meme is hateful or not using text and image data from it. In reality, the problem is complicated by the many ambiguities inherent in our speech, as well as by the presence of sarcasm and irony, with the definition of which neural networks have problems.


Question Answering with Python, HuggingFace Transformers and Machine Learning – MachineCurve

#artificialintelligence

If you would like to read about DistilBERT in more detail I'd suggest clicking here for the article, but from what the abstract suggests it was made 60% faster by performing a 40% size reduction while retaining 97% of its language understanding. This is a significant improvement and a great optimization with respect to traditional or'vanilla' BERT. As Transfer Learning from large-scale pre-trained models becomes more prevalent in Natural Language Processing (NLP), operating these large models in on-the-edge and/or under constrained computational training or inference budgets remains challenging. In this work, we propose a method to pre-train a smaller general-purpose language representation model, called DistilBERT, which can then be fine-tuned with good performances on a wide range of tasks like its larger counterparts. While most prior work investigated the use of distillation for building task-specific models, we leverage knowledge distillation during the pre-training phase and show that it is possible to reduce the size of a BERT model by 40%, while retaining 97% of its language understanding capabilities and being 60% faster.


Scaling Training of HuggingFace Transformers With Determined

#artificialintelligence

Training complex state-of-the-art natural language processing (NLP) models is now a breeze, thanks to HuggingFace -- making it an essential open-source go-to for data scientists and machine learning engineers to implement Transformers models and configure them as state-of-the-art NLP models with straightforward library calls. As a result, the library has become crucial for training NLP models, like in Baidu or Alibaba, and has contributed to state-of-the-art results in several NLP tasks. Our friends at Determined AI are hosting an exciting lunch-and-learn covering training HuggingFace Transformers at scale using Determined! Learn to train Transformers with distributed training, hyperparameter searches, and cheap spot instances -- all without modifying code. Please consider joining on Wednesday, June 30th at 10 AM PT for a hands-on tutorial from Liam Li, a Senior Machine Learning Engineer at Determined AI, and Angela Jiang, a Product Manager at Determined AI (lunch included!).


Easy Machine Translation with Machine Learning and HuggingFace Transformers – MachineCurve

#artificialintelligence

Transformers have significantly changed the way in which Natural Language Processing tasks can be performed. This architecture, which trumps the classic recurrent one – and even LSTM-based architectures in some cases, has been around since 2017 and is the process of being democratized today. And in fact, many tasks can use these developments: for example, text summarization, named entity recognition, sentiment analysis – they can all be successfully used with this type of model. In this tutorial, we will be looking at the task of machine translation. We'll first take a look at how Transformers can be used for this purpose, and that they effectively perform a sequence-to-sequence learning task.


Release New tokenizer API, TensorFlow improvements, enhanced documentation & tutorials · huggingface/transformers

#artificialintelligence

The tokenizers has evolved quickly in version 2, with the addition of rust tokenizers. It now has a simpler and more flexible API aligned between Python (slow) and Rust (fast) tokenizers. This new API let you control truncation and padding deeper allowing things like dynamic padding or padding to a multiple of 8. The MobileBERT from MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, Denny Zhou, was added to the library for both PyTorch and TensorFlow. This model was first implemented in PyTorch by @lonePatient, ported to the library by @vshampor, then finalized and implemented in Tensorflow by @LysandreJik.


huggingface/transformers

#artificialintelligence

Transformers (formerly known as pytorch-transformers and pytorch-pretrained-bert) provides state-of-the-art general-purpose architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet...) for Natural Language Understanding (NLU) and Natural Language Generation (NLG) with over 32 pretrained models in 100 languages and deep interoperability between TensorFlow 2.0 and PyTorch. Choose the right framework for every part of a model's lifetime This repo is tested on Python 2.7 and 3.5 (examples are tested only on python 3.5), PyTorch 1.0.0 and TensorFlow 2.0.0-rc1 First you need to install one of, or both, TensorFlow 2.0 and PyTorch. Please refere to TensorFlow installation page and/or PyTorch installation page regarding the specific install command for your platform. When TensorFlow 2.0 and/or PyTorch has been installed, Transformers can be installed using pip as follows: Here also, you first need to install one of, or both, TensorFlow 2.0 and PyTorch.