microsoft / microsoft/onnxruntime

VitisAI EP: Add compilation timeout and better error handling for transformer models

Open
#26,755 4 comments 0 reactions 1 assignee Assigned to @hariharans29 View on GitHub
ep:VitisAI model:transformer
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

## Problem Statement
VitisAI execution provider hangs indefinitely when attempting to compile transformer models (BERT) on AMD Ryzen AI hardware, requiring manual process termination. This affects developer experience and makes transformer deployment on Ryzen AI NPUs impractical.

**Update (08DEC25)**: Tested with BF16 quantization (AMD's recommended format for transformers). Result: **BF16 also hangs identically**, confirming this is not a quantization issue but a fundamental VitisAI compilation bug affecting all transformer quantization formats.

## Current Behavior

## Proposed Enhancements

### 1. Compilation Timeout
Add configurable timeout for model compilation with fallback to next provider.

### 2. Architecture Detection
Detect transformer vs CNN architectures and log warnings.

### 3. Verbose Progress Logging
Add compilation stage logging to help diagnose hangs.

### 4. Unsupported Operator Detection
Before compilation, check for known unsupported operators and warn/fallback.

## Benefits
1. **Better Developer Experience**: No more infinite hangs requiring manual kill
2. **Faster Iteration**: Developers know immediately if model won't compile
3. **Better Error Messages**: Clear guidance on what's wrong and how to fix
4. **Graceful Degradation**: Automatic fallback to CPU keeps applications working

## Testing Environment
- Hardware: Lenovo Yoga Slim 7x (AMD Ryzen AI 9 HX 370, 50 TOPS NPU)
- Software: ONNX Runtime 1.20.1 dev, RyzenAI 1.6.0, Windows 11
- Models: BERT-base-uncased (hangs), ResNet50 (works)

**BF16 Test (08DEC25)**:
- Model: BERT-base-uncased, opset 17, BF16 quantized (98KB)
- Result: Hangs identically to INT8 - confirms issue is not quantization-specific

## Reproduction
See AMD RyzenAI-SW issue (will link after filing) for complete reproduction steps.

## Willingness to Contribute
I'm willing to contribute a PR with these enhancements if the approach is acceptable to maintainers. Can coordinate via AI orchestration (Ø-code methodology) to implement C++ changes with oversight.

## Related
- Related AMD RyzenAI-SW issue: [link after filing]
- Issue #92 - VitisAI transformer support discussion

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.