Bug report of quantizing Falcon40b using GPTQConfig
Author: SantiDianaClibrain
Pull request: no

### System Info

I am receiving an error while trying to quantize a falcon-type model using GPTQConfig. 

**System information**
- `transformers` version: 4.31.1
- Python version: 3.11.5
- Huggingface_hub version: 0.15.1
- Accelerate version: 0.21.0

**Who can help?**
@SunMarc and @younesbelkada 


### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

```
model_id = "tiiuae/falcon-40b"

quantization_config = GPTQConfig(
     bits=4,
     group_size=128,
     dataset=quant_ds,
     desc_act=False,
)

tokenizer = AutoTokenizer.from_pretrained(model_id)
quant_model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quantization_config, device_map='auto')
```

The error reported  is:

```
from optimum.gptq import GPTQQuantizer
ImportError: cannot import name 'GPTQQuantizer' from partially initialized module 'optimum.gptq' (most likely due to a circular import) (/mnt/data/wangjiancheng/miniconda3/envs/autogptq/lib/python3.9/site-packages/optimum/gptq/__init__.py)
```
The same code worked for me with a llama-like model.

### Expected behavior

Code with no error

Comments:
Hi @SantiDianaClibrain , thanks for reporting. I am unable to reproduce the error on my side. Which version of optimum and transformers are you using ? Does the script work by just changing the model to a llama model ? Make sure to not name your file to gptq.py. It will lead to import error. 

Hey @SunMarc. Thanks for your quick reply. I am using:
`transformers` == 4.33.1
`optimum` == 1.13.1

By the way, I rerunned the code and found another issue, Let's see if that sounds familiar to you.

```
Traceback (most recent call last):                                                                                                                                                                          
  File "/home/santi/quantizer.py", line 27, in <module>
    quant_model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quantization_config, device_map='auto',trust_remote_code=True)
  File "/opt/conda/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 558, in from_pretrained
    return model_class.from_pretrained(
  File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3241, in from_pretrained
    quantizer.quantize_model(model, quantization_config.tokenizer)
  File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/optimum/gptq/quantizer.py", line 419, in quantize_model
    scale, zero, g_idx = gptq[name].fasterquant(
  File "/opt/conda/lib/python3.10/site-packages/auto_gptq/quantization/gptq.py", line 112, in fasterquant
    H = torch.linalg.cholesky(H, upper=True)
torch._C._LinAlgError: linalg.cholesky: The factorization could not be completed because the input is not positive-definite (the leading minor of order 32410 is not positive-definite).
```

That happens when loading `model_id = tiiuae/falcon-40b`, which is the standard falcon 40b of HuggingFace. Don't know what can be happening. 

I used exactly the same code with a` llama-7b` and I was capable of quantizing it. 

Are you using a custom dataset to calibrate the quantization? It's computing some matrix using the dataset and it seems to run into an issue. You should probably ask in auto_gptq library as we use that as the backend. 

Yes I am! Okay, thanks for the reply.