This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push:
new b03cc78 [TORCH] robustify torch jit module support for earlier ver
(#53)
b03cc78 is described below
commit b03cc7845ae92060881e14c4f50a4b6da4d9f982
Author: Tianqi Chen <[email protected]>
AuthorDate: Tue Sep 23 21:02:14 2025 -0400
[TORCH] robustify torch jit module support for earlier ver (#53)
This PR robustifies torch jit module for earlier versions
---
pyproject.toml | 2 +-
python/tvm_ffi/_optional_torch_c_dlpack.py | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index e3ebf1c..83a280b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,7 +17,7 @@
[project]
name = "apache-tvm-ffi"
-version = "0.1.0b6"
+version = "0.1.0b7"
description = "tvm ffi"
authors = [{ name = "TVM FFI team" }]
diff --git a/python/tvm_ffi/_optional_torch_c_dlpack.py
b/python/tvm_ffi/_optional_torch_c_dlpack.py
index 5be7211..cc40b31 100644
--- a/python/tvm_ffi/_optional_torch_c_dlpack.py
+++ b/python/tvm_ffi/_optional_torch_c_dlpack.py
@@ -415,6 +415,7 @@ ScalarType toScalarTypeForDLPackv1(const DLDataType& dtype)
{
false, "Unsupported kDLFloat8_e8m0fnu bits ",
std::to_string(dtype.bits));
}
break;
+#if TORCH_VERSION_MAJOR >= 2 && TORCH_VERSION_MINOR >= 8
case DLDataTypeCode::kDLFloat4_e2m1fn:
switch (dtype.bits) {
case 4:
@@ -432,6 +433,7 @@ ScalarType toScalarTypeForDLPackv1(const DLDataType& dtype)
{
false, "Unsupported kDLFloat4_e2m1fn bits ",
std::to_string(dtype.bits));
}
break;
+#endif
default:
TORCH_CHECK(false, "Unsupported code ", std::to_string(dtype.code));
}