This is an automated email from the ASF dual-hosted git repository.
junrushao 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 bad3896f [FIX] Fix the config loading in windows case (#490)
bad3896f is described below
commit bad3896fcd7b49a350978ec0be34926479341188
Author: Tianqi Chen <[email protected]>
AuthorDate: Sun Mar 1 14:55:28 2026 -0500
[FIX] Fix the config loading in windows case (#490)
This PR fixes the config loading in windows case, sometimes in wheel
settings the testcase may still need to load core.pyd, so we by default
load the library in config mode when it is windows.
---
python/tvm_ffi/__init__.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/python/tvm_ffi/__init__.py b/python/tvm_ffi/__init__.py
index 6d84bc44..70221f9e 100644
--- a/python/tvm_ffi/__init__.py
+++ b/python/tvm_ffi/__init__.py
@@ -111,7 +111,14 @@ if TYPE_CHECKING or not _is_config_mode():
float8_e8m0fnu,
float4_e2m1fnx2,
)
+elif sys.platform.startswith("win32"):
+ # On Windows, load the library even in config CLI mode so the DLL search
path
+ # is set correctly (needed in some cases when test still loads cython
extensions).
+ from . import libinfo
+
+ LIB = libinfo.load_lib_ctypes("apache-tvm-ffi", "tvm_ffi", "RTLD_GLOBAL")
+# normal version imports
try:
from ._version import __version__, __version_tuple__
except ImportError: