7 Commits

Author SHA1 Message Date
Tianqi Chen e479a5dbe7 [RUNTIME][PYTHON] Add explicit Target device conversion (#20005)
## Summary

Compiler Targets can carry device-type semantics that runtime
device-name parsing does not preserve.

- add `tvm.device_from_target` for canonical Target-to-Device
translation
- use explicit runtime constructors where the device kind is fixed
- update target-derived utilities, tests, and documentation to use the
explicit boundary
2026-07-15 05:34:21 +08:00
Tianqi Chen 33dcea1686 [REFACTOR][LINT] Modernize ruff config (#18810)
This PR removes the extra lint violations from the codebase so lint
aligns with the latest style
2026-02-23 07:29:21 -05:00
Tianqi Chen aa2e609136 [LINT] Modernize lint to use pre-commit hooks (#18807)
This PR migrates existing lint to use pre-commit hooks
2026-02-22 11:03:21 -05:00
Tianqi Chen 543e64dbb1 [FFI][REFACTOR] Cleanup tvm_ffi python API and types (#18277)
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
2025-09-07 10:38:50 -04:00
Florin Blanaru 553eb1acd0 [tests] add utility to replace direct call to pytest.main (#11393) 2022-05-23 11:52:22 -07:00
Christopher Sidebottom 796e71aa74 Add Python representation for VirtualDevice (#9812)
* Add Python representation for VirtualDevice

This adds a Python class to represent the VirtualDevice so that the
behaviour for `device_type()` can be semi-replicated.

These tests were actually not being ran and were broken so I've added
them to the integration script.

* Update other references to make_virtual_device
2022-01-04 15:49:07 +00:00
Mark Shields bd61d18c19 [Relay] s/SEScope/VirtualDevice/g (#9759)
* [Relay] s/SEScope/VirtualDevice/g

Nobody liked 'SEScope', and 'DeviceMcDeviceFace' is too verbose, so it
seems 'VirtualDevice' has the popular vote.
2021-12-17 09:53:07 -05:00