Example code and applications for machine learning on Graphcore IPUs
This repository contains a catalogue of application examples that have been optimised to run on Graphcore IPUs for both training and inference. Access reproducible code for a wide range of popular models covering NLP, Computer Vision, Speech, Multimodal, GNNs, AI for Simulation, Recommender Systems, and more. This includes a selection of models that achieve state of the art performance on IPUs, as well as code examples for self-learning.
Run models out-the-box on IPUs integrated with popular ML frameworks and libraries:
To see what's new, check out our Model Garden :tulip:, where you can easily filter applications by domain and framework.
For more detailed benchmark information, visit our Performance Results page.
The code presented here requires you to use Poplar SDK 3.2.x, and has been tested using Ubuntu 20.04 and Python 3.8
Please install and enable the Poplar SDK following the instructions in the Getting Started guide for your IPU system.
If you encounter a problem or want to suggest an improvement to our example applications please raise a GitHub issue, contact us at [email protected], or get in touch through the #help channel of the Graphcore Slack Community!
If you require POD128 or POD256 setup and configuration for our applications, please contact our engineering support.
Model | Domain | Type | Source |
---|---|---|---|
ResNet | Image classification | Training, Inference | TensorFlow 2, PyTorch, PyTorch Lightning |
EfficientNet | Image classification | Training, Inference | PyTorch, PyTorch Lightning |
MobileNetv3 | Image classification | Training, Inference | PyTorch |
ViT (Vision Transformer) | Image classification | Training | PyTorch, Hugging Face Optimum |
DINO | Image classification | Training | PyTorch |
Swin | Image classification | Training | PyTorch |
MAE (Masked AutoEncoder) | Image classification | Training | PyTorch |
Yolov4-P5 | Object detection | Inference | PyTorch |
EfficientDet | Object detection | Inference | TensorFlow 2 |
UNet (Medical) | Image segmentation | Training, Inference | TensorFlow 2 |
Neural Image Fields | Neural radiance fields | Training | TensorFlow 2 |
Model | Domain | Type | Source |
---|---|---|---|
BERT | NLP | Training, Inference | PyTorch , TensorFlow 2, PopXL, PaddlePaddle, Hugging Face Optimum |
Packed BERT | NLP | Training | PyTorch |
BERT-large | NLP | Fine-tuning | Hugging Face Optimum |
GPT2 | NLP | Training | PyTorch, Hugging Face Optimum |
GPTJ | NLP | Training | PopXL |
GPT3-2.7B | NLP | Training | PopXL |
GPT3-175B | NLP | Training | PopXL |
RoBERTa | NLP | Training | Hugging Face Optimum |
DeBERTa | NLP | Training | Hugging Face Optimum |
HuBERT | NLP | Training | Hugging Face Optimum |
BART Base | NLP | Training | Hugging Face Optimum |
T5-small | NLP | Training | Hugging Face Optimum |
Bloom | NLP | Inference | PopXL |
Dolly | NLP | Inference | PopXL |
MT5-small | NLP | Fine-tuning | Hugging Face Optimum |
MT5-large | NLP | Fine-tuning | Hugging Face Optimum |
Model | Domain | Type | Source |
---|---|---|---|
Fastpitch | TTS (TextToSpeech) | Training | PyTorch |
Conformer | STT (SpeechToText) | Training, Inference | PyTorch |
wav2vec2-base | STT (SpeechToText) | Fine-tuning, Inference | Hugging Face Optimum |
wav2vec2-large | STT (SpeechToText) | Fine-tuning, Inference | Hugging Face Optimum |
Whisper-tiny | STT (SpeechToText) | Inference | Hugging Face Optimum |
Model | Domain | Type | Source |
---|---|---|---|
miniDALL-E | Multimodal | Training | PyTorch |
CLIP | Multimodal | Training | PyTorch |
LXMERT | Multimodal | Training | Hugging Face Optimum |
Frozen in time | Multimodal | Training, Inference | PyTorch |
Model | Domain | Type | Source |
---|---|---|---|
MPNN (Message Passing Neural Networks) | GNN | Training, Inference | PyTorch Geometric , TensorFlow 2 |
Spektral GNN library with QM9 | GNN | Training | TensorFlow 2 |
Cluster GCN | GNN | Training, Inference | PyTorch Geometric |
TGN (Temporal Graph Networks) | GNN | Training | PyTorch |
NBFNet | GNN | Training, Inference | PyTorch Geometric |
SchNet | GNN | Training, Inference | PyTorch Geometric |
GPS++ - OGB-LSC PCQM4Mv2 competition submission | GNN | Training, Inference | TensorFlow 2 |
Model | Domain | Type | Source |
---|---|---|---|
Approximate Bayesian Computation (ABC) COVID-19 | Medical | Inference | TensorFlow 2 |
To easily run the examples with tested and optimised configurations and to reproduce the performance shown on our Performance Results page, you can use the examples-utils
benchmarking module, which comes with every example when you install its requirements. To use this simple, shared interface for almost any of the examples provided here, locate and look through the example's benchmarks.yml
file and run:
python3 -m examples_utils benchmark --spec <path to benchmarks.yml file> --benchmark <name of benchmark>
Refer to the examples-utils
benchmarking module README for more information.
Visualise your code's inner workings with PopVision, a user-friendly, graphical interface to optimise your machine learning models.
Download the PopVision tools to analyse IPU performance and utilisation.
The utils/
folder contains utility libraries and scripts that are used across the code examples. This includes:
utils/examples_tests
- Common Python helper functions for the examples
repository unit testsutils/benchmarks
- Common Python helper functions for running benchmarks on the IPU in different frameworksUnless otherwise specified by a LICENSE file in a subdirectory, the LICENSE referenced at the top level applies to the files in this repository.
Graphcore/tutorials
repository into this repository (PopART tutorials have also been removed)gpt
to gpt2
wenet-conformer
to conformer