• Stars
    star
    313
  • Rank 133,714 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example code and applications for machine learning on Graphcore IPUs

Graphcore Application Examples

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:

Snip 2022-07-05 20 04 06

To see what's new, check out our Model Garden ๐ŸŒท, 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.

Developer resources

  • Documentation: Explore our software documentation, user guides, and technical notes
  • Tutorials: Hands-on code tutorials, simple application and feature examples
  • How-to Videos: Watch practical how-to videos and demos by Graphcore engineers
  • Research Papers: Read publications from Graphcore's Research team and IPU innovators

Support

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!

Join our Slack Community

If you require POD128 or POD256 setup and configuration for our applications, please contact our engineering support.

Repository contents

  1. Computer Vision
  2. Natural Language Processing
  3. Speech
  4. Multimodal
  5. Graph Neural Network
  6. AI for Simulation
  7. Recommender Systems
  8. Reinforcement Learning
  9. Sparsity
  10. Probability
  11. Miscellaneous
  12. Archived

Computer Vision

Model Domain Type Source Run on Gradient
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 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 PyTorch
EfficientDet Object detection Inference TensorFlow 2 -
UNet (Medical) Image segmentation Training, Inference TensorFlow 2 -
Neural Image Fields Neural radiance fields Training TensorFlow 2 -

Natural Language Processing

Model Domain Type Source Run on Gradient
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 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 Hugging Face Optimum
T5-small NLP Training Hugging Face Optimum Hugging Face Optimum
Bloom NLP Inference PopXL -
Dolly NLP Inference PopXL PopXL
MT5-small NLP Fine-tuning Hugging Face Optimum Hugging Face Optimum
MT5-large NLP Fine-tuning Hugging Face Optimum Hugging Face Optimum

Speech

Model Domain Type Source Run on Gradient
Fastpitch TTS (TextToSpeech) Training PyTorch -
Conformer STT (SpeechToText) Training, Inference PyTorch -
wav2vec2-base STT (SpeechToText) Fine-tuning, Inference Hugging Face Optimum Hugging Face Optimum (Fine-tuning), Hugging Face Optimum (Inference)
wav2vec2-large STT (SpeechToText) Fine-tuning, Inference Hugging Face Optimum -
Whisper-tiny STT (SpeechToText) Inference Hugging Face Optimum Hugging Face Optimum

Multimodal

Model Domain Type Source Run on Gradient
miniDALL-E Multimodal Training PyTorch -
CLIP Multimodal Training PyTorch -
LXMERT Multimodal Training Hugging Face Optimum -
Frozen in time Multimodal Training, Inference PyTorch -

Graph Neural Network

Model Domain Type Source Run on Gradient
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 PyTorch Geometric
TGN (Temporal Graph Networks) GNN Training PyTorch -
NBFNet GNN Training, Inference PyTorch Geometric PyTorch Geometric (Training)
SchNet GNN Training, Inference PyTorch Geometric PyTorch Geometric
GPS++ - OGB-LSC PCQM4Mv2 competition submission GNN Training, Inference TensorFlow 2 TensorFlow 2 (Training), TensorFlow 2 (Inference)

AI for Simulation

Model Domain Type Source Run on Gradient
Approximate Bayesian Computation (ABC) COVID-19 Medical Inference TensorFlow 2 -

Benchmarking tools

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.


PopVisionยฎ Tools

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.


Utilities

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 tests
  • utils/benchmarks - Common Python helper functions for running benchmarks on the IPU in different frameworks

License

Unless otherwise specified by a LICENSE file in a subdirectory, the LICENSE referenced at the top level applies to the files in this repository.


Changelog

March 2023
  • Added the following models:
    • GNN: NBFNet (PyTorch Geometric), SchNet (PyTorch Geometric), Cluster-GCN (PyTorch Geometric), GIN (PyTorch Geometric), GPS++ - OGB-LSC PCQM4Mv2 competition submission (TensorFlow 2)
    • NLP : GPT3_175B (PopXL), Bloom (PopXL)
  • Removed all PopART applications, as well as the following:
    • Miscellaneous: Monte-Carlo ray tracing
    • AI for simulation: DeepDriveMD
    • (Preview) Multimodel: ruDalle
    • Speech: FastSpeech2
    • Vision: ResNeXt inference
  • Moved the contents of the Graphcore/tutorials repository into this repository (PopART tutorials have also been removed)
Dec 2022
  • Added the following models:
    • GNN: TGN (PyTorch)
  • Deprecating all PopART applications. Support will be removed in the next release.
  • Removed all TensorFlow 1 applications.
  • Ubuntu 18.04 no longer supported.
Sep 2022
  • Added the following models:
    • Vision : MAE (PyTorch), G16 EfficientNet (PyTorch)
    • NLP : GPTJ (PopXL), GPT3-2.7B (PopXL)
    • Multimodal : Frozen in time (PyTorch), ruDalle (Preview) (PopXL)
  • Deprecating all TensorFlow 1 applications. Support will be removed in the next release.
Aug 2022
  • Changed the folder name of the following models:
    • NLP: from gpt to gpt2
    • Speech: from wenet-conformer to conformer
