microsoft / microsoft/onnxruntime-genai

[C#] Regression on 0.5.0 with DML

Open
#1,071 15 comments 2 reactions 0 assignees View on GitHub
ep:DML
Dominant language
C++
Stars
1.1k
Forks
354
Avg merge
2d 16h
Merged PRs (30d)
85

Description

**Describe the bug**
C# Version 0.5.0 broke DML models, such as microsoft--Phi-3-mini-4k-instruct-onnx directml-int4-awq-block-128.
The model loads, but the Generator's constructor throws an Access violation exception.

**To Reproduce**
Steps to reproduce the behavior:
1. Try running [Phi3 Sample](https://github.com/microsoft/onnxruntime-genai/tree/main/examples/csharp/HelloPhi) with DML
2. Exception line [98](https://github.com/microsoft/onnxruntime-genai/blob/main/examples/csharp/HelloPhi/Program.cs#L98)

**Expected behavior**
Works just as 0.4.0.

**Desktop (please complete the following information):**
- OS: Windows 11 (24H2)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/csharp/HelloPhi/Program.cs at line 98 and reproduce the Phi-3 sample using DML on Windows 11. Compare the C# Generator construction and relevant behavior between versions 0.4.0 and 0.5.0; done means the DML model loads and the sample runs without an Access violation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.