You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gptqmodel/utils/__init__.py
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,12 +16,24 @@
16
16
17
17
from .backendimportBACKEND
18
18
from .loggerimportsetup_logger
19
-
from .pythonimporthas_gil, log_gil_required
19
+
from .pythonimportgte_python_3_13_3, has_gil_control, has_gil_disabled, log_gil_requirements_for
20
+
21
+
log=setup_logger()
20
22
21
23
# TODO: datasets is not compatible with free threading
22
-
ifhas_gil():
24
+
ifhas_gil_disabled():
25
+
log.info("Python GIL is disabled and GPTQModel will auto enable multi-gpu quant acceleration for MoE models plus multi-cpu accelerated packing.")
23
26
from .perplexityimportPerplexity
24
27
else:
25
-
log_gil_required("utils/Perplexity")
28
+
ifhas_gil_control():
29
+
log.warn(
30
+
"Python >= 3.13T (free-threading) version detected but GIL is not disabled due to manual override or `regex` package compatibility which can be ignored. Please disable GIL via env `PYTHON_GIL=0`.")
31
+
32
+
log.warn(
33
+
"Python GIL is enabled: Multi-gpu quant acceleration for MoE models is sub-optimal and multi-core accelerated cpu packing is also disabled. We recommend Python >= 3.13.3t with Pytorch > 2.8 for mult-gpu quantization and multi-cpu packing with env `PYTHON_GIL=0`.")
log.warn.once(f"Feature `{feature}` requires python GIL. Feature is currently skipped/disabled.")
23
+
# torch compile requires GIL=1 or python 3.13.3t with GIL=0
24
+
deflog_gil_requirements_for(feature: str):
25
+
log.warn.once(f"Feature `{feature}` requires python GIL or Python > 3.13.3T (T for Threading-Free edition of Python) plus Torch 2.8. Feature is currently skipped/disabled.")
0 commit comments