Skip to content

Conversation

@cbalint13
Copy link
Contributor

@cbalint13 cbalint13 commented Aug 14, 2025

This updates the python calls to the new registry home.

See the new paths:

.def_packed("dtype.register_custom_type",
[](ffi::PackedArgs args, ffi::Any* ret) {
datatype::Registry::Global()->Register(
args[0].cast<std::string>(), static_cast<uint8_t>(args[1].cast<int>()));
})
.def_packed("dtype.get_custom_type_code",
[](ffi::PackedArgs args, ffi::Any* ret) {
*ret = datatype::Registry::Global()->GetTypeCode(args[0].cast<std::string>());
})
.def_packed("dtype.get_custom_type_name",
[](ffi::PackedArgs args, ffi::Any* ret) {
*ret = Registry::Global()->GetTypeName(args[0].cast<int>());
})

Usage errors:

  File "/usr/lib64/python3.14/site-packages/tvm/target/datatype.py", line 58, in register
    tvm.runtime._ffi_api._datatype_register(type_name, type_code)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'tvm.runtime._ffi_api' has no attribute '_datatype_register'

Cc @tqchen

@cbalint13 cbalint13 marked this pull request as ready for review August 14, 2025 22:46
@cbalint13 cbalint13 merged commit 6850a94 into apache:main Aug 15, 2025
14 of 16 checks passed
@cbalint13 cbalint13 deleted the ffi-dtype branch August 28, 2025 16:38
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