Julien Simon
Deep Dive: Quantizing Large Language Models, part 2
updated
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
To get started, you simply need to navigate to the Azure ML Studio website and open the model catalog. Then, you can click on a model to select it. This will initiate the setup process, which takes care of all the required infrastructure for you. Once the setup is complete, Azure ML Studio provides a sample program and you can start testing the model immediately!
If you want to experiment with the latest state-of-the-art models, Azure ML Studio provides a hassle-free way to do so. Try it out and explore the possibilities of cutting-edge AI models with just one click!
Azure ML : azure.microsoft.com/en-us/products/machine-learning
Follow me on Medium at julsimon.medium.com or Substack at https://julsimon.substack.com.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
To get started, you simply need to navigate to the SageMaker JumpStart website and locate the Mistral AI 7B model. Once you find it, you can click on the model to select it. This will initiate the setup process, which takes care of all the required infrastructure for you. Once the setup is complete, SageMaker JumpStart provides a sample notebook and you can start testing the model immediately!
If you want to experiment with the latest state-of-the-art models like the Mistral AI 7B model, SageMaker JumpStart provides a hassle-free way to do so. Try it out and explore the possibilities of cutting-edge AI models with just one click!
Amazon SageMaker JumpStart: aws.amazon.com/sagemaker/jumpstart
Follow me on Medium at julsimon.medium.com or Substack at https://julsimon.substack.com.
You can learn more at Anybotics.com.
A few lines of code is all it takes, and of course, we run some benchmarks.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
- Amazon EC2 Inf2: aws.amazon.com/ec2/instance-types/inf2
- Optimum Neuron documentation: huggingface.co/docs/optimum-neuron
- Optimum Neuron Github: github.com/huggingface/optimum-neuron
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/neuron/sd
I first launch a trn1.32xlarge instance (16 Trainium chips) and a p3dn.24xlarge (8 V100s). Then, I run 3 benchmarks: language pretraining with GPT2, token classification with BERT Large, and image classification with the Vision Transformer
The results? Trainium is 2 to 5x faster, and 3 to 8x cheaper!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
- Amazon EC2 trn1: aws.amazon.com/ec2/instance-types/trn1
- Amazon EC2 p3: aws.amazon.com/ec2/instance-types/p3
- Training commands: gist.github.com/juliensimon/da64fc6d6a2fe39bd8c5af12389a227e
- Trainium with Optimum Neuron: youtu.be/FmjTWags__Q
- Trn1 vs G5 benchmark: youtu.be/2SquGhkld7k
First, changing a single line of code, I show you how to train a Vision Transformer model on the food101 datasets (75K training images). On a trn1.32xlarge instance, the model trains in under a minute per epoch.
Then, I show you how to export a DistilBERT model from the hub to Inferentia2. Running a benchmark on a inf2.xlarge instance, we get over 2000 predictions per second and P99 1-millisecond latency!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
- Amazon EC2 Trn1: aws.amazon.com/ec2/instance-types/trn1
- Amazon EC2 Inf2: aws.amazon.com/ec2/instance-types/inf2
- Hugging Face Neuron AMI: aws.amazon.com/marketplace/pp/prodview-gr3e6yiscria2
- Optimum Neuron documentation: huggingface.co/docs/optimum-neuron
- Optimum Neuron Github: github.com/huggingface/optimum-neuron
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/neuron
Starting from a BERT model that I fine-tuned on AWS Trainium (youtu.be/HweP7OYNiIA) , I compile it with the Neuron SDK for Inferentia 1. Then, using an inf2.xlarge instance (1 Inferentia2 chips, 2 Neuron Cores), I show you how to get to 1.3 ms latency at 1,700 inferences per second.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Amazon EC2 Inf2: aws.amazon.com/ec2/instance-types/inf2
- Deep Learning AMI Neuron PyTorch 1.13.0 (Ubuntu 20.04) 20230405
ami-02f8a3b8fe70e81b9 (64-bit (x86))
- AWS Neuron SDK documentation:
* awsdocs-neuron.readthedocs-hosted.com/en/latest/frameworks/torch/inference.html
* awsdocs-neuron.readthedocs-hosted.com/en/latest/general/arch/neuron-hardware/neuron-core-v2.html#neuroncores-v2-arch
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/inferentia2
We first deploy the model straight from the Hugging Face Hub to Amazon SageMaker, and we evaluate it on legal data. Then, using GPU instances managed by SageMaker, we fine-tune the model with a Hugging Face script and we deploy it again.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/summarization-t5
- Model: huggingface.co/google/flan-t5-large
- Dataset: huggingface.co/datasets/billsum
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Blog post: huggingface.co/blog/stable-diffusion-inference-intel
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/stable_diffusion_intel
- Jemalloc: jemalloc.net
- Intel Extension for PyTorch: github.com/intel/intel-extension-for-pytorch
- Intel Sapphire Rapids: en.wikipedia.org/wiki/Sapphire_Rapids
- Intel Advanced Matrix Extensions: en.wikipedia.org/wiki/Advanced_Matrix_Extensions
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Blog post: huggingface.co/blog/stable-diffusion-inference-intel
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/stable_diffusion_intel
- Optimum Intel: github.com/huggingface/optimum-intel
- Intel Sapphire Rapids: en.wikipedia.org/wiki/Sapphire_Rapids
- Intel Advanced Matrix Extensions: en.wikipedia.org/wiki/Advanced_Matrix_Extensions
I first launch a trn1.32xlarge instance (16 Trainium chips) and a g5.48xlarge (8 A10Gs). Then, I run a natural language processing job, fine-tuning the BERT Large model on the full Yelp review datatset. I use the BF16 data format with the maximum sequence length supported by the model (512).
The results? The Trainium job is 5x faster. As the trn1 instance is only 30% more expensive, this is a huge improvement in cost-performance!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Original Trainium video with the AWS Deep Learning AMI: youtu.be/HweP7OYNiIA
- Trainium video with the Hugging Face Neuron AMI: youtu.be/0Y5E8RI_D2E
- Amazon EC2 trn1: aws.amazon.com/ec2/instance-types/trn1
- Amazon EC2 g5: aws.amazon.com/ec2/instance-types/g5
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/trainium
- AWS Neuron SDK documentation: awsdocs-neuron.readthedocs-hosted.com/en/latest/frameworks/torch/index.html
Interested in hardware acceleration? Check out my other videos :
- Habana Gaudi: youtu.be/56fpEa1Y1F8
- Graphcore: youtu.be/DgcJscPu1Vo
- Trainium on SageMaker: youtu.be/pokM1r3rgIg
First, I walk you through the setup of an Amazon EC2 trn1.32xlarge instance, equipped with 16 Trainium chips. Then, I run a natural language processing job, accelerating a BERT model to classify the Yelp review datatset on 32 Neuron cores.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Hugging Face Neuron AMI on AWS Marketplace: aws.amazon.com/marketplace/pp/prodview-gr3e6yiscria2
- Original Trainium video with the AWS Deep Learning AMI: youtu.be/HweP7OYNiIA
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/trainium
- AWS Trainium: aws.amazon.com/ec2/instance-types/trn1
- AWS Neuron SDK documentation: awsdocs-neuron.readthedocs-hosted.com/en/latest/frameworks/torch/index.html
Interested in hardware acceleration? Check out my other videos :
- Habana Gaudi: youtu.be/56fpEa1Y1F8
- Graphcore: youtu.be/DgcJscPu1Vo
- Trainium on SageMaker: youtu.be/pokM1r3rgIg
[No HD version, sorry]
- The impact of Transformers on text classification use cases
- How Witty Works leverages Hugging Face to scale inclusive language
- How to perform domain-adaptive pretraining on a transformer model
Speakers
Elena Nazarenko - Lead Data Scientist at Witty Works
Lukas Kahwe Smith - CTO & Co-Founder at Witty Works
Julien Simon - Chief Evangelist at Hugging Face
About Witty Works
Witty is a Digital Writing Assistant for Inclusive Language that enables organizations to detect their own bias, in writing and in behavior, and fix it. Because language builds culture.
About Hugging Face
Hugging Face is a wildly popular community-based repository for open-source ML technology. It is a platform that stores, serves and manages the latest and greatest in open-sources ML models, including enabling customers to fine-tune these models and deploy them at scale.
Hugging Face is one of the most used platforms and is empowering 10,000 companies to integrate artificial intelligence into their products or workflows.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Model and code: huggingface.co/juliensimon/xlm-v-base-language-id
- Space: huggingface.co/spaces/juliensimon/xlm-v-base-language-id
- Base model: huggingface.co/facebook/xlm-v-base
- Dataset: huggingface.co/datasets/google/fleurs
- Optimum Intel: github.com/huggingface/optimum-intel
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Research paper: arxiv.org/abs/2206.08657
- Image demo: huggingface.co/spaces/juliensimon/bridgetower-demo
- Video demo: huggingface.co/spaces/juliensimon/bridgetower-video-search
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Blog post: huggingface.co/blog/setfit
- Code: gist.github.com/juliensimon/4c77ec7ed44587aaf5666fe95e0dbec2
- Setfit: huggingface.co/blog/setfit
- Intel Sapphire Rapids: en.wikipedia.org/wiki/Sapphire_Rapids
- Intel Advanced Matrix Entensions: en.wikipedia.org/wiki/Advanced_Matrix_Extensions
- Amazon EC2 R7iz: aws.amazon.com/ec2/instance-types/r7iz
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Blog post: huggingface.co/blog/intel-sapphire-rapids-inference
- Code: gist.github.com/juliensimon/7ae1c8d12e8a27516e1392a3c73ac1cc
- Intel Sapphire Rapids: en.wikipedia.org/wiki/Sapphire_Rapids
- Intel Advanced Matrix Entensions: en.wikipedia.org/wiki/Advanced_Matrix_Extensions
- Amazon EC2 R7iz: aws.amazon.com/ec2/instance-types/r7iz
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Blog post: huggingface.co/blog/intel-sapphire-rapids
- Intel Sapphire Rapids: en.wikipedia.org/wiki/Sapphire_Rapids
- Intel Advanced Matrix Entensions: en.wikipedia.org/wiki/Advanced_Matrix_Extensions
- Amazon EC2 R7iz: aws.amazon.com/ec2/instance-types/r7iz
Starting from a BERT model and the Yelp review datatset, I first train a multi-class classification model on an ml.trn1.2xlarge instance. I also show you how to reuse the Neuron SDK model cache from one training job to the next, in order to save time and money on repeated jobs. Then, I compile the trained model for Inferentia with a SageMaker Processing batch job, making it easy to automate such tasks.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/trainium_inferentia_sagemaker
- Training with Trainium on EC2: youtu.be/HweP7OYNiIA
- Predicting with Inferentia on EC2: youtu.be/un0WsUtGwVA
- SageMaker SDK feature request: github.com/aws/sagemaker-python-sdk/issues/3481
Interested in hardware acceleration for Transformers? Check out my other videos :
- Training on Habana Gaudi: youtu.be/56fpEa1Y1F8
- Training on Graphcore: youtu.be/DgcJscPu1Vo
- Predicting with ONNX: youtu.be/_AKFDOnrZz8
- Predicting with Intel OpenVINO: youtu.be/mfj1QrZWkk8
Using an AWS instance equipped with an NVIDIA V100 GPU, I start from a couple of models that I previously fine-tuned: a DistilBERT model for text classification and a Vision Transformer model for image classification. I first benchmark the original models, then I use Optimum and Better Transformer to optimize them with a single line of code, and I benchmark them again. This simple process delivers a 20-30% percent speedup with no accuracy drop!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Optimum v1.5.0 : github.com/huggingface/optimum/releases/tag/v1.5.0
- Optimum docs: huggingface.co/docs/optimum/onnxruntime/overview
- Better Transformer blog post: pytorch.org/blog/a-better-transformer-for-fast-transformer-encoder-inference
- DistilBERT model: huggingface.co/juliensimon/distilbert-amazon-shoe-reviews
- Vision Transformer model: huggingface.co/juliensimon/autotrain-food101-1471154050
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/bettertransformer
Starting from a BERT model that I fine-tuned on AWS Trainium (youtu.be/HweP7OYNiIA) , I compile it with the Neuron SDK for Inferentia. Then, using an inf1.6xlarge instance (4 Inferentia chips, 16 Neuron Cores), I show you how to use pipeline mode to predict at scale, reaching over 4,000 predictions per second at 3-millisecond latency.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Amazon EC2 Inf1: aws.amazon.com/ec2/instance-types/inf1
- AWS Neuron SDK documentation: awsdocs-neuron.readthedocs-hosted.com/en/latest/index.html
- AWS blog post: aws.amazon.com/fr/blogs/machine-learning/achieve-12x-higher-throughput-and-lowest-latency-for-pytorch-natural-language-processing-applications-out-of-the-box-on-aws-inferentia
- Setup steps and code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/inferentia
Interested in hardware acceleration for Transformers? Check out my other videos :
- Training on Habana Gaudi: youtu.be/56fpEa1Y1F8
- Training on Graphcore: youtu.be/DgcJscPu1Vo
- Predicting with ONNX: youtu.be/_AKFDOnrZz8
- Predicting with Intel OpenVINO: youtu.be/mfj1QrZWkk8
- Inferentia compilation on SageMaker: youtu.be/pokM1r3rgIg
I start from a Vision Transformer model fine-tuned for image classification, and quantize it with OpenVINO. Running benchmarks on an AWS c6i instance (Intel Ice Lake architecture), we speed up the original model more than 20% and divide its size by almost 4, with just a few lines of simple Python code and just a tiny accuracy drop!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Optimum: github.com/huggingface/optimum
- Optimum docs: huggingface.co/docs/optimum/onnxruntime/overview
- Intel OpenVINO: docs.openvino.ai/latest/index.html
- Original model: huggingface.co/juliensimon/autotrain-food101-1471154050
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/openvino
I start from a DistilBERT model fine-tuned for text classification, export it to ONNX format, then optimize it, and finally quantize it. Running benchmarks on an AWS c6i instance (Intel Ice Lake architecture), we speed up the original model more than 2.5x and divide its size by two, with just a few lines of simple Python code and without any accuracy drop!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Optimum: github.com/huggingface/optimum
- Optimum docs: huggingface.co/docs/optimum/onnxruntime/overview
- ONNX: onnx.ai
- Original model: huggingface.co/juliensimon/distilbert-amazon-shoe-reviews
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/onnx
In this video, I show you how to make it happen by installing VS Code and Github Copilot on Amazon SageMaker. Yes, it's possible :) Enjoy!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- AWS blog: aws.amazon.com/blogs/machine-learning/host-code-server-on-amazon-sagemaker
- Github copilot instructions: docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code
- Setup code for lifecycle configuration: gist.github.com/juliensimon/4eccabf58fa2d97a294d181a525b0127
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
In a nutshell, things didn't go well :-/ I found the service slow, and most of the prompts it generated were irrelevant. It also struggled to keep generating additional lines of code. Failing to trigger on copy-pasted prompted was very annoying (probably an issue with the AWS extension for VS Code).
Unlike Copilot, I wouldn't use CodeWhisperer to get real work done. The service is still in preview at the time of recording, and one can only hope that it will get much better over time. I'll give another try when it becomes generally available.
Getting started :
- Hugging Face: huggingface.co/course
- Amazon CodeWhisperer: aws.amazon.com/codewhisperer
And if you're interested in LLMs for code generation, check out the BigCode project at bigcode-project.org
This video was recorded in one take, with very little editing (kernel crashes, etc.). I just opened VS Code, picked a simple example, and played ball. IMHO Copilot did very well. Some suggestions definitely felt like it was reading my mind. Give it a try and share your comments :)
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Getting started :
- Hugging Face: huggingface.co/course
- Github Copilot: github.com/features/copilot
And if you're interested in LLMs for code generation, check out the BigCode project at bigcode-project.org
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/food102
- Food101 dataset: huggingface.co/datasets/food101
- Original model: huggingface.co/juliensimon/autotrain-food101-1471154053
- How the original model was created with AutoTrain: youtu.be/uFxtl7QuUvo
- Stable Diffusion model: huggingface.co/runwayml/stable-diffusion-v1-5
- Stable Diffusion Space: huggingface.co/spaces/runwayml/stable-diffusion-v1-5
- Diffusers library: github.com/huggingface/diffusers
- Food102 dataset: huggingface.co/datasets/juliensimon/food102
- New model: huggingface.co/juliensimon/swin-food102
First, I walk you through the setup of an Amazon EC2 trn1.32xlarge instance, equipped with 16 Trainium chips. Then, I run a natural language processing job where I adapt existing Transformer training code for Trainium, accelerating a BERT model to classify the Yelp review datatset. Finally, I run the job on 1, 8, and 32 Neuron cores.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- AWS Trainium: aws.amazon.com/ec2/instance-types/trn1
- AWS Neuron SDK documentation: awsdocs-neuron.readthedocs-hosted.com/en/latest/frameworks/torch/index.html
- AWS Neuron SDK samples: github.com/aws-neuron/aws-neuron-samples
- Hugging Face tutorial: huggingface.co/docs/transformers/training
- Setup steps and code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/trainium
Interested in hardware acceleration? Check out my other videos :
- Habana Gaudi: youtu.be/56fpEa1Y1F8
- Graphcore: youtu.be/DgcJscPu1Vo
- Trainium on SageMaker: youtu.be/pokM1r3rgIg
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Model: huggingface.co/juliensimon/autotrain-food101-1471154053
- Inference Endpoints: huggingface.co/inference-endpoints
- Inference Endpoints documentation: huggingface.co/docs/inference-endpoints/index-
- AWS PrivateLink documentation: docs.aws.amazon.com/vpc/latest/privatelink/concepts.html
Code:
import requests, json, os
API_URL = ENDPOINT_URL
MY_API_TOKEN = os.getenv("MY_API_TOKEN")
headers = {"Authorization": "Bearer "+MY_API_TOKEN, "Content-Type": "image/jpg"}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.request("POST", API_URL, headers=headers, data=data)
return json.loads(response.content.decode("utf-8"))
output = query("food.jpg")
First, I walk you through the setup of a Graphcore-enabled notebook on Paperspace. Then, I run a natural language processing job where I adapt existing Transformer training code for Optimum Graphcore, accelerating a BERT model to classify the star rating of Amazon product reviews. We also take a quick look at additional sample notebooks available on Paperspace.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Paperspace: paperspace.com
- Graphcore IPU: graphcore.ai/bow-processors
- Graphcore documentation on parallelism: docs.graphcore.ai/projects/poptorch-user-guide/en/latest/batching.html
- Graphcore organization: huggingface.co/Graphcore
- Optimum Graphcore repository on Github: github.com/huggingface/optimum-graphcore
- Amazon reviews classification workshop: gitlab.com/juliensimon/huggingface-demos/-/tree/main/amazon-shoes (Graphcore notebooks are under 'graphcore')
- Amazon reviews dataset (my version): huggingface.co/datasets/juliensimon/amazon-shoe-reviews
Interested in hardware acceleration? Check out my other videos :
- AWS Trainium: youtu.be/HweP7OYNiIA
- Habana Gaudi: youtu.be/56fpEa1Y1F8
First, I walk you through the setup of an Amazon EC2 DL1 instance, which is equipped with 8 Gaudis. Then, I run a natural language processing job where I adapt existing Transformer training code for Optimum Habana, accelerating a DistilBERT model to classify the star rating of Amazon product reviews. I train with 1 Gaudi chip, then with 8 to demonstrate near-linear scaling.
Finally, switching to computer vision, I use a built-in script in the Optimum Habana repository to accelerate image classification training jobs on the Food101 dataset, first with a Vision Transformer model and then with a Swin model.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Habana Gaudi: habana.ai/training
- Amazon EC2 DL1: aws.amazon.com/ec2/instance-types/dl1
- Habana EC2 DL1 setup: docs.habana.ai/en/latest/AWS_EC2_DL1_and_PyTorch_Quick_Start/AWS_EC2_DL1_and_PyTorch_Quick_Start.html
- Habana organization: huggingface.co/Habana
- Optimum Habana repository on Github: github.com/huggingface/optimum-habana
- Amazon reviews classification workshop: gitlab.com/juliensimon/huggingface-demos/-/tree/main/amazon-shoes (Habana setup and code are under 'habana')
- Amazon reviews dataset (my version): huggingface.co/datasets/juliensimon/amazon-shoe-reviews
- Food 101 dataset: huggingface.co/datasets/food101
Interested in hardware acceleration? Check out my other videos :
- AWS Trainium: youtu.be/HweP7OYNiIA
- Graphcore: youtu.be/DgcJscPu1Vo
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Resources:
- Chest x-ray dataset (Kaggle): kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
- Chest x-ray dataset (hub): huggingface.co/datasets/juliensimon/autotrain-data-chest-xray-demo
- Chest x-ray model: huggingface.co/juliensimon/autotrain-chest-xray-demo-1677859324
- Alzheimer dataset (Kaggle): kaggle.com/datasets/tourist55/alzheimers-dataset-4-class-of-images
- Alzheimer dataset (hub): huggingface.co/datasets/juliensimon/autotrain-data-alzheimer-demo
- Food 101 dataset (hub): huggingface.co/datasets/food101
- Food 101 model: huggingface.co/juliensimon/autotrain-food101-1471154053
Dans cette session, découvrez pourquoi les modèles Transformers sont en train de révolutionner le Machine Learning. Après une brève introduction, vous verrez plusieurs modèles à l'état de l'art en action, au travers des outils Hugging Face et avec un minimum de code :)
⭐️⭐️⭐️ Abonnez vous pour être notifié(e) des prochaines vidéos ! ⭐️⭐️⭐️
Demos:
- Extraire des informations sur des documents: huggingface.co/spaces/rajistics/receipt_extractor
- Poser des questions sur des documents: huggingface.co/spaces/nielsr/donut-docvqa
- Générer une description d'une image: huggingface.co/spaces/jonasmouyal/Image_Captioning
Pour aller plus loin:
- huggingface.co
- huggingface.co/tasks
- huggingface.co/course
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
Santé.fr is the website owned by the French Ministry of Health and especially the French Agency for Digital Health. Its goal is to give French citizens access to all healthcare information in France. It plays a major role in prevention and enables access to reliable, transparent and accessible health information.
The French Agency for Digital Health wanted to provide accurate information about medications to Santé.fr users. They have reached out to Synapse Medicine to integrate its medication chatbot, named Galien, on the Santé.fr website.
Synapse Medicine used Hugging Face machine learning models during the chatbot development.
Save your spot for this live webinar to learn:
The impact of Transformers on health tech use cases
How Synapse Medicine leverages Hugging Face
How to perform domain-adaptive pretraining on a transformer model to improve its comprehension of pharmaco-medical data
How we fine-tuned the resulting model on a supervised intent classification task
Can't attend the live broadcast? Go ahead and register anyway — we'll be sure to send a webinar recording to all registrants.
Speakers
Cynthia Périer - Data Scientist at Synapse Medicine
Julien Simon - Chief Evangelist at Hugging Face
About Synapse Medicine
Synapse Medicine’s mission is to provide everyone access to the best medicine. The startup, which collaborates closely with the largest French university hospitals, has developed a Medication Intelligence platform dedicated to proper drug use. As a leader in its category, the solution is 100% independent from the pharmaceutical industry and is used today by thousands of healthcare professionals.
About Hugging Face
Hugging Face is a wildly popular community-based repository for open-source ML technology. It is a platform that stores, serves and manages the latest and greatest in open-sources ML models, including enabling customers to fine-tune these models and deploy them at scale.
Hugging Face is one of the most used platforms and is empowering 10,000 companies to integrate artificial intelligence into their products or workflows.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
This was originally part of the 1729 conference (datahack.analyticsvidhya.com/contest/1729-a-category-defining-ai-event/).
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Dataset: huggingface.co/datasets/speech_commands
Base model: huggingface.co/facebook/wav2vec2-conformer-rel-pos-large
Fine-tuned model: huggingface.co/juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands
Space: huggingface.co/spaces/juliensimon/keyword-spotting
Notebook: gitlab.com/juliensimon/huggingface-demos/-/tree/main/keyword-spotting
Let us know how you'd like to use MLflow with Transformers and the Hugging Face hub! Please join the discussion at discuss.huggingface.co/t/calling-mlflow-users/20420
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Doc: huggingface.co/docs/transformers/v4.20.1/en/main_classes/callback#transformers.integrations.MLflowCallback
Notebook: gitlab.com/juliensimon/huggingface-demos/-/tree/main/mlflow
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Article: arxiv.org/pdf/2012.06678.pdf
Doc: docs.aws.amazon.com/sagemaker/latest/dg/tabtransformer.html
pytorch-widedeep: github.com/jrzaurin/pytorch-widedeep
TabTransformer on the Hugging Face hub: huggingface.co/spaces/keras-io/TabTransformer_Classification
According to the latest State of AI report, "transformers have emerged as a general-purpose architecture for ML. Not just for Natural Language Processing, but also Speech, Computer Vision or even protein structure prediction." Indeed, the Transformer architecture has proven very efficient on a wide variety of Machine Learning tasks. But how can we keep up with the frantic pace of innovation? Do we really need expert skills to leverage these state-of-the-art models? Or is there a shorter path to creating business value in less time?
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
In this code-level talk, we'll gradually build and deploy a demo involving several Transformer models. Along the way, you'll learn about the portfolio of open source and commercial Hugging Face solutions, how they can help you become hyper-productive in order to deliver high-quality Machine Learning solutions faster than ever before.
Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/amazon-shoes
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Original dataset: kaggle.com/competitions/petfinder-adoption-prediction
Dataset on the hub: huggingface.co/datasets/juliensimon/autotrain-data-petfinder-demo
Model on the hub: huggingface.co/juliensimon/autotrain-tabular-demo-762523398
Notebook: gitlab.com/juliensimon/huggingface-demos/-/tree/main/autotrain-petfinder
New to Transformers? Check out the Hugging Face course at huggingface.co/course
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Dataset preparation, based on SEC filings downloaded with an AWS SDK. See youtu.be/SU1L6f0N6iw for details.
- Experimentation in a Jupyter notebook, available at gitlab.com/juliensimon/huggingface-demos/-/tree/main/voice-queries
- Implementation of a Hugging Face Spaces application, available at huggingface.co/spaces/juliensimon/voice-queries
You can run the demo at huggingface.co/spaces/juliensimon/voice-queries
Technical deep dive video on how this demo was built: youtu.be/YPme-gR0f80
New to Transformers? Check out the Hugging Face course at huggingface.co/course
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
- easily download SEC filings with a bespoke AWS SDK,
- process and break down filings into individual text sections,
- extract insights using Hugging Face models for sentiment analysis, emotion detection, and summarization.
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) buymeacoffee.com/julsimon ⭐️⭐️⭐️
Blog post: aws.amazon.com/blogs/machine-learning/create-a-dashboard-with-sec-text-for-financial-nlp-in-amazon-sagemaker-jumpstart
SDK: github.com/aws/sagemaker-jumpstart-industry-pack
Notebooks: gitlab.com/juliensimon/huggingface-demos/-/tree/main/sec-filings
New to Transformers? Check out the Hugging Face course at huggingface.co/course


