Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
base_model: 0xSero/INTELLECT-3-REAP-50
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- mixture-of-experts
|
| 7 |
+
- moe
|
| 8 |
+
- llmcompressor
|
| 9 |
+
- fp8
|
| 10 |
+
- quantization
|
| 11 |
+
- glm4_moe
|
| 12 |
+
- text-generation-inference
|
| 13 |
+
- REAP
|
| 14 |
+
model_creator: Akicou
|
| 15 |
+
model_type: glm4_moe
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# INTELLECT-3-REAP-50-FP8-Dynamic
|
| 20 |
+
|
| 21 |
+
## Model Overview
|
| 22 |
+
This is a quantized version of **INTELLECT-3-REAP-50**, a Router Expert Activation Pruned (REAP) Mixture of Experts (MoE) model. This version has been compressed to **FP8-Dynamic** precision using the `llmcompressor` library to optimize it for high-performance inference with a reduced memory footprint.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
## Key Features
|
| 27 |
+
* **Quantization:** FP8-Dynamic (activations and weights).
|
| 28 |
+
* **Architecture:** REAP-optimized MoE based on GLM-4.
|
| 29 |
+
* **Efficiency:** Designed to run on modern GPUs (NVIDIA Ada Lovelace and Hopper architectures) with significant VRAM savings.
|
| 30 |
+
* **Algorithm:** One-Shot Post-Training Quantization (PTQ).
|
| 31 |
+
|
| 32 |
+
## REAP Optimization
|
| 33 |
+
**REAP (Router Expert Activation Pruning)** enhances MoE efficiency by pruning the activation of experts through a specialized routing mechanism. By combining this architecture with **FP8-Dynamic** quantization, the model achieves a balance between the high parameter count of MoE and the low latency required for production environments.
|
| 34 |
+
|
| 35 |
+
## Installation
|
| 36 |
+
To run this model, ensure you have the latest `transformers` and `torch` versions installed:
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
pip install torch torchvision transformers typing_extensions llmcompressor
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Usage Example
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 47 |
+
|
| 48 |
+
MODEL_ID = "Akicou/INTELLECT-3-REAP-50-FP8-Dynamic"
|
| 49 |
+
|
| 50 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 51 |
+
MODEL_ID,
|
| 52 |
+
device_map="auto",
|
| 53 |
+
torch_dtype="auto",
|
| 54 |
+
)
|
| 55 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 56 |
+
|
| 57 |
+
prompt = "Write a technical summary of how FP8 quantization improves LLM inference."
|
| 58 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 59 |
+
|
| 60 |
+
output = model.generate(**inputs, max_new_tokens=150)
|
| 61 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 62 |
+
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Quantization Details
|
| 66 |
+
|
| 67 |
+
The model was quantized using the following `llmcompressor` configuration:
|
| 68 |
+
|
| 69 |
+
* **Targets:** Linear layers.
|
| 70 |
+
* **Scheme:** FP8_DYNAMIC.
|
| 71 |
+
* **Ignored Layers:** `lm_head`.
|
| 72 |
+
* **Calibration:** Performed with `oneshot` algorithm.
|
| 73 |
+
|
| 74 |
+
## Limitations
|
| 75 |
+
|
| 76 |
+
* **Hardware:** Native FP8 support requires NVIDIA Blackwell, Hopper, or Ada Lovelace GPUs.
|
| 77 |
+
* **Precision:** While dynamic scaling minimizes loss, slight accuracy deviations may occur compared to the original BF16 weights in highly niche benchmarks.
|
| 78 |
+
|
| 79 |
+
## Licensing
|
| 80 |
+
|
| 81 |
+
This model inherits the license from the base model [0xSero/INTELLECT-3-REAP-50](https://huggingface.co/0xSero/INTELLECT-3-REAP-50). Please refer to the original repository for specific usage rights.
|