Skip to content

Support external weights in CG Input IR - #1522

Merged
Zhenchao Ni (zhenchaoni) merged 1 commit into
mainfrom
private/zhenni/cgir_external_weights
Nov 6, 2026
Merged

Zhenchao Ni (zhenchaoni) merged 1 commit into
mainfrom
private/zhenni/cgir_external_weights

Conversation

@zhenchaoni

Copy link
Copy Markdown
Member

Summary

Support IX-exported external CGIR weights in Windows ML Runtime inference and compilation.

Use IX's tensor metadata to bind read-only memory-mapped resources automatically. Resource preparation stays outside inference timing. No export/build changes or manual resource mapping are required.

Usage

winml export -m model.onnx -o model.mlir --target cgir --cgc-options external-weights=true
winml perf -m model.mlir --runtime winml-runtime --backend cgc --device gpu --iterations 1 --warmup 1

Keep the generated model.mlir.data alongside model.mlir; weights are loaded automatically.

@zhenchaoni
Zhenchao Ni (zhenchaoni) requested a review from a team as a code owner November 6, 2026 06:58

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 both Runtime load call sites and the external-resource preparation helper. No blocking findings. Local validation: all 92 runtime-session tests passed. Additional checks with mocked Foundry metadata covered bytecode selection, an exact-end slice, rejection of negative/out-of-file ranges, empty external-tensor metadata, and the ONNX/Output IR bypasses. Read-only views retain their shared mmap as intended. CI checks are green. Actual IX parsing and native Runtime external-resource lifetime/inference were not exercised locally.

@zhenchaoni
Zhenchao Ni (zhenchaoni) merged commit 54bcef7 into main Nov 6, 2026
9 checks passed
@zhenchaoni
Zhenchao Ni (zhenchaoni) deleted the private/zhenni/cgir_external_weights branch November 6, 2026 07:06
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