[Fix][Relax][Torch] Materialize runtime scalar shape values - #20138
[Fix][Relax][Torch] Materialize runtime scalar shape values#20138akaashrp wants to merge 5 commits into
Conversation
|
@tvm-bot rerun |
|
Failed to re-run CI in https://github.com/apache/tvm/actions/runs/32556288920 Detailswith response |
tlopex
left a comment
There was a problem hiding this comment.
The overall direction makes sense, but several cases still need to be fixed. Symbolic eq is currently lowered to a constant True, which causes dynamic torch.cond to select the wrong branch. The new scalar materialization helper is also not used by fill/fill_, so importing them without decomposition still fails. In addition, full incorrectly defaults runtime integer fill values to float32, and full_like ignores an explicitly specified dtype. Please fix these cases and add corresponding regression tests.
|
and also resolve the conflict |
bf23939 to
6e73650
比较
|
Ahh I have a look, now explicit |
Materialize runtime integer scalars from
torch.exportas Relax symbolic values and convert them back to rank-zero tensors for fill operations. Preservefull/full_likedtype semantics, support directfill/fill_without decomposition, and lower symbolic shape comparisons as real predicates. Runtime scalar extraction now also accepts statically one-element integer tensors at higher ranks and signed/unsigned integer dtypes, preserving negative, unsigned, and 64-bit values. Python scalar fills are materialized in the destination dtype acrossfull,full_like,fill,fill_,masked_fill, andmasked_fill_, avoiding 32-bit narrowing or precision loss. Symbolic boolean fills, negation, floor division, and modulo are also supported.