caizhi1 commited on
Commit
97835e1
·
verified ·
1 Parent(s): d1fe4a8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +114 -3
README.md CHANGED
@@ -1,3 +1,114 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model:
6
+ - inclusionAI/Ring-mini-linear-2.0
7
+ pipeline_tag: text-generation
8
+ ---
9
+ # Quantized Ring-Linear-2.0
10
+
11
+ ## Introduction
12
+
13
+ To enable deployment of [Ring-Linear-2.0](https://github.com/inclusionAI/Ring-V2/blob/main/hybrid_linear/README.md
14
+ ) 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.
15
+
16
+
17
+
18
+ ## Model Downloads
19
+
20
+
21
+ | **Model** | **Maximum Supported Length** | **Download** |
22
+ |:----------------------:| :----------------: |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
23
+ | 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) |
24
+ | 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) |
25
+
26
+
27
+ ## Quickstart
28
+
29
+
30
+ ### 🚀 vLLM
31
+
32
+ #### Environment Preparation
33
+
34
+ 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:
35
+ ```shell
36
+ pip install torch==2.7.0 torchvision==0.22.0
37
+ ```
38
+
39
+ Then you should install our vLLM wheel package:
40
+ ```shell
41
+ 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
42
+ ```
43
+
44
+ #### Offline Inference
45
+
46
+ ```python
47
+ from transformers import AutoTokenizer
48
+ from vllm import LLM, SamplingParams
49
+
50
+ tokenizer = AutoTokenizer.from_pretrained("inclusionAI/Ring-mini-linear-2.0-GPTQ-int4")
51
+
52
+ sampling_params = SamplingParams(temperature=0.6, top_p=1.0, max_tokens=16384)
53
+
54
+
55
+ llm = LLM(model="inclusionAI/Ring-mini-linear-2.0-GPTQ-int4", dtype='auto', enable_prefix_caching=False, max_num_seqs=128)
56
+
57
+
58
+ prompt = "Give me a short introduction to large language models."
59
+ messages = [
60
+ {"role": "user", "content": prompt}
61
+ ]
62
+
63
+ text = tokenizer.apply_chat_template(
64
+ messages,
65
+ tokenize=False,
66
+ add_generation_prompt=True
67
+ )
68
+ outputs = llm.generate([text], sampling_params)
69
+ ```
70
+
71
+ #### Online Inference
72
+ ```shell
73
+ vllm serve inclusionAI/Ring-mini-linear-2.0-GPTQ-int4 \
74
+ --tensor-parallel-size 2 \
75
+ --pipeline-parallel-size 1 \
76
+ --gpu-memory-utilization 0.90 \
77
+ --max-num-seqs 512 \
78
+ --no-enable-prefix-caching
79
+ ```
80
+
81
+
82
+
83
+ ## Evaluation
84
+
85
+
86
+ 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.
87
+
88
+
89
+
90
+ ### Ring-mini-linear-2.0
91
+ | **Dataset** | **BF16** | **FP8** | **GPTQ-Int4** |
92
+ | :----------------: |:--------:|:-------:|:-------------:|
93
+ | AIME25 | 73.65 | 72.40 | 66.56 |
94
+ | AIME24 | 79.95 | 79.53 | 74.95 |
95
+ | LiveCodeBench| 59.53 | 58.42 | 56.29 |
96
+ | GPQA | 65.69 | 66.79 | 62.53 |
97
+
98
+ ### Ring-flash-linear-2.0
99
+ | **Dataset** | **BF16** | **FP8** | **GPTQ-Int4** |
100
+ | :----------------: |:--------:|:-------:| :-----------------------:|
101
+ | AIME25 | 85.10 | 84.22 | 82.88 |
102
+ | LiveCodeBench| 69.82 | 69.44 | 66.14 |
103
+ | GPQA | 72.85 | 72.95 | 71.72 |
104
+
105
+
106
+
107
+
108
+ ## License
109
+
110
+ This code repository is licensed under [the MIT License](https://github.com/inclusionAI/Ring-V2/blob/master/LICENSE).
111
+
112
+ ## Citation
113
+
114
+ If you find our work helpful, feel free to give us a cite.