/ Модель

Характеристики

Контекст
4 096 токенов
Параметры
13,8 млрд
Лицензия
MIT
Архитектура
phi3 · dense
Опубликована
19 мая 2024

Phi-3-medium-4k-instruct-onnx-cuda

Генерация текстаТекст → текст15 профессий

Конверсия Phi-3 Medium-4K-Instruct в ONNX для генерации текста и диалоговых задач с инференсом на NVIDIA GPU через CUDA.

257скачиваний за 30 дней12лайковвеса обновлены23 янв 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Microsoft Phi-3 Medium-4K-Instruct в этом репозитории представлен в формате ONNX и оптимизирован для инференса через ONNX Runtime на NVIDIA GPU с CUDA. Это конверсия инструкционной модели семейства Phi-3 с плотной архитектурой Phi3ForCausalLM и примерно 13,8 млрд параметров; исходная модель прошла дообучение с учителем и оптимизацию по предпочтениям для следования инструкциям и повышения безопасности. Модель принимает текст и генерирует текстовые ответы в диалоговом формате; поддерживает контекст до 4096 токенов. В README описаны варианты FP16 и INT4, причём INT4 получен квантованием RTN; метаданные указывают формат ONNX.

Модель подходит для диалоговых ассистентов, ответов на вопросы, рассуждений, математики и генерации кода. README сообщает о тестировании на NVIDIA A100 и минимальном требовании CUDA GPU с Compute Capability 7.0 или выше; приведённые замеры производительности относятся к A100 и не гарантируют таких же результатов на другом оборудовании. Лицензия — MIT.

Сценарии применения

  • создание диалогового ассистента
  • ответы на вопросы и выполнение инструкций
  • генерация и объяснение кода
  • решение математических задач
  • текстовые рассуждения в пределах контекста 4096 токенов

Ограничения

Для CUDA требуется NVIDIA GPU с Compute Capability 7.0 или выше; производительность зависит от оборудования и выбранной точности. Контекст ограничен 4096 токенами.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Phi-3 Medium-4K-Instruct ONNX CUDA models

This repository hosts the optimized versions of Phi-3-medium-4k-instruct to accelerate inference with ONNX Runtime for your machines with NVIDIA GPUs.

Phi-3 Medium is a 14B parameter, lightweight, state-of-the-art open model trained with the Phi-3 datasets, which include both synthetic data and the filtered publicly available websites data, with a focus on high-quality and reasoning dense properties. The model belongs to the Phi-3 family with the medium version in two variants: 4K 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-Medium-4K-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 Medium models are published here in ONNX format and run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, and Linux, with the precision best suited to each of these targets.

ONNX Models

Here are some of the optimized configurations we have added:

  1. ONNX model for FP16 CUDA: ONNX model for NVIDIA GPUs.
  2. ONNX model for INT4 CUDA: ONNX model for NVIDIA GPUs using int4 quantization via RTN.

How do you know which is the best ONNX model for you:

  • Are you on a Windows machine with GPU?

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

How to Get Started with the Model

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.

Hardware Supported

The models are tested on:

  • 1 A100 GPU, SKU: Standard_ND96amsr_A100_v4 (CUDA)

Minimum Configuration Required:

Model Description

  • Developed by: Microsoft
  • Model type: ONNX
  • Language(s) (NLP): Python, C, C++
  • License: MIT
  • Model Description: This is a conversion of the Phi-3 Medium-4K-Instruct model for ONNX Runtime inference.

Additional Details

Performance Metrics

CUDA

Phi-3 Medium-4K-Instruct performs better with ONNX Runtime compared to PyTorch for all batch size, prompt length combinations. For FP16 CUDA, ORT performs up to 5X faster than PyTorch, while with INT4 CUDA, it's up to 10X faster than PyTorch. It is also up to 3X faster than llama.cpp for large batch sizes.

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 LengthORT FP16 CUDAPyTorch Eager FP16 CUDASpeed Up ORT/PyTorch
1, 1647.3214.413.28
4, 16190.0584.432.25
16, 16707.68347.522.04
16, 64698.22342.832.04
Batch Size, Prompt LengthORT INT4 CUDAPyTorch Eager INT4 CUDASpeed Up ORT/PyTorch
1, 16115.6814.897.77
4, 1688.5345.221.96
16, 16341.8168.362.03

Package Versions

Pip package nameVersion
torch2.3.0
triton2.3.0
onnxruntime-gpu1.18.0
transformers4.40.2
bitsandbytes0.43.1

Appendix

Model Card Contact

parinitarahi, kvaishnavi, natke

Contributors

Kunal Vaishnavi, Sunghoon Choi, Yufeng Li, Sheetal Arun Kadam, Rui Ren, Natalie Kershaw, Parinita Rahi

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет весов в формате PyTorch/safetensors.

Класс архитектуры
Phi3ForCausalLM
Ревизия весов
5152243

0 моделей