Skip to content

Spool native warnings without pipes during EP compilation - #1265

Closed
KayMKM wants to merge 1 commit into
mainfrom
yuesu/fix-vitisai-warning-filter-hang
Closed

Spool native warnings without pipes during EP compilation#1265
KayMKM wants to merge 1 commit into
mainfrom
yuesu/fix-vitisai-warning-filter-hang

Conversation

@KayMKM

@KayMKM KayMKM commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the pipe used by native warning suppression with a file-backed temporary spool
  • filter and replay preserved native diagnostics only after restoring stderr
  • retain fail-open behavior, Windows handle restoration, warning filtering, and bounded memory usage

Root cause

The warning filter introduced in #1246 redirected native stderr to a pipe. VitisAI can hang inside ort.InferenceSession when its compiler sees that pipe handle. The reader was draining correctly, so this was not the full-buffer deadlock fixed by #1223; changing the reader to defer replay still hung, which isolated the pipe handle itself as the trigger.

A temporary file preserves warning filtering without pipe semantics or a finite producer buffer. With an empty VAIP cache and no VitisAI-specific bypass, facebook/convnext-tiny-224 completed on VitisAI NPU in 144.1 seconds. Disabling warning filtering entirely completed the same workload in 145.1 seconds.

Validation

  • uv run --no-sync pytest tests/unit/utils/test_native_stderr.py tests/unit/commands/test_perf_cli.py -q --basetemp temp/pytest_tmp/native-warning-file-backed-final (143 passed, 1 platform skip)
  • uvx ruff check src/winml/modelkit/utils/native_stderr.py tests/unit/utils/test_native_stderr.py src/winml/modelkit/commands/perf.py tests/unit/commands/test_perf_cli.py
  • cold-cache VitisAI NPU perf with warning filtering enabled: PASS in 144.1s

@KayMKM
KayMKM requested a review from a team as a code owner July 31, 2026 07:12
@KayMKM KayMKM closed this Jul 31, 2026
@KayMKM KayMKM changed the title Avoid native stderr redirect for VitisAI perf Spool native warnings without pipes during EP compilation Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant