Skip to content

[FIX][Relax] Guard unknown tensor shapes in VMShapeLower - #20345

Open
ruiling-smartbear wants to merge 1 commit into
apache:mainfrom
ruiling-smartbear:fix/vm-shape-unknown-tuple
Open

ruiling-smartbear wants to merge 1 commit into
apache:mainfrom
ruiling-smartbear:fix/vm-shape-unknown-tuple

Conversation

@ruiling-smartbear

@ruiling-smartbear ruiling-smartbear commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #20335.

The static-shape shortcut dereferenced a missing ShapeExpr for unknown-shape tensor fields. Guard that shortcut and keep the existing runtime checks. Add coverage for unknown-shape tuple parameters and the reported BundleModelParams → VMShapeLower sequence.

Validation on Linux CPU / LLVM 16, based on cc0f9f07 and its pinned TVM FFI:

  • Original relevant tests: 19 passed. New unknown-shape reproducer and full build reproducer: both SIGSEGV (-11).
  • After the fix: shape-lowering and parameter-bundling suites, 21 passed.
  • The full build reproducer now raises an ordinary InternalError at VM codegen instead of crashing; this does not add Prim-parameter execution support.
  • Changed-file pre-commit checks passed. No GPU tests run.

Only apply the static-shape shortcut when a ShapeExpr exists. Keep unknown tensor shapes on the existing runtime-check path and cover bundled symbolic parameters.
@ruiling-smartbear
ruiling-smartbear force-pushed the fix/vm-shape-unknown-tuple branch from 3233f40 to e8a968f Compare September 15, 2026 21:57
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.

[Bug][Relax] BundleModelParams output (tuple param with symbolic-shape fields) segfaults VMShapeLower

1 participant