July 2022
  • Major reorganisation of all the apps so that they are arranged as: problem domain / model / framework.
  • Problem domains: Vision, NLP, Speech, GNN, Sparsity, AI for Simulation, Recommender systems, Reinforcement learning, Probability, Multimodal, and Miscellaneous.
  • Added the following models:
    • Vision: Swin (PyTorch) , ViT (Hugging Face Optimum)
    • NLP: GPT2 Small/Medium/Large (PyTorch), BERT-Base/Large (PopXL), BERT-Base (PaddlePaddle), BERT-Base/Large (Hugging Face Optimum), GPT2 Small/Medium (Hugging Face Optimum), RoBERTa Base/Large (Hugging Face Optimum), DeBERTa (Hugging Face Optimum), HuBERT (Hugging Face Optimum), BART (Hugging Face Optimum), T5 small (Hugging Face Optimum)
    • Speech: Fastpitch (PyTorch), WeNet-Conformer-Medium (PyTorch) ,Wav2Vec2 (Hugging Face Optimum)
    • Multimodal: CLIP (PyTorch), LXMERT (Hugging Face Optimum)
    • AI for Simulation: et0 (TensorFlow 1)
  • Removed Conformer-small/large (PyTorch)
  • Archived Minigo (TensorFlow 1)
May 2022
  • Added the following models:
    • Vision : ViT-pretraining (PyTorch), DINO (PyTorch), EfficientDet-inference (TensorFlow 2), Neural Image Fields (TensorFlow 2)
    • NLP : PackedBERT (PyTorch, PopART), BERT-Large (TensorFlow 2)
    • Speech : FastSpeech2-inference (TensorFlow 2), Conformer-Large (PyTorch)
    • GNN : Cluster GCN (TensorFlow 2)
    • AI for Simulation : DeepDriveMD (TensorFlow 2)
December 2021
  • Added the following models:
    • Vision: miniDALL-E (PyTorch), Faster RCNN (PopART), UNet (TensorFlow 2), ResNet50 (TensorFlow 2)
    • NLP: BERT (TensorFlow 2)
    • Speech: FastSpeech2 (TensorFlow 2), Transformer Transducer (PopART), Conformer-Small (PyTorch)
    • GNN: TGN (TensorFlow 1), MPNN (TensorFlow 2)

Connect with us

More Repositories

1

poptorch

PyTorch interface for the IPU
C++
176
star
2

poplibs

Poplar libraries
C++
115
star
3

tutorials

Training material for IPU users: tutorials, feature examples, simple applications
Python
86
star
4

tensorflow

TensorFlow for the IPU
C++
76
star
5

ogb-lsc-pcqm4mv2

The OGB-LSC is the Large Scale Competition by Open Graph Benchmark to help accelerate research into machine learning on graph structured data
Jupyter Notebook
64
star
6

portfolio-examples

Demonstrators and experimental applications for ML using Graphcore IPUs
Python
35
star
7

poprithms

Graph algorithms for machine learning frameworks
C++
27
star
8

distributed-kge-poplar

The application is a end-user training and evaluation system for standard knowledge graph embedding models. It was developed to optimise the WikiKG90Mv2 dataset
C++
13
star
9

graphcore-research

Implementations and illustrative code to accompany our research publications
12
star
10

gpt-j

Notebook for running GPT-J/GPT-J-6B โ€“ the cost-effective alternative to ChatGPT, GPT-3 & GPT-4 for many NLP tasks. Available on IPUs as a Paperspace notebook.
Python
12
star
11

pytorch-lightning-examples

A collection of tutorials and examples showing how to use Graphcore's IPUs with PyTorch Lightning
Python
9
star
12

Gradient-HuggingFace

Tasks and tutorials using Graphore's IPU with Hugging Face. Originally at https://github.com/gradient-ai/Graphcore-HuggingFace
Jupyter Notebook
9
star
13

PopTransformer

PopTransformer provides a fundamental framework(including layers, operators, models, etc) that allow users to develop and run highly optimized transformer-based models(inference-only) with Poplar SDK on Graphcore IPU.
C++
8
star
14

legacy_drivers_and_tools

6
star
15

PopRT

Python
6
star
16

Gradient-Pytorch-Geometric

A repository of tutorials and examples demonstrating use of PyTorch Geometric with IPUs
Jupyter Notebook
6
star
17

popart

Poplar Advanced Runtime for the IPU
C++
5
star
18

popvision_graph_analyser

5
star
19

license-checker

A tool to accumulate license information for pip and aptitude dependencies.
Python
5
star
20

demo-in-a-box

Jupyter Notebook
5
star
21

popvision_system_analyser

4
star
22

dolly-ai

Run Dolly, the worldโ€™s first truly open instruction-tuned LLM, with your own prompts on IPUs
Python
4
star
23

api-deployment

Example of deployment of a NLP inference server on Gcore. Using FastAPI, Huggingface's optimum-graphcore and Github workflows.
Python
4
star
24

simple-server-framework

Simple Server Framework provides a wrapper to add serving to an application using a minimal declarative config and utilities to package and deploy the application.
Python
3
star
25

whisper-ai

Speech Recognition (ASR) on Graphcore IPUs using OpenAI's Whisper
Jupyter Notebook
2
star
26

caas-poplar-appliance

caas-poplar-appliance
Jinja
2
star
27

graphcore-cloud-tools

Graphcore cloud utilities to support Paperspace functionality and user monitoring.
Python
2
star
28

helm-charts

2
star
29

ipu_tensorflow_addons

IPU TensorFlow Addons
Python
2
star
30

flan-t5

Notebook for Flan-T5 โ€“ an alternative to large language models like GPT-3 & GPT-4 for NLP tasks like named entity recognition and text generation.
Jupyter Notebook
2
star
31

keras

Keras for the IPU
Python
1
star
32

popxl-addons

A collection of addons for PopXL
Python
1
star
33

tgn-ipu

Python
1
star
34

stable-diffusion

Notebook for running Stable Diffusion โ€“ the Generative AI alternative to Dall-E and Midjourney โ€“ on IPUs
Jupyter Notebook
1
star
35

examples-utils

Utils and common code for Graphcore's example applications
Python
1
star
36

ipu_assembly_support

Visual Studio Code extension to support writing IPU assembly.
Rust
1
star
37

Gradient-Pytorch

Jupyter Notebook
1
star