I have python 3.11.5, VS Code, Cuda 12.2 (but installed 11.7 to be certain), torch 2.0.1 with cuda 11.7, running on Windows 11. Can give more details if asked.
I used this wheel to install https://github.com/PanQiWei/AutoGPTQ/releases/download/v0.4.1/auto_gptq-0.4.2+cu117-cp311-cp311-win_amd64.whl
and then pip install auto_gptq-0.4.2+cu117-cp311-cp311-win_amd64.whl
When I try to import auto_gptq, I get
OSError: [WinError 193] %1 is not a valid Win32 application
From what I read, there is incompatabilty between 64bit and 32bit of some systems, but have tried everything, reinstalled every dependency and whatnot, but issue persists.
Below is the full trace of the error.
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[23], line 1
----> 1 import auto_gptq
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\auto_gptq\__init__.py:4
2 from .modeling import BaseQuantizeConfig
3 from .modeling import AutoGPTQForCausalLM
----> 4 from .utils.peft_utils import get_gptq_peft_model
5 from .utils.exllama_utils import exllama_set_max_input_length
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\auto_gptq\utils\peft_utils.py:9
6 from typing import List, Optional
8 import torch
----> 9 from peft import get_peft_model, PeftConfig, PeftModel, PeftType
10 from peft.peft_model import PEFT_TYPE_TO_MODEL_MAPPING
11 from peft.tuners.lora import LoraConfig, LoraLayer, LoraModel, Embedding
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\__init__.py:22
1 # flake8: noqa
2 # There's no way to ignore "F401 '...' imported but unused" warnings in this
3 # module, but to preserve other warnings. So, don't check this module at all.
(...)
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 __version__ = "0.5.0"
---> 22 from .auto import (
23 AutoPeftModel,
24 AutoPeftModelForCausalLM,
25 AutoPeftModelForSequenceClassification,
26 AutoPeftModelForSeq2SeqLM,
27 AutoPeftModelForTokenClassification,
28 AutoPeftModelForQuestionAnswering,
29 AutoPeftModelForFeatureExtraction,
30 )
31 from .mapping import (
32 MODEL_TYPE_TO_PEFT_MODEL_MAPPING,
33 PEFT_TYPE_TO_CONFIG_MAPPING,
(...)
36 inject_adapter_in_model,
37 )
38 from .peft_model import (
39 PeftModel,
40 PeftModelForCausalLM,
(...)
45 PeftModelForFeatureExtraction,
46 )
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\auto.py:31
21 from transformers import (
22 AutoModel,
23 AutoModelForCausalLM,
(...)
27 AutoModelForTokenClassification,
28 )
30 from .config import PeftConfig
---> 31 from .mapping import MODEL_TYPE_TO_PEFT_MODEL_MAPPING
32 from .peft_model import (
33 PeftModel,
34 PeftModelForCausalLM,
(...)
39 PeftModelForTokenClassification,
40 )
43 class _BaseAutoPeftModel:
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\mapping.py:23
20 import torch
22 from .config import PeftConfig
---> 23 from .peft_model import (
24 PeftModel,
25 PeftModelForCausalLM,
26 PeftModelForFeatureExtraction,
27 PeftModelForQuestionAnswering,
28 PeftModelForSeq2SeqLM,
29 PeftModelForSequenceClassification,
30 PeftModelForTokenClassification,
31 )
32 from .tuners import (
33 AdaLoraConfig,
34 AdaLoraModel,
(...)
42 PromptTuningConfig,
43 )
44 from .utils import _prepare_prompt_learning_config
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\peft_model.py:38
36 from . import __version__
37 from .config import PeftConfig
---> 38 from .tuners import (
39 AdaLoraModel,
40 AdaptionPromptModel,
41 IA3Model,
42 LoraModel,
43 PrefixEncoder,
44 PromptEmbedding,
45 PromptEncoder,
46 )
47 from .utils import (
48 SAFETENSORS_WEIGHTS_NAME,
49 TRANSFORMERS_MODELS_TO_PREFIX_TUNING_POSTPROCESS_MAPPING,
(...)
62 shift_tokens_right,
63 )
66 PEFT_TYPE_TO_MODEL_MAPPING = {
67 PeftType.LORA: LoraModel,
68 PeftType.PROMPT_TUNING: PromptEmbedding,
(...)
73 PeftType.IA3: IA3Model,
74 }
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\tuners\__init__.py:21
1 # flake8: noqa
2 # There's no way to ignore "F401 '...' imported but unused" warnings in this
3 # module, but to preserve other warnings. So, don't check this module at all
(...)
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 from .adaption_prompt import AdaptionPromptConfig, AdaptionPromptModel
---> 21 from .lora import LoraConfig, LoraModel
22 from .ia3 import IA3Config, IA3Model
23 from .adalora import AdaLoraConfig, AdaLoraModel
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\peft\tuners\lora.py:45
41 from .tuners_utils import BaseTuner, BaseTunerLayer
44 if is_bnb_available():
---> 45 import bitsandbytes as bnb
48 @dataclass
49 class LoraConfig(PeftConfig):
50 """
51 This is the configuration class to store the configuration of a [`LoraModel`].
52
(...)
72 pattern is not in the common layers pattern.
73 """
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\bitsandbytes\__init__.py:5
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 #
3 # This source code is licensed under the MIT license found in the
4 # LICENSE file in the root directory of this source tree.
----> 5 from .optim import adam
6 from .nn import modules
7 print('='*30 + 'WARNING: DEPRECATED!' + '='*30)
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\bitsandbytes\optim\__init__.py:5
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 #
3 # This source code is licensed under the MIT license found in the
4 # LICENSE file in the root directory of this source tree.
----> 5 from .adam import Adam, Adam8bit, Adam32bit
6 from .adamw import AdamW, AdamW8bit, AdamW32bit
7 from .sgd import SGD, SGD8bit, SGD32bit
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\bitsandbytes\optim\adam.py:11
9 import torch
10 import torch.distributed as dist
---> 11 from bitsandbytes.optim.optimizer import Optimizer2State
12 import bitsandbytes.functional as F
14 class Adam(Optimizer2State):
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\bitsandbytes\optim\optimizer.py:6
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 #
3 # This source code is licensed under the MIT license found in the
4 # LICENSE file in the root directory of this source tree.
5 import torch
----> 6 import bitsandbytes.functional as F
8 from copy import deepcopy
9 from itertools import chain
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\site-packages\bitsandbytes\functional.py:13
10 from torch import Tensor
11 from typing import Tuple
---> 13 lib = ct.cdll.LoadLibrary(os.path.dirname(__file__) + '/libbitsandbytes.so')
14 name2qmap = {}
16 ''' C FUNCTIONS FOR OPTIMIZERS '''
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\ctypes\__init__.py:454, in LibraryLoader.LoadLibrary(self, name)
453 def LoadLibrary(self, name):
--> 454 return self._dlltype(name)
File c:\Users\georg\AppData\Local\Programs\Python\Python311\Lib\ctypes\__init__.py:376, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
373 self._FuncPtr = _FuncPtr
375 if handle is None:
--> 376 self._handle = _dlopen(self._name, mode)
377 else:
378 self._handle = handle
OSError: [WinError 193] %1 is not a valid Win32 application