orgTestCodacy11KRepos110MB/repo-9723-examples

Python

0

69 commits

updated Feb 1, 2023

See the code

README

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 and easily filter applications by domain and framework, please check out our Model Garden 🌷.

For more detailed benchmark information, please visit our Performance Results page.

The code presented here requires using Poplar SDK 3.1.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 require POD128/256 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

ModelDomainTypeLinks
ResNetImage ClassificationTraining & InferenceTensorFlow 2, PyTorch, PyTorch Lightning
ResNeXtImage ClassificationTraining & InferencePopART (Inference), PyTorch (Inference)
EfficientNetImage ClassificationTraining & InferencePyTorch, PyTorch Lightning
MobileNetv3Image ClassificationTraining & InferencePyTorch
ViT(Vision Transformer)Image ClassificationTrainingPyTorch, Hugging Face Optimum
DINOImage ClassificationTrainingPyTorch
SwinImage ClassificationTrainingPyTorch
MAE (Masked AutoEncoder)Image ClassificationTrainingPyTorch
Yolov4-P5Object DetectionInferencePyTorch
Faster RCNNObject DetectionTraining & InferencePopART
EfficientDetObject DetectionInferenceTensorFlow 2
UNet (Medical)Image segmentationTraining & InferenceTensorFlow 2
Neural Image FieldsNeural Radiance FieldsTrainingTensorFlow 2

Natural Language Processing

ModelDomainTypeLinks
BERTNLPTraining & InferencePyTorch , PopART, TensorFlow 2, PopXL, PaddlePaddle, Hugging Face Optimum
Packed BERTNLPTrainingPyTorch, PopART
GPT2NLPTrainingPyTorch , Hugging Face Optimum
GPTJNLPTrainingPopXL
GPT3-2.7BNLPTrainingPopXL
RoBERTaNLPTrainingHugging Face Optimum
DeBERTaNLPTrainingHugging Face Optimum
HuBERTNLPTrainingHugging Face Optimum
BARTNLPTrainingHugging Face Optimum
T5NLPTrainingHugging Face Optimum

Speech

ModelDomainTypeLinks
DeepVoice3TTS (TextToSpeech)Training & InferencePopART
FastSpeech2TTS(TextToSpeech)Training & InferenceTensorFlow 2
FastpitchTTS (TextToSpeech)TrainingPyTorch
ConformerSTT(SpeechToText)Training & InferencePopART, PyTorch
Transfomer TransducerSTT(SpeechToText)Training & InferencePopART
Wav2Vec2STT(SpeechToText)TrainingHugging Face Optimum

Multimodal

ModelDomainTypeLinks
miniDALL-EmultimodalTrainingPyTorch
CLIPmultimodalTrainingPyTorch
LXMERTmultimodalTrainingHugging Face Optimum
Frozen in timemultimodalTraining & InferencePyTorch
ruDalle (Preview)multimodalInferencePopXL

Graph Neural Network

ModelDomainTypeLinks
MPNN (Message Passing Neural Networks)GNNTraining & InferenceTensorFlow 2
Spektral GNN library with QM9GNNTrainingTensorFlow 2
Cluster GCNGNNTraining & InferenceTensorFlow 2
TGN (Temporal Graph Networks)GNNTrainingPyTorch

AI for Simulation

ModelDomainTypeLinks
DeepDriveMDBiology (Protein folding)TrainingTensorFlow 2
Approximate Bayesian Computation (ABC) COVID-19MedicalInferenceTensorFlow 2

Sparsity

ModelDomainTypeLinks
Block-Sparse librarySparsityTraining & InferencePopART

Miscellaneous

ModelDomainTypeLinks
Monte Carlo Ray TracingGraphicsInferencePoplar

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

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>

For more information on using the examples-utils benchmarking module, please refer to the README.


PopVision™ Tools

Visualise your code's inner workings with a user-friendly, graphical interface to optimise your machine learning models.

Download PopVision to analyse IPU performance and utilisation.


Support

If you encounter a problem or want to suggest an improvement to our examples please raise a Github issue or contact us at [email protected].


Utilities

The utils/ folder contains utilities libraries and scripts that are used across the other code examples. This includes:

  • utils/examples_tests - Common Python helper functions for the repository's 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

Dec 2022
  • Added this model below to reference models
    • GNN: TGN (PyTorch)
  • Deprecating all PopART applications. Support will be removed in the next release.
  • Deprecated all TensorFlow 1 applications.
  • Deprecated Ubuntu 18.04 support.
Sep 2022
  • Added those models below to reference models
    • Vision : MAE (PyTorch), G16 EfficientNet (PyTorch)
    • NLP : GPTJ (PopXL), GPT3-2.7B (PopXL)
    • Multimodal : Frozen in time (PyTorchs), ruDalle(Preview) (PopXL)
  • Deprecating all TensorFlow 1 applications. Support will be removed in the next release.
Aug 2022
  • Change the folder name of 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 Simultation, Recomender systems, Reinforcement learning, Probability, Multimodal, and Miscellaneous.
  • Added those models below to reference 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 those models below to reference 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 those models below to reference models
    • Vision : miniDALL-E(PyTorch), Faster RCNN(PopART), UNet(TensorFlow 2), ResNet50(TensorFlow 2)
    • NLP : BERT(TensorFlow 2)
    • Speech : FastSpeech2(TensorFlow 2), Transfomer Transducer(PopART), Conformer-Small(PyTorch)
    • GNN : TGN(TensorFlow 1), MPNN(TensorFlow 2)

Connect with us

orgTestCodacy11KRepos110MB/repo-9723-examples

Python

0

69 commits

updated Feb 1, 2023

See the code

README

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 and easily filter applications by domain and framework, please check out our Model Garden 🌷.

For more detailed benchmark information, please visit our Performance Results page.

The code presented here requires using Poplar SDK 3.1.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 require POD128/256 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

ModelDomainTypeLinks
ResNetImage ClassificationTraining & InferenceTensorFlow 2, PyTorch, PyTorch Lightning
ResNeXtImage ClassificationTraining & InferencePopART (Inference), PyTorch (Inference)
EfficientNetImage ClassificationTraining & InferencePyTorch, PyTorch Lightning
MobileNetv3Image ClassificationTraining & InferencePyTorch
ViT(Vision Transformer)Image ClassificationTrainingPyTorch, Hugging Face Optimum
DINOImage ClassificationTrainingPyTorch
SwinImage ClassificationTrainingPyTorch
MAE (Masked AutoEncoder)Image ClassificationTrainingPyTorch
Yolov4-P5Object DetectionInferencePyTorch
Faster RCNNObject DetectionTraining & InferencePopART
EfficientDetObject DetectionInferenceTensorFlow 2
UNet (Medical)Image segmentationTraining & InferenceTensorFlow 2
Neural Image FieldsNeural Radiance FieldsTrainingTensorFlow 2

Natural Language Processing

ModelDomainTypeLinks
BERTNLPTraining & InferencePyTorch , PopART, TensorFlow 2, PopXL, PaddlePaddle, Hugging Face Optimum
Packed BERTNLPTrainingPyTorch, PopART
GPT2NLPTrainingPyTorch , Hugging Face Optimum
GPTJNLPTrainingPopXL
GPT3-2.7BNLPTrainingPopXL
RoBERTaNLPTrainingHugging Face Optimum
DeBERTaNLPTrainingHugging Face Optimum
HuBERTNLPTrainingHugging Face Optimum
BARTNLPTrainingHugging Face Optimum
T5NLPTrainingHugging Face Optimum

Speech

ModelDomainTypeLinks
DeepVoice3TTS (TextToSpeech)Training & InferencePopART
FastSpeech2TTS(TextToSpeech)Training & InferenceTensorFlow 2
FastpitchTTS (TextToSpeech)TrainingPyTorch
ConformerSTT(SpeechToText)Training & InferencePopART, PyTorch
Transfomer TransducerSTT(SpeechToText)Training & InferencePopART
Wav2Vec2STT(SpeechToText)TrainingHugging Face Optimum

Multimodal

ModelDomainTypeLinks
miniDALL-EmultimodalTrainingPyTorch
CLIPmultimodalTrainingPyTorch
LXMERTmultimodalTrainingHugging Face Optimum
Frozen in timemultimodalTraining & InferencePyTorch
ruDalle (Preview)multimodalInferencePopXL

Graph Neural Network

ModelDomainTypeLinks
MPNN (Message Passing Neural Networks)GNNTraining & InferenceTensorFlow 2
Spektral GNN library with QM9GNNTrainingTensorFlow 2
Cluster GCNGNNTraining & InferenceTensorFlow 2
TGN (Temporal Graph Networks)GNNTrainingPyTorch

AI for Simulation

ModelDomainTypeLinks
DeepDriveMDBiology (Protein folding)TrainingTensorFlow 2
Approximate Bayesian Computation (ABC) COVID-19MedicalInferenceTensorFlow 2

Sparsity

ModelDomainTypeLinks
Block-Sparse librarySparsityTraining & InferencePopART

Miscellaneous

ModelDomainTypeLinks
Monte Carlo Ray TracingGraphicsInferencePoplar

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

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>

For more information on using the examples-utils benchmarking module, please refer to the README.


PopVision™ Tools

Visualise your code's inner workings with a user-friendly, graphical interface to optimise your machine learning models.

Download PopVision to analyse IPU performance and utilisation.


Support

If you encounter a problem or want to suggest an improvement to our examples please raise a Github issue or contact us at [email protected].


Utilities

The utils/ folder contains utilities libraries and scripts that are used across the other code examples. This includes:

  • utils/examples_tests - Common Python helper functions for the repository's 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

Dec 2022
  • Added this model below to reference models
    • GNN: TGN (PyTorch)
  • Deprecating all PopART applications. Support will be removed in the next release.
  • Deprecated all TensorFlow 1 applications.
  • Deprecated Ubuntu 18.04 support.
Sep 2022
  • Added those models below to reference models
    • Vision : MAE (PyTorch), G16 EfficientNet (PyTorch)
    • NLP : GPTJ (PopXL), GPT3-2.7B (PopXL)
    • Multimodal : Frozen in time (PyTorchs), ruDalle(Preview) (PopXL)
  • Deprecating all TensorFlow 1 applications. Support will be removed in the next release.
Aug 2022
  • Change the folder name of 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 Simultation, Recomender systems, Reinforcement learning, Probability, Multimodal, and Miscellaneous.
  • Added those models below to reference 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 those models below to reference 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 those models below to reference models
    • Vision : miniDALL-E(PyTorch), Faster RCNN(PopART), UNet(TensorFlow 2), ResNet50(TensorFlow 2)
    • NLP : BERT(TensorFlow 2)
    • Speech : FastSpeech2(TensorFlow 2), Transfomer Transducer(PopART), Conformer-Small(PyTorch)
    • GNN : TGN(TensorFlow 1), MPNN(TensorFlow 2)

Connect with us