AutoGPTQ: Problems with cQIGen on windows

Hi. I’ve tried to use AutoGPTQForCausalLM and got the following error: ModuleNotFoundError: No module named 'cQIGen'

And I couldn’t find anything about that module in the internet. What is also confusing, in the setup.py of the project there is a code:

if platform.system() != 'Windows': extensions.append( cpp_extension.CppExtension( "cQIGen"

But in the qlinear_qigen: try: import cQIGen as qinfer except ImportError: logger.error('cQIGen not installed.') raise

So, it’s not supposed to install it on windows, but without it that module can’t be used.

How to solve that issue?

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 16

Most upvoted comments

For me, it worked going to Lib/site-packages/auto_gptq/utils/peft_utils.py and changing the following lines (21-26)

from ..nn_modules.qlinear.qlinear_qigen import QuantLinear as QuantLinearQigen
from ..nn_modules.qlinear.qlinear_triton import QuantLinear as QuantLinearTriton

 LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama, QuantLinearQigen ,QuantLinearTriton]

to

import platform
if platform.system() != 'Windows':
  from ..nn_modules.qlinear.qlinear_qigen import QuantLinear as QuantLinearQigen
  from ..nn_modules.qlinear.qlinear_triton import QuantLinear as QuantLinearTriton
  LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama, QuantLinearQigen ,QuantLinearTriton]
else:
  LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama]

and then commenting everytime QuantLinearQigen and QuantLinearTriton appear in that .py

For me, it worked going to Lib/site-packages/auto_gptq/utils/peft_utils.py and changing the following lines (21-26)

from ..nn_modules.qlinear.qlinear_qigen import QuantLinear as QuantLinearQigen
from ..nn_modules.qlinear.qlinear_triton import QuantLinear as QuantLinearTriton

 LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama, QuantLinearQigen ,QuantLinearTriton]

to

import platform
if platform.system() != 'Windows':
  from ..nn_modules.qlinear.qlinear_qigen import QuantLinear as QuantLinearQigen
  from ..nn_modules.qlinear.qlinear_triton import QuantLinear as QuantLinearTriton
  LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama, QuantLinearQigen ,QuantLinearTriton]
else:
  LinearLayer = Union[torch.nn.Linear, GeneralQuantLinear, QuantLinearCuda,
    QuantLinearCudaOld, QuantLinearExllama]

and then commenting everytime QuantLinearQigen and QuantLinearTriton appear in that .py

This worked for me as well, thanks!

So basically there will no longer be direct support for Windows? depend on using the old version. or is there another method. besides wsl.

And if you are going to use WSL, what would you have to do? @qwopqwop200 Would it run everything in WSL?