Downloads · 30 days
233
6% of all-time downloads
microsoft/Phi-3-small-8k-instruct-onnx-cuda
Phi-3-small-8k-instruct-onnx-cuda is a text generation model from microsoft. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This repository hosts the optimized versions of Phi-3-small-8k-instruct to accelerate inference with ONNX Runtime for your machines with NVIDIA GPUs.
Downloads · 30 days
233
6% of all-time downloads
All-time downloads
3.9K
Public
Repo size
20.6 GB
Likes
18
Trending 1
Click a slice to open those files.
.data20.6 GB · 100%
From the Hugging Face model README
This repository hosts the optimized versions of Phi-3-small-8k-instruct to accelerate inference with ONNX Runtime for your machines with NVIDIA GPUs.
Phi-3 Small is a 7B parameter, lightweight, state-of-the-art open model trained with the Phi-3 datasets, which include both synthetic data and filtered publicly available website data, with a focus on high-quality and reasoning-dense properties. The model belongs to the Phi-3 family with the small version in two variants: 8K and 128K, which are the context lengths (in tokens) that they can support.
The base model has undergone a post-training process that incorporates both supervised fine-tuning and direct preference optimization for the instruction following and safety measures. When assessed against benchmarks testing common sense, language understanding, math, code, long context, and logical reasoning, Phi-3-Small-8K-Instruct showcased a robust and state-of-the-art performance among models of the same-size and next-size-up.
Optimized variants of the Phi-3 Small models are published here in ONNX format and run with ONNX Runtime on GPU across devices, including server platforms, Windows, and Linux.
Here are some of the optimized configurations we have added:
Note: Using the Hugging Face CLI, you can download sub folders and not all models if you are limited on disk space. The FP16 model is recommended for larger batch sizes, while the INT4 model optimizes performance for lower batch sizes.
Example:
# Download just the FP16 model
$ huggingface-cli download microsoft/Phi-3-small-8k-instruct-onnx-cuda --include cuda-fp16/* --local-dir . --local-dir-use-symlinks False
To support the Phi-3 models across a range of devices, platforms, and EP backends, we introduce a new API to wrap several aspects of generative AI inferencing. This API makes it easy to drag and drop LLMs straight into your app. To run the early version of these models with ONNX, follow the steps here.
The ONNX models are tested on:
Minimum Configuration Required:
Phi-3 Small-8K-Instruct performs better with ONNX Runtime compared to PyTorch for all batch size, prompt length combinations. For FP16 CUDA, ORT performs up to 4X faster than PyTorch, while with INT4 CUDA, it's up to 10.9X faster than PyTorch.
The table below shows the average throughput of the first 256 tokens generated (tps) for FP16 and INT4 precisions on CUDA as measured on 1 A100 80GB GPU, SKU: Standard_ND96amsr_A100_v4.
| Batch Size, Prompt Length | ORT FP16 CUDA | PyTorch Eager FP16 CUDA | Speed Up ORT/PyTorch |
|---|---|---|---|
| 1, 16 | 74.62 | 16.81 | 4.44 |
| 4, 16 | 290.36 | 65.56 | 4.43 |
| 16,16 | 1036.93 | 267.33 | 3.88 |
| Batch Size, Prompt Length | ORT INT4 CUDA | PyTorch Eager INT4 CUDA | Speed Up ORT/PyTorch |
|---|---|---|---|
| 1, 16 | 140.68 | 12.93 | 10.88 |
| 4, 16 | 152.90 | 44.04 | 3.47 |
| 16,16 | 582.07 | 160.57 | 3.62 |
| Pip package name | Version |
|---|---|
| torch | 2.3.0 |
| triton | 2.3.0 |
| onnxruntime-gpu | 1.18.0 |
| transformers | 4.40.2 |
| bitsandbytes | 0.43.1 |
parinitarahi, kvaishnavi, natke
Kunal Vaishnavi, Sunghoon Choi, Yufeng Li, Tianlei Wu, Sheetal Arun Kadam, Rui Ren, Baiju Meswani, Natalie Kershaw, Parinita Rahi