caizhi1 commited on
Commit
fec4864
·
verified ·
1 Parent(s): 4f9d498

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +120 -3
README.md CHANGED
@@ -1,3 +1,120 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model:
6
+ - inclusionAI/Ring-flash-linear-2.0
7
+ pipeline_tag: text-generation
8
+ ---
9
+
10
+
11
+
12
+ # Quantized Ring-Linear-2.0
13
+
14
+ ## Introduction
15
+
16
+ To enable deployment of [Ring-Linear-2.0](https://github.com/inclusionAI/Ring-V2/blob/main/hybrid_linear/README.md
17
+ ) on memory-constrained devices, we release quantized weights using the GPTQ INT4 format. Additionally, we evaluate the online FP8 quantization performance of `Ring-Linear-2.0` models, which closely approaches that of BF16 precision.
18
+
19
+
20
+
21
+ ## Model Downloads
22
+
23
+
24
+ | **Model** | **Maximum Supported Length** | **Download** |
25
+ |:----------------------:| :----------------: |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
26
+ | Ring-flash-linear-2.0-GPTQ-int4 | 128k | [🤗 HuggingFace](https://huggingface.co/inclusionAI/Ring-flash-linear-2.0-GPTQ-int4) <br>[🤖 ModelScope](https://www.modelscope.cn/models/inclusionAI/Ring-flash-linear-2.0-GPTQ-int4) |
27
+ | Ring-mini-linear-2.0-GPTQ-int4 | 512k | [🤗 HuggingFace](https://huggingface.co/inclusionAI/Ring-mini-linear-2.0-GPTQ-int4) <br>[🤖 ModelScope](https://www.modelscope.cn/models/inclusionAI/Ring-mini-linear-2.0-GPTQ-int4) |
28
+
29
+
30
+ ## Quickstart
31
+
32
+
33
+ ### 🚀 vLLM
34
+
35
+ #### Environment Preparation
36
+
37
+ Since the Pull Request (PR) has not been submitted to the vLLM community at this stage, please prepare the environment by following the steps below:
38
+ ```shell
39
+ pip install torch==2.7.0 torchvision==0.22.0
40
+ ```
41
+
42
+ Then you should install our vLLM wheel package:
43
+ ```shell
44
+ pip install https://media.githubusercontent.com/media/inclusionAI/Ring-V2/refs/heads/main/hybrid_linear/whls/vllm-0.8.5%2Bcuda12_8_gcc10_2_1-cp310-cp310-linux_x86_64.whl --no-deps --force-reinstall
45
+ ```
46
+
47
+ #### Offline Inference
48
+
49
+ ```python
50
+ from transformers import AutoTokenizer
51
+ from vllm import LLM, SamplingParams
52
+
53
+ tokenizer = AutoTokenizer.from_pretrained("inclusionAI/Ring-mini-linear-2.0-GPTQ-int4")
54
+
55
+ sampling_params = SamplingParams(temperature=0.6, top_p=1.0, max_tokens=16384)
56
+
57
+
58
+ llm = LLM(model="inclusionAI/Ring-mini-linear-2.0-GPTQ-int4", dtype='auto', enable_prefix_caching=False, max_num_seqs=128)
59
+
60
+
61
+ prompt = "Give me a short introduction to large language models."
62
+ messages = [
63
+ {"role": "user", "content": prompt}
64
+ ]
65
+
66
+ text = tokenizer.apply_chat_template(
67
+ messages,
68
+ tokenize=False,
69
+ add_generation_prompt=True
70
+ )
71
+ outputs = llm.generate([text], sampling_params)
72
+ ```
73
+
74
+ #### Online Inference
75
+ ```shell
76
+ vllm serve inclusionAI/Ring-mini-linear-2.0-GPTQ-int4 \
77
+ --tensor-parallel-size 2 \
78
+ --pipeline-parallel-size 1 \
79
+ --gpu-memory-utilization 0.90 \
80
+ --max-num-seqs 512 \
81
+ --no-enable-prefix-caching
82
+ ```
83
+
84
+
85
+
86
+ ## Evaluation
87
+
88
+
89
+ We evaluate the INT4 and FP8 quantized models using several datasets. The FP8 quantization is applied via the quantization="fp8" argument in SGLang or vLLM.
90
+
91
+
92
+
93
+ ### Ring-mini-linear-2.0
94
+ | **Dataset** | **BF16** | **FP8** | **GPTQ-Int4** |
95
+ | :----------------: |:--------:|:-------:|:-------------:|
96
+ | AIME25 | 73.65 | 72.40 | 66.56 |
97
+ | AIME24 | 79.95 | 79.53 | 74.95 |
98
+ | LiveCodeBench| 59.53 | 58.42 | 56.29 |
99
+ | GPQA | 65.69 | 66.79 | 62.53 |
100
+
101
+ ### Ring-flash-linear-2.0
102
+ | **Dataset** | **BF16** | **FP8** | **GPTQ-Int4** |
103
+ | :----------------: |:--------:|:-------:| :-----------------------:|
104
+ | AIME25 | 85.10 | 84.22 | 82.88 |
105
+ | LiveCodeBench| 69.82 | 69.44 | 66.14 |
106
+ | GPQA | 72.85 | 72.95 | 71.72 |
107
+
108
+
109
+
110
+
111
+ ## License
112
+
113
+ This code repository is licensed under [the MIT License](https://github.com/inclusionAI/Ring-V2/blob/master/LICENSE).
114
+
115
+ ## Citation
116
+
117
+ If you find our work helpful, feel free to give us a cite.
118
+
119
+
120
+