Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Sep 13, 2025

This PR improves the overall String/Bytes and nested container handling
It also fixes a bug for temp object recycling when temp object.

  • Introduce formal API for string/bytes creation
  • Updates the tuple/dict conversion to also preserve the torch stream
    • So if a function takes a list of torch.Tensor, stream will be setup in context
  • Optimizes recursive argument conversion by moving most logic into c++

@tqchen tqchen changed the title [FFI][ABI] Better String handling [FFI][ABI] Better String and Nested Container handling Sep 13, 2025
This PR improves the overall String/Bytes and nested container handling
It also fixes a bug for temp object recycling when temp object.

- Introduce formal API for string/bytes creation
- Updates the tuple/dict conversion to also preserve the torch stream
   - So if a function takes a list of torch.Tensor, torch stream will be setup in context
- Optimizes recursive argument conversion by moving most logic into c++
@spectrometerHBH spectrometerHBH merged commit 678984f into apache:main Sep 13, 2025
13 checks passed
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
[FFI][ABI][REFACTOR] Better String and nested container handling

This PR improves the overall String/Bytes and nested container handling
It also fixes a bug for temp object recycling when temp object.

- Introduce formal API for string/bytes creation
- Updates the tuple/dict conversion to also preserve the torch stream
   - So if a function takes a list of torch.Tensor, torch stream will be setup in context
- Optimizes recursive argument conversion by moving most logic into c++
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
[FFI][ABI][REFACTOR] Better String and nested container handling

This PR improves the overall String/Bytes and nested container handling
It also fixes a bug for temp object recycling when temp object.

- Introduce formal API for string/bytes creation
- Updates the tuple/dict conversion to also preserve the torch stream
   - So if a function takes a list of torch.Tensor, torch stream will be setup in context
- Optimizes recursive argument conversion by moving most logic into c++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants