@@ -12,27 +12,95 @@ docker pull rocm/atom-dev:latest
1212All the operations in the next will be executed inside the container.
1313
1414## Launching server
15- ATOM supports running the model with different parallelism, e.g., tensor parallel, expert parallel, data parallel.
15+ ATOM supports running the model with different parallelism, e.g., tensor parallel, expert parallel, data parallel. The examples below use the current ATOM server entrypoint and keep the recommended runtime environment close to the command.
1616
17- ### Serving on 8xMI355 GPUs (TP8 + FP8 KV Cache)
17+ ### GLM-5.2 FP8 Server
1818
1919``` bash
2020#! /bin/bash
2121
22- python -m atom.entrypoints.openai_server --model zai-org/GLM-5-FP8 -tp 8 --kv_cache_dtype fp8 --port 5678 --server-port 7777
22+ model_path=zai-org/GLM-5-FP8
23+ export AITER_QUICK_REDUCE_QUANTIZATION=INT4
24+ export AITER_USE_FLYDSL_MOE_SORTING=1
25+ TP=8
26+
27+ rm -rf /root/.cache/atom/*
28+
29+ python -m atom.entrypoints.openai_server \
30+ --model " $model_path " \
31+ --server-port 7777 \
32+ --kv_cache_dtype fp8 \
33+ --no-enable_prefix_caching \
34+ -tp $TP 2>&1 | tee server.log &
2335```
2436
25- ### Offline Inference with DP Attention + Expert Parallel
37+ ### GLM-5.2 FP8 Server with online quant to MXFP8 MOE
2638
2739``` bash
2840#! /bin/bash
2941
30- python -m atom.examples.simple_inference --model zai-org/GLM-5-FP8 -tp 8 --enable-dp-attention --enable-expert-parallel
42+ model_path=/shared/data/amd_int/models/GLM-5.2-FP8
43+ export AITER_QUICK_REDUCE_QUANTIZATION=INT4
44+ export AITER_USE_FLYDSL_MOE_SORTING=1
45+ TP=4
46+
47+ rm -rf /root/.cache/atom/*
48+
49+ python -m atom.entrypoints.openai_server \
50+ --model " $model_path " \
51+ --server-port 8000 \
52+ --kv_cache_dtype fp8 \
53+ --no-enable_prefix_caching \
54+ --online_quant_config ' {"layer_quant_config":{"model.layers.*.mlp.experts":"mxfp8"}}' \
55+ -tp $TP 2>&1 | tee server.log &
56+ ```
57+
58+ ### GLM-5.2 MXFP4 Server
59+
60+ ``` bash
61+ #! /bin/bash
62+
63+ model_path=amd/GLM-5.2-MXFP4
64+ export AITER_QUICK_REDUCE_QUANTIZATION=INT4
65+ export AITER_USE_FLYDSL_MOE_SORTING=1
66+ TP=4
67+
68+ rm -rf /root/.cache/atom/*
69+
70+ python -m atom.entrypoints.openai_server \
71+ --model " $model_path " \
72+ --server-port 8000 \
73+ --kv_cache_dtype fp8 \
74+ --no-enable_prefix_caching \
75+ --online_quant_config ' {"global_quant_config": "ptpc_fp8", "exclude_layer": ["lm_head", "model.embed_tokens", "*.mlp.gate", "*expert*"]}' \
76+ -tp $TP 2>&1 | tee server.log &
77+ ```
78+
79+ ### GLM-5.2 MXFP4 MTP Server
80+
81+ ``` bash
82+ #! /bin/bash
83+
84+ model_path=amd/GLM-5.2-MXFP4
85+ export AITER_QUICK_REDUCE_QUANTIZATION=INT4
86+ export AITER_USE_FLYDSL_MOE_SORTING=1
87+ TP=4
88+
89+ rm -rf /root/.cache/atom/*
90+
91+ python -m atom.entrypoints.openai_server \
92+ --model " $model_path " \
93+ --server-port 8004 \
94+ --kv_cache_dtype fp8 \
95+ --no-enable_prefix_caching \
96+ --online_quant_config ' {"global_quant_config": "ptpc_fp8", "exclude_layer": ["lm_head", "model.embed_tokens", "*.mlp.gate", "*expert*"]}' \
97+ --num-speculative-tokens 3 \
98+ --method mtp \
99+ -tp $TP 2>&1 | tee server_mtp.log &
31100```
32101
33102Tips on server configuration:
34103- We suggest using fp8 kv cache for better memory efficiency in the serving mode.
35- - DP attention + EP MoE mode does not support fp8 kv cache when gqa=8, so ` --kv_cache_dtype fp8 ` should not be used with ` --enable-dp-attention --enable-expert-parallel ` .
36104- GLM-5 reuses the DeepSeek v3 implementation in ATOM (MLA attention, MoE routing), so all DeepSeek v3 optimizations apply automatically.
37105- No ` --trust-remote-code ` is needed since ATOM has built-in support for ` GlmMoeDsaForCausalLM ` .
38106
@@ -107,17 +175,9 @@ Here is the reference value when deploying on 8 ranks:
107175
108176[ GLM-5.2] ( https://huggingface.co/zai-org/GLM-5.2-FP8 ) builds on the same ` glm_moe_dsa ` architecture as GLM-5 and adds ** IndexShare** : the DSA indexer is computed only on ` "full" ` attention layers and reused by the following ` "shared" ` layers (the per-layer schedule is declared in ` indexer_types ` ). Shared layers carry no indexer weights of their own. ATOM detects this schedule and enables the indexer cache automatically — no extra flags required.
109177
110- ### Serving on 8xMI355 GPUs (TP8)
111-
112- ``` bash
113- #! /bin/bash
114-
115- python -m atom.entrypoints.openai_server --model zai-org/GLM-5.2-FP8 -tp 8 --kv_cache_dtype bf16 --gpu-memory-utilization 0.8 --server-port 7777
116- ```
117-
118178Tips on server configuration:
119- - Use ` --kv_cache_dtype bf16 ` for the DSA sparse-attention path on CDNA4 (gfx950) .
120- - ` --gpu-memory-utilization 0.8 ` leaves headroom for the per-layer DSA index cache; higher values may OOM during KV-cache allocation .
179+ - Use the FP8, MXFP4, or MXFP4 MTP server recipes above for GLM-5.2 .
180+ - Use ` --kv_cache_dtype fp8 ` with the optimized GLM-5.2 server recipes unless you are intentionally comparing against the older bf16 KV-cache baseline .
121181- No ` --trust-remote-code ` is needed — ATOM has built-in support for ` GlmMoeDsaForCausalLM ` .
122182
123183### Performance baseline
@@ -132,83 +192,3 @@ Reference numbers on 8×MI355X (TP8, FP8 weights, bf16 KV cache), using the benc
132192| 8192 | 1024 | 1 | 73 | 669 | 409 | 13.2 |
133193| 8192 | 1024 | 16 | 645 | 5818 | 418 | 23.3 |
134194| 8192 | 1024 | 64 | 1210 | 10853 | 483 | 51.3 |
135-
136- ## GLM-5.2 FP8 and MXFP4 Server Recipes
137-
138- Use the following docker image for these recipes:
139-
140- ``` bash
141- docker pull docker.io/rocm/atom-dev:nightly_202606301541
142- ```
143-
144- Inside the container, install ATOM from the ` zejun/opt_GLM5.2_0701 ` branch. AITER can remain unchanged.
145-
146- ``` bash
147- cd PATH_TO_ATOM
148- git checkout zejun/opt_GLM5.2_0701
149- pip install -e .
150- ```
151-
152- ### GLM-5.2 FP8 Server
153-
154- ``` bash
155- #! /bin/bash
156-
157- model_path=/shared/data/amd_int/models/GLM-5.2-FP8
158- export AITER_QUICK_REDUCE_QUANTIZATION=INT4
159- export AITER_USE_FLYDSL_MOE_SORTING=1
160- TP=4
161-
162- rm -rf /root/.cache/atom/*
163-
164- python -m atom.entrypoints.openai_server \
165- --model " $model_path " \
166- --server-port 8000 \
167- --kv_cache_dtype fp8 \
168- --no-enable_prefix_caching \
169- --online_quant_config ' {"layer_quant_config":{"model.layers.*.mlp.experts":"mxfp8"}}' \
170- -tp $TP 2>&1 | tee server.log &
171- ```
172-
173- ### GLM-5.2 MXFP4 Server
174-
175- ``` bash
176- #! /bin/bash
177-
178- model_path=/shared/data/amd_int/models/GLM-5.2-MXFP4
179- export AITER_QUICK_REDUCE_QUANTIZATION=INT4
180- export AITER_USE_FLYDSL_MOE_SORTING=1
181- TP=4
182-
183- rm -rf /root/.cache/atom/*
184-
185- python -m atom.entrypoints.openai_server \
186- --model " $model_path " \
187- --server-port 8000 \
188- --kv_cache_dtype fp8 \
189- --no-enable_prefix_caching \
190- --online_quant_config ' {"global_quant_config": "ptpc_fp8", "exclude_layer": ["lm_head", "model.embed_tokens", "*.mlp.gate", "*expert*"]}' \
191- -tp $TP 2>&1 | tee server.log &
192- ```
193-
194- ### GLM-5.2 MXFP4 MTP Server
195- ``` bash
196- #! /bin/bash
197-
198- model_path=/shared/data/amd_int/models/GLM-5.2-MXFP4
199- export AITER_QUICK_REDUCE_QUANTIZATION=INT4
200- export AITER_USE_FLYDSL_MOE_SORTING=1
201- TP=4
202-
203- rm -rf /root/.cache/atom/*
204-
205- python -m atom.entrypoints.openai_server \
206- --model " $model_path " \
207- --server-port 8004 \
208- --kv_cache_dtype fp8 \
209- --no-enable_prefix_caching \
210- --online_quant_config ' {"global_quant_config": "ptpc_fp8", "exclude_layer": ["lm_head", "model.embed_tokens", "*.mlp.gate", "*expert*"]}' \
211- --num-speculative-tokens 3 \
212- --method mtp \
213- -tp $TP 2>&1 | tee server_mtp.log &
214- ```
0 commit comments