Skip to content

Spool native warnings without pipes during EP compilation - #1266

Merged
KayMKM merged 1 commit into
mainfrom
yuesu/fix-vitisai-warning-filter-hang
Jul 31, 2026
Merged

Spool native warnings without pipes during EP compilation#1266
KayMKM merged 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:39

@DingmaomaoBJTU DingmaomaoBJTU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the native stderr spooling changes; no blocking issues found.

@KayMKM
KayMKM merged commit e27a0fa into main Jul 31, 2026
9 checks passed
@KayMKM
KayMKM deleted the yuesu/fix-vitisai-warning-filter-hang branch July 31, 2026 08:20
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.

2 participants