Skip to content

Add Python-driven native DXCGC perf backend for local MLIR - #1473

Merged
Qiong Wu (qiowu) (DingmaomaoBJTU) merged 16 commits into
mainfrom
codex/native-dxcgc-perf
Oct 16, 2026
Merged

Qiong Wu (qiowu) (DingmaomaoBJTU) merged 16 commits into
mainfrom
codex/native-dxcgc-perf

Conversation

@DingmaomaoBJTU

@DingmaomaoBJTU Qiong Wu (qiowu) (DingmaomaoBJTU) commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Add a native DXCGC backend for local MLIR using the installed Windows ML Runtime DLLs. CPU round-trip measurements include Python output allocation, input upload, GPU execution, completion and independent CPU output readback; compilation and disk I/O are excluded. Runtime Offline implementation is unchanged.

The native host now uses ABI 3 with per-call validated input pointers and fixed-resource command-list replay after the prior fence completes. GPU timestamp instrumentation is opt-in. A paired benchmark driver feeds identical pre-generated input sequences to Raw and Runtime Offline, alternates run order, records provenance, and checks final-output agreement. Supports --disable-d3d-mlir-programs.

Validation: native Release build and CTest; 25 focused Python tests passed (2 GPU-fixture tests skipped), Ruff and mypy passed. OneVisual with 110 changing inputs per round (10 warmup, 100 measured), three alternating rounds: median P50 Raw 5.708 ms vs Offline 6.870 ms; final-output cosine >0.999997 in all three rounds. This measures complete paths, not isolated API overhead; it does not replace historical report data.

Comment thread native/dxcgc-perf/main.cpp Resolved
Comment thread native/dxcgc-perf/compare_sequence.py Resolved
@xieofxie

Copy link
Copy Markdown
Contributor

are we building a python binding dll ?

@DingmaomaoBJTU

Copy link
Copy Markdown
Collaborator Author

xieofxie Yes. This builds winml-dxcgc-python.dll, a small C++ benchmark bridge loaded through Python ctypes, rather than a general Python binding for the DXCGC API. It exposes setup/ABI entry points and an in-process per-inference callback so the Python loop can measure input upload, GPU execution/wait, and output readback with caller-owned NumPy outputs. The bridge loads DXCGC DLLs from the installed windowsml package and is built separately from the Python wheel. The Runtime Offline implementation is unchanged.

@timenick Zhipeng Wang (timenick) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed f94ea67. All four reported issues are addressed, with no additional actionable findings. Focused validation: 32 passed and 2 GPU-fixture tests skipped. Native GPU execution was not verified locally; some CI checks are still running.

🤖 Generated with Codex

@DingmaomaoBJTU
Qiong Wu (qiowu) (DingmaomaoBJTU) merged commit 88563a0 into main Oct 16, 2026
9 checks passed
@DingmaomaoBJTU
Qiong Wu (qiowu) (DingmaomaoBJTU) deleted the codex/native-dxcgc-perf branch October 16, 2026 03:46
Qiong Wu (qiowu) (DingmaomaoBJTU) added a commit that referenced this pull request Nov 3, 2026
This reverts commit 88563a0. Remove the later DXCGC-specific lowering test case alongside the reverted backend.
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.

4 participants