zupengwang opened a new pull request, #20220:
URL: https://github.com/apache/tvm/pull/20220

   Fixes #20190.
   Fixes #20207.
   
   `StaticPlanBlockMemory` propagates storage tokens through ordinary variable
   bindings and lowered reshape/view operations, but not through `MatchCast`.
   A `MatchCast` refines type information without allocating or copying storage,
   so losing the token can make the planner release and reuse the source 
allocation
   while the alias is still live. This causes silent wrong-code in the default
   Relax pipeline.
   
   This change propagates storage tokens through `MatchCast` bindings and adds a
   regression test showing that the aliased allocation remains live until its
   downstream use.
   
   Tests:
   
   - `python -m pytest -q 
tests/python/relax/test_transform_static_plan_block_memory.py`
     (`29 passed`)
   - `pre-commit run --files src/relax/transform/static_plan_block_memory.cc 
tests/python/relax/test_transform_static_plan_block_memory.py`
   - End-to-end compiled-VM reproducers for #20190 and #20207, comparing NumPy
     references before and after the patch
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to