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:
parent
3d563794af
commit
96edc89442
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue