You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tqchen (via GitHub)" <gi...@apache.org> on 2026/04/30 13:36:38 UTC

[PR] [FFI][ABI] Bump tvm-ffi to 0.1.11rc2 [tvm]

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

   ## Summary
   
   Bumps `3rdparty/tvm-ffi` from `1fed0ae` (0.1.10) to `3c35034` (0.1.11rc2).
   Two TVM-side fixes are needed for the bump:
   
   - `include/tvm/ir/type.h`: drop redundant `span` field registration
     from `TupleTypeNode`, `FuncTypeNode`, and `TensorMapTypeNode`.
     tvm-ffi now warns when a child re-registers an ancestor field;
     `span` is already registered on `TypeNode` with `SEqHashIgnore`.
   - `python/tvm/relax/frontend/torch/dynamo.py`: short-circuit
     `to_torch_tensor` for `torch.Tensor` items. tvm-ffi #517 added
     recursive DLPack container conversion so `torch.Tensor` inputs
     auto-promote `Array` elements to `torch.Tensor` on iteration; the
     helper previously only handled `tvm.runtime.Tensor` / `tvm_ffi.Array`.
   
   ## Test plan
   
   - [x] `pytest tests/python/relax/test_frontend_dynamo.py` → 9 passed, 1 skipped (`test_arange` skip is pre-existing)
   - [x] `python -c "import tvm"` → zero span duplicate warnings
   - [x] `pre-commit run --all-files` → clean


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [FFI][ABI] Bump tvm-ffi to 0.1.11rc2 [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19484:
URL: https://github.com/apache/tvm/pull/19484#discussion_r3168316409


##########
python/tvm/relax/frontend/torch/dynamo.py:
##########
@@ -58,6 +58,11 @@ def _relax_backend(graph_module, example_inputs):
 
         def to_torch_tensor(nd_tensor):
             """A helper function to transfer a Tensor to torch.tensor."""
+            if isinstance(nd_tensor, torch.Tensor):
+                # tvm-ffi #517 (Recursive DLPack container conversion) auto-converts
+                # ffi::Tensor items returned in containers back to torch.Tensor when
+                # the call site passed torch.Tensor inputs.
+                return nd_tensor
             if isinstance(nd_tensor, tvm.runtime.Tensor):

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   For consistency and clarity, use `elif` here to maintain a single conditional chain. Since the preceding `if` block for `torch.Tensor` already returns, using `elif` makes it explicit that these checks are mutually exclusive and part of the same type-dispatch logic, matching the style used for `tvm_ffi.Array` below.
   
   ```suggestion
               elif isinstance(nd_tensor, tvm.runtime.Tensor):
   ```



-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [FFI][ABI] Bump tvm-ffi to 0.1.11rc2 [tvm]

Posted by "cyx-6 (via GitHub)" <gi...@apache.org>.
cyx-6 merged PR #19484:
URL: https://github.com/apache/tvm/pull/19484


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org