Skip to content

Automatically load compiled CG Output IR without recompiling - #1519

Merged
Qiong Wu (qiowu) (DingmaomaoBJTU) merged 3 commits into
microsoft:mainfrom
DingmaomaoBJTU:codex/offline-dml-precompiled-load
Nov 5, 2026
Merged

Qiong Wu (qiowu) (DingmaomaoBJTU) merged 3 commits into
microsoft:mainfrom
DingmaomaoBJTU:codex/offline-dml-precompiled-load

Conversation

@DingmaomaoBJTU

@DingmaomaoBJTU Qiong Wu (qiowu) (DingmaomaoBJTU) commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Offline DML CG Output IR can fail with 0x80070032 when WinMLRuntimeSession sends an already compiled artifact through the compiler again, even though CLI compilation and reload validation succeeded.

Detect Output IR internally by parsing the top-level module interface attribute through the MLIR C API. A cgc_output interface loads directly into the Runtime pipeline; Input IR and ONNX retain the existing compilation path. Both text and bytecode artifacts are supported, without scanning filenames/comments or adding a public API flag. Classification happens before loading the Runtime model to avoid leaking native handles if parsing fails.

Validation:

  • Native RTX 4080 checks with Windows ML Runtime 2.8.183.dev0 passed for both text and bytecode DML Output IR. Forcing the previous recompile path reproduces 0x80070032; automatic detection loads and runs the same artifact with exact expected outputs.
  • Runtime-session and classification unit regressions: 96 passed.
  • Ruff check passed.

Rebased on upstream main d7055f9. The original RTX 5090 D benchmark roster has not been rerun. No caller/API changes are required for Output IR detection.

@DingmaomaoBJTU Qiong Wu (qiowu) (DingmaomaoBJTU) changed the title Fix offline DML loading with explicit precompiled CGC sessions Automatically load compiled CG Output IR without recompiling Nov 5, 2026
@DingmaomaoBJTU
Qiong Wu (qiowu) (DingmaomaoBJTU) merged commit 607d7bd into microsoft:main Nov 5, 2026
9 checks passed
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.

3 participants