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

我要开发同款
匿名用户2024年07月31日
100阅读

技术信息

开源地址
https://modelscope.cn/models/LLM-Research/Phi-3-medium-4k-instruct-onnx-directml
授权协议
mit

作品详情

Phi-3 Medium-4K-Istruct ONNX DirectML models

This repository hosts the optimized versios of Phi-3-medium-4k-istruct to accelerate iferece with DirectML ad ONNX Rutime for your machies with GPUs.

Phi-3 Medium is a 14B parameter, lightweight, state-of-the-art ope model traied with the Phi-3 datasets, which iclude both sythetic data ad the filtered publicly available websites data, with a focus o high-quality ad reasoig dese properties. The model belogs to the Phi-3 family with the medium versio i two variats: 4K ad 128K, which are the cotext legths (i tokes) that they ca support.

The model has uderwet a post-traiig process that icorporates both supervised fie-tuig ad direct preferece optimizatio for the istructio followig ad safety measures. Whe assessed agaist bechmarks testig commo sese, laguage uderstadig, math, code, log cotext, ad logical reasoig, Phi-3-Medium-4K-Istruct showcased a robust ad state-of-the-art performace amog models of the same-size ad ext-size-up.

Optimized variats of the Phi-3 Medium models are published here i ONNX format ad ru with DirectML. This lets developers brig hardware acceleratio to Widows devices at scale across AMD, Itel, ad NVIDIA GPUs.

ONNX Models

Here are some of the optimized cofiguratios we have added:

  1. ONNX model for INT4 DML: ONNX model optimized to ru with DirectML ad quatized to it4 precisio usig AWQ*.

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

  • Are you o a Widows machie with GPU?

How to Get Started with the Model

To support the Phi-3 models across a rage of devices, platforms, ad EP backeds, we itroduce a ew API to wrap several aspects of geerative AI iferecig. This API makes it easy to drag ad drop LLMs straight ito your app. To ru the early versio of these models with ONNX, follow the steps here. You ca also test this with a chat app.

Hardware Supported

The model has bee tested o:

  • GPU SKU: RTX 4090 (DirectML)

Miimum Cofiguratio Required:

  • Widows: DirectX 12-capable GPU ad a miimum of 10GB of combied RAM

Model Descriptio

  • Developed by: Microsoft
  • Model type: ONNX
  • Laguage(s) (NLP): Pytho, C, C++
  • Licese: MIT
  • Model Descriptio: This is a coversio of the Phi-3 Medium-4K-Istruct model for ONNX Rutime iferece.

Additioal Details

Performace Metrics

DirectML

We measured the performace of DirectML ad ONNX Rutime's ew Geerate() API with Phi-3 medium quatized with Activatio-Aware Quatizatio AWQ ad with a block size of 128 o Widows. Our test machie had a NVIDIA GeForce RTX 4090 GPU ad a Itel Core i9-13900K CPU. DirectML lets developers ot oly achieve great performace but also lets developers deploy models across the etire Widows ecosystem with support from AMD, Itel, ad NVIDIA. Best of all, AWQ meas that developers get this scale while also maitaiig high model accuracy.

Stay tued for additioal performace improvemets i the comig weeks thaks to optimized drivers from our hardware parters, alog with additioal updates to the ONNX Rutime Geerate() API.

Batch Size, Prompt Legth Block Size = 32 Block Size = 128
1, 16 66.36 72.39

Package Versios

Pip package ame Versio
torch 2.2.0
trito 2.2.0
oxrutime-gpu 1.18.0
trasformers 4.39.0
bitsadbytes 0.42.0

Appedix

Activatio Aware Quatizatio

AWQ works by idetifyig the top 1% most saliet weights that are most importat for maitaiig accuracy ad quatizig the remaiig 99% of weights. This leads to less accuracy loss from quatizatio compared to may other quatizatio techiques. For more o AWQ see here.

Model Card Cotact

pariitarahi, kvaishavi, atke

Cotributors

Kual Vaishavi, Sughoo Choi, Yufeg Li, Sheetal Aru Kadam, Natalie Kershaw, Pariita Rahi, Patrice Vigola, Xiag Zhag, Chai Chaoweeraprasit, Loga Iyer, Vicete Rivera, Jacques Va Rhy

功能介绍

Phi-3 Medium-4K-Instruct ONNX DirectML models This repository hosts the optimized versions of Phi-3

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论