Skip to content

[FIX][Relax] Preserve transform correctness edge cases - #20512

Open
Yuhx141 wants to merge 1 commit into
apache:mainfrom
Yuhx141:yuhx/fix-relax-transform-safety-20261001
Open

Yuhx141 wants to merge 1 commit into
apache:mainfrom
Yuhx141:yuhx/fix-relax-transform-safety-20261001

Conversation

@Yuhx141

@Yuhx141 Yuhx141 commented Oct 1, 2026

Copy link
Copy Markdown

This fixes four small correctness holes in Relax transformation passes:

  • keep AdjustMatmulOrder from reassociating a rank-one middle operand, whose row/column interpretation changes across the two orders;
  • preserve tuple outputs when a private callee is referenced by make_closure;
  • decode tensor_to_shape constants using their actual int16/int32/int64 storage dtype in FoldConstant;
  • propagate closure identity through a local function alias in LambdaLift and choose the invoke op from the function's purity.

The changes are local to the affected passes and retain the existing behavior for supported controls.

Closes #20492
Closes #20493
Closes #20495
Closes #20497

Tests:

  • pytest tests/python/relax/test_transform_remove_unused_outputs.py tests/python/relax/test_transform_fold_constant.py tests/python/relax/test_transform_lambda_lift.py -q (36 passed)
  • cmake --build build --parallel 3 (completed, including all four modified C++ sources)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment