[EXTRA] Simplify StructuralMap engine policy - #771
Merged
Conversation
tlopex
approved these changes
Sep 9, 2026
tqchen
force-pushed
the
refactor/structural-map-engine-policy
branch
2 times, most recently
from
September 9, 2026 15:22
cf40162 to
8eb6c7c
Compare
Member
Author
Impact of the recent StructuralMap speed improvements (#768 and this PR)Preliminary numbers from a minimal benchmark (a mini-TIR built from tvm-ffi types: a split/fuse expression tree and x86 (AMD EPYC 7413)
aarch64 (Neoverse V2)
|
tqchen
force-pushed
the
refactor/structural-map-engine-policy
branch
3 times, most recently
from
September 9, 2026 18:29
5ac5299 to
eb283f8
Compare
StructuralMap needs identity state only to keep variables consistent when descent rewrites a definition. Callback results are separate: callbacks run at every occurrence in their selected pre- or post-descent position. Make default C++ descent the sole owner of FreeVar and DAG remapping, with definitions binding rewritten results and unchanged simple definitions left absent. Keep the remap ABI stable and use an owned raw-pointer-keyed store for efficient identity lookups. Adopt whole raw TVMFFIAny results by value while leaving destructor-visible slot moves pointer-based. Initialize owning Any storage member-wise so GCC retains scalar state and avoids an overlapping narrow-store/wide-reload stall. Update existing C++ and Python expectations in place and document StructuralMap as post(D(pre)) alongside StructuralWalk's stateless tree traversal. Rust remains unchanged for a follow-up.
tqchen
force-pushed
the
refactor/structural-map-engine-policy
branch
from
September 9, 2026 20:45
eb283f8 to
b085f41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[EXTRA] Simplify StructuralMap engine policy
StructuralMap needs identity state only to keep variables consistent when
descent rewrites a definition. Callback results are separate: callbacks run
at every occurrence in their selected pre- or post-descent position.
Make default C++ descent the sole owner of FreeVar and DAG remapping, with
definitions binding rewritten results and unchanged simple definitions left
absent. Keep the remap ABI stable and use an owned raw-pointer-keyed store for
efficient identity lookups.
Adopt whole raw TVMFFIAny results by value while leaving destructor-visible
slot moves pointer-based. Initialize owning Any storage member-wise so GCC
retains scalar state and avoids an overlapping narrow-store/wide-reload stall.
Update existing C++ and Python expectations in place and document
StructuralMap as post(D(pre)) alongside StructuralWalk's stateless tree
traversal. Rust remains unchanged for a follow-up.