Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Sep 7, 2025

This PR cleans up the python API to make things more consistent with existing python array api and torch.

Device update

  • device_id => index, to be consistent with torch
  • device_type => dlpack_device_type() returns int
  • added type property same as torch.device

API updates:

  • Move the convenient method like cpu() out into tvm runtime to keep device minimal
  • tvm_ffi._init_api => tvm_ffi.init_ffi_api
  • tvm_ffi.register_func => tvm_ffi.register_global_func

Added docstrings and examples to most public APIs.

@tqchen tqchen force-pushed the ffi-api branch 3 times, most recently from 7d08ba8 to 2f37c05 Compare September 7, 2025 00:34
@tqchen tqchen changed the title i[FFI][REFACTOR] Cleanup tvm_ffi python API and types [FFI][REFACTOR] Cleanup tvm_ffi python API and types Sep 7, 2025
@tqchen tqchen force-pushed the ffi-api branch 3 times, most recently from 8eb24f7 to 1ead62d Compare September 7, 2025 12:19
This PR cleans up the python API to make things more consistent
with existing python array api and torch.

Device update
- device_id => index, to be consistent with torch
- device_type => dlpack_device_type() returns int
- added type property same as torch.device

API updates:

- Move the convenient method like cpu() out into tvm runtime to keep device minimal
- tvm_ffi._init_api => tvm_ffi.init_ffi_api
- tvm_ffi.register_func => tvm_ffi.register_global_func
@MasterJH5574 MasterJH5574 merged commit 543e64d into apache:main Sep 7, 2025
13 checks passed
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
This PR cleans up the python API to make things more consistent
with existing python array api and torch.

Device update
- device_id => index, to be consistent with torch
- device_type => dlpack_device_type() returns int
- added type property same as torch.device

API updates:

- Move the convenient method like cpu() out into tvm runtime to keep device minimal
- tvm_ffi._init_api => tvm_ffi.init_ffi_api
- tvm_ffi.register_func => tvm_ffi.register_global_func
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
This PR cleans up the python API to make things more consistent
with existing python array api and torch.

Device update
- device_id => index, to be consistent with torch
- device_type => dlpack_device_type() returns int
- added type property same as torch.device

API updates:

- Move the convenient method like cpu() out into tvm runtime to keep device minimal
- tvm_ffi._init_api => tvm_ffi.init_ffi_api
- tvm_ffi.register_func => tvm_ffi.register_global_func
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
This PR cleans up the python API to make things more consistent
with existing python array api and torch.

Device update
- device_id => index, to be consistent with torch
- device_type => dlpack_device_type() returns int
- added type property same as torch.device

API updates:

- Move the convenient method like cpu() out into tvm runtime to keep device minimal
- tvm_ffi._init_api => tvm_ffi.init_ffi_api
- tvm_ffi.register_func => tvm_ffi.register_global_func
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.

3 participants