Instructions to use sptrodon/Optimum-Graphcore-Demo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sptrodon/Optimum-Graphcore-Demo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="sptrodon/Optimum-Graphcore-Demo")# Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("sptrodon/Optimum-Graphcore-Demo") model = AutoModelForQuestionAnswering.from_pretrained("sptrodon/Optimum-Graphcore-Demo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "auto_loss_scaling": false, | |
| "device_iterations": 1, | |
| "embedding_serialization_factor": 2, | |
| "enable_half_partials": true, | |
| "executable_cache_dir": "/tmp/exe_cache/introduction_to_optimum_graphcore", | |
| "execute_encoder_on_cpu_for_generation": false, | |
| "gradient_accumulation_steps": 256, | |
| "inference_device_iterations": 5, | |
| "inference_replication_factor": 1, | |
| "ipus_per_replica": 4, | |
| "layers_per_ipu": [ | |
| 3, | |
| 7, | |
| 7, | |
| 7 | |
| ], | |
| "matmul_proportion": [ | |
| 0.15, | |
| 0.18, | |
| 0.2, | |
| 0.25 | |
| ], | |
| "optimizer_state_offchip": true, | |
| "optimum_version": "1.6.1", | |
| "output_mode": "final", | |
| "recompute_checkpoint_every_layer": true, | |
| "replicated_tensor_sharding": false, | |
| "replication_factor": 1, | |
| "seed": 42, | |
| "sharded_execution_for_inference": false, | |
| "transformers_version": "4.20.1" | |
| } | |