gpu_init: satisfy the import-hoist lint in the compile-thread patch

The checker does not count attribute assignment on an aliased module
import as a use and flagged _zoo_common as added-but-unused. Set the
attribute through importlib.import_module instead; importlib is already
a module-level import here. Behaviour unchanged.
This commit is contained in:
Daniel Han 2026-06-12 07:08:10 +00:00
commit 96edc89442

View file

@ -199,8 +199,10 @@ if os.environ.get("UNSLOTH_FORCE_SINGLE_COMPILE_WORKER", "0") == "1":
pass
os.environ["TORCHINDUCTOR_COMPILE_THREADS"] = "1"
try:
from unsloth_zoo.temporary_patches import common as _zoo_common
_zoo_common.determine_compile_threads = lambda: 1
setattr(
importlib.import_module("unsloth_zoo.temporary_patches.common"),
"determine_compile_threads", lambda: 1,
)
except Exception:
pass