Lightning-AI / Lightning-AI/pytorch-lightning
New feature of adding Intel® Extension for Transformers weight-only quantization into Lightning Fabric API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Description & Motivation
Hello,
We are the team working on the development of [Intel® Extension for Transformers](https://github.com/intel/intel-extension-for-transformers). We would like to discuss the `quantize` feature in relation to our projects.
Allow us to provide an introduction to both projects firstly:
- [Intel® Extension for Transformers](https://github.com/intel/intel-extension-for-transformers) (ITREX) is an innovative toolkit to accelerate Transformer-based models on Intel platforms, in particular effective on 4th Intel Xeon Scalable processor Sapphire Rapids (codenamed Sapphire Rapids).
We would like to integrate ITREX into the PyTorch Lightning Fabric API. This integration could involve INT8/INT4/FP4/NF4 weight-only quantization feature.
We would like to ask if there is an opportunity for us to make some contributions in this regard.
Thanks
### Pitch
Here is a simple use case:
```python
from lightning.fabric.plugins import ITREXPrecision
precision = ITREXPrecision(mode="int8") # mode: Literal["int8", "int4_fullrange", "int4_clip", "nf4", "fp4_e2m1"]
fabric = Fabric(plugins=precision)
model = MyModel()
model = fabric.setup(model)
```
For more details of ITREX 4-bit, please refer to the medium blog of [Intel-Optimized Llama.CPP](https://medium.com/@NeuralCompressor/llm-performance-of-intel-extension-for-transformers-f7d061556176)
### Alternatives
_No response_
### Additional context
_No response_
cc @borda
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Lightning Fabric API and the linked Intel® Extension for Transformers project, then compare the proposed ITREXPrecision/Fabric setup with existing precision integrations. The issue names no files, tests, or acceptance criteria, so clarify the supported quantization modes, integration surface, and validation plan before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- api, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100