Repository navigation
Description
Describe the bug
When building a model (specific code) using both fla-core and autoround+gptqmodel_marlin, the model builds correctly but when forward on the "other" package, if it uses triton, it triggers an error like:
File "/home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages/fla/ops/gated_delta_rule/chunk.py", line 169, in forward
q, q_rstd = l2norm_fwd(q)
^^^^^^^^^^^^^
File "/home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages/fla/modules/l2norm.py", line 170, in l2norm_fwd
l2norm_fwd_kernel[grid](
File "/home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages/triton/runtime/jit.py", line 370, in <lambda>
return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages/gptqmodel/utils/nogil_patcher.py", line 234, in patched_run
config, used_cached_result, bench_time = _get_config_for_key(self, key, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages/gptqmodel/utils/nogil_patcher.py", line 159, in _get_config_for_key
with self._cache_lock:
^^^^^^^^^^^^^^^^
AttributeError: 'Autotuner' object has no attribute '_cache_lock'
GPU Info
Show output of:
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 590.44.01 Driver Version: 590.44.01 CUDA Version: 13.1 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5090 On | 00000000:09:00.0 On | N/A |
| 30% 39C P5 31W / 575W | 110MiB / 32607MiB | 25% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA GeForce RTX 4090 On | 00000000:0A:00.0 On | Off |
| 30% 36C P0 45W / 450W | 518MiB / 24564MiB | 10% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
Software Info
Operation System/Version + Python Version
Show output of:
Name: GPTQModel
Version: 5.7.0
Summary: Production ready LLM model compression/quantization toolkit with hw accelerated inference support for both cpu/gpu via HF, vLLM, and SGLang.
Home-page: https://github.com/ModelCloud/GPTQModel
Author:
Author-email: ModelCloud <[email protected]>
License-Expression: Apache-2.0
Location: /home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages
Requires: accelerate, datasets, device-smi, dill, hf_transfer, huggingface_hub, kernels, logbar, maturin, numpy, packaging, pillow, protobuf, pyarrow, pypcre, safetensors, threadpoolctl, tokenicer, torch, torchao, transformers
Required-by:
---
Name: torch
Version: 2.10.0+cu130
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org
Author:
Author-email: PyTorch Team <[email protected]>
License: BSD-3-Clause
Location: /home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages
Requires: cuda-bindings, filelock, fsspec, jinja2, networkx, nvidia-cublas, nvidia-cuda-cupti, nvidia-cuda-nvrtc, nvidia-cuda-runtime, nvidia-cudnn-cu13, nvidia-cufft, nvidia-cufile, nvidia-curand, nvidia-cusolver, nvidia-cusparse, nvidia-cusparselt-cu13, nvidia-nccl-cu13, nvidia-nvjitlink, nvidia-nvshmem-cu13, nvidia-nvtx, sympy, triton, typing-extensions
Required-by: accelerate, auto-round, bitblas, bitsandbytes, entmax, eole, fla-core, flash_attn, GPTQModel, pytorch-lightning, torchmetrics, torchvision, unbabel-comet
---
Name: transformers
Version: 5.2.0
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: [email protected]
License: Apache 2.0 License
Location: /home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer-slim
Required-by: auto-round, GPTQModel, TokeNicer, unbabel-comet
---
Name: accelerate
Version: 1.12.0
Summary: Accelerate
Home-page: https://github.com/huggingface/accelerate
Author: The HuggingFace team
Author-email: [email protected]
License: Apache
Location: /home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages
Requires: huggingface_hub, numpy, packaging, psutil, pyyaml, safetensors, torch
Required-by: auto-round, GPTQModel
---
Name: triton
Version: 3.6.0
Summary: A language and compiler for custom Deep Learning operations
Home-page: https://github.com/triton-lang/triton/
Author: Philippe Tillet
Author-email: [email protected]
License:
Location: /home/vincent/miniconda3/envs/pt2.10/lib/python3.11/site-packages
Requires:
Required-by: torch
If you are reporting an inference bug of a post-quantized model, please post the content of config.json and quantize_config.json.
To Reproduce
How to reproduce this bug if possible.
Expected behavior
A clear and concise description of what you expected to happen.
Model/Datasets
Make sure your model/dataset is downloadable (on HF for example) so we can reproduce your issue.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Activity
Qubitium commentedon Mar 4, 2026
@vince62s Can you poat a script that can reproduce this? GPTQMODEL patches triton loading to fix threaded triton crashes but it appears multiple pkgs use triton and the order of triton code loading causing some inatances to be unpatched.
vince62s commentedon Mar 5, 2026
yes exactly the case, so there is only two ways of solving this:
Hope this helps.
Qubitium commentedon Mar 6, 2026
@vince62s Looks like the only way is gptqmodel to expose an externally callable Tirton patch that you can call at the top of your script before all other pkg init/imports. Added to to do list.
Qubitium commentedon Mar 9, 2026
Closed as completed. You can now import and directly call the patcher at the top of your script: