Repository navigation
Conversation
…ined Since d5979f7 the forward shape rules also run on ranked results that keep a dynamic extent, and their type replaced the existing one outright. A rule can know less than the importer: opset-10 Slice takes its bounds as operands, so its rule reports every extent dynamic. On Gemma-4 E4B the pass widened 736 result types (e.g. the vision RoPE Slice 1x?x12x32 -> ?x?x?x?) and refined none. Slice conversion then built tensor.extract_slice with static sizes and the widened result type, which fails verification; eight subgraphs fell back to the CPU EP (decode 49 -> 8 TPS). The rule's type is now merged per dimension: an extent that is already static is kept, a dynamic one takes the rule's value, and a conflicting static extent leaves the result unchanged. Co-Authored-By: Cursor Claude Opus 5.5 <cursoragent@cursor.com> Made-with: Cursor
…t type d5979f7 gives an equal Split of a static axis static chunk lengths. When the declared result type leaves that axis dynamic, the slice was still built with the declared type, which disagrees with the static sizes and fails verification. Infer the slice type from its sizes and cast to the declared type when they differ. Co-Authored-By: Cursor Claude Opus 5.5 <cursoragent@cursor.com> Made-with: Cursor
|
Thanks for opening a PR! This project follows LLVM's incremental-development and AI-tool-use Before requesting review, please check that:
Reviewers are assigned through |
L2 Accuracy Results (EP vs CPU)
Threshold: 0.01 | Run: 7958 - Commit: |
Binary sizesBaseline: run 40457802257 -
MorphiZen EP Performance Results
EPContext Export Performance
EPContext Import Performance
OGA Benchmark Results
OGA Wheel Smoke (Python benchmark_e2e.py)
VLM Benchmark Results
TTFT / TPS vs mainBaseline: run 40457802257 -
Run: 7958 - Commit: |
|
Closing in favor of #1336, which now covers both fixes in this PR (per-dimension merge of inferred types, and the static equal-Split cast) and also fixes the hip.loop result/v_init mismatch in its second commit afa8642. On the same main (7f2f3ce), #1336 restores all 7 VLMs listed above, with the same decode TPS as this PR. #1346 (revert of #1306) also restores them. |
Summary
Restores the VLM vision encoders that stopped compiling after #1306. On current
main(7f2f3ce0), six of the seven VLMs we can run locally fail to compile; with this change all seven compile and run with no CPU fallback. Gemma-4 E4B decode at a 128-token prompt goes from 7.9 to 51.0 TPS.Related issue or design
Regression from #1306 (
d5979f76), reported on that PR. The NTS OGA dynamic dashboard has had no results for these VLMs since 10-24.Why
#1306 runs the forward shape rules in
hip-infer-loop-body-shapeson ranked results that still have a?, and replaces the stored type with the rule's result. A rule can know less than the importer. For opset-10 Slice the bounds are operands, so the rule reports every extent dynamic. On Gemma-4 E4B the pass widened 736 result types and refined none. The vision RoPE Slice went from1x?x12x32to?x?x?x?. Slice conversion then builttensor.extract_slicewith static sizes and the widened result type, which fails verification:With
session.disable_cpu_ep_fallback=1, as in CI, the session cannot be created. Without it, eight Gemma-4 E4B subgraphs fall back to the CPU EP.Separately, #1306 gives an equal Split of a static axis static chunk lengths. When the declared result type leaves that axis dynamic, the slice was still built with the declared type and failed verification.
What
InferLoopBodyShapesPass:refineResultTypemerges the rule's type into the stored one per dimension. A static extent is kept, a dynamic one takes the rule's value, and a conflicting static extent leaves the result unchanged. An unranked result still takes the rule type. The forward-inference write-back uses it instead ofsetType(type).SplitToStdTensor: buildtensor.extract_slicewith the type inferred from its sizes, andtensor.castto the declared type when the two differ.refinement_keeps_known_extentsinhip-infer-loop-body-shapes.mlir, and an equal split with a dynamic declared result intest_split.mlir.Test plan
7f2f3ce0+ this branch: 662 passed, 9 unsupported.pre-commit run --fileson the four changed files: all hooks passed.genai_config(session.disable_cpu_ep_fallback=1),dog.jpg, 128-token prompt, 32 generated tokens, 1 iteration. Decode TPS:main7f2f3ceQwen3.6-27B and Qwen3.8-27B ran at 13.3 and 14.2 TPS in the 10-23 NTS run, before #1306. Not covered locally: Nemotron-3-Nano-Omni (onnxruntime-genai rejects
nemotron_omni) and Mistral-Small-4-119B (does not fit in memory on this machine).Performance
maindecode / TTFTHardware: Strix Halo (gfx1151), Windows, OGA
vlm_benchmark,dog.jpg, 128 generated tokens, 1 warmup + 3 iterations, CPU fallback allowed. Onmaineight subgraphs fall back to the CPU EP. The 2k and 16k prompts were not run onmainbecause of that fallback.Notes for reviewers
Drafted with Cursor assistance. I reviewed the change, the lit and pre-commit results, and the measurements.
Checklist