facebookresearch / facebookresearch/SpinQuant
How to adapt source model project loading for W4A16KV16 model
- Dominant language
- Python
- Stars
- 428
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
I used the script (bash scripts/10_optimize_rotation.sh meta-llama/Llama-2-7b 4 16 16) to quantize W4A16KV16. Then I saved the model weights and structure.
The way I export the model is as follows:
In line 50 of ptq.py `model = ptq_model(ptq_args, model, model_args)` add the following code
```python
print("\n")
print("save weights of pytorch")
torch.save(model.statedict(),"mergedweights/torch/consolidated.00.pth")
```
Theoretically, W4A16KV16 only uses the R1 R2 rotation matrix and will not make any changes to the model structure. It should be possible to use the source model project to load, but it failed. My error message is as follows

Contributor guide
Assessment
This issue has not been assessed yet.