[Bug] GLM-5.2 with MTP+Hicache+Mooncake occasionally produces garbled output on latest SGLang
### Checklist
- [x] I searched related issues but found no solution.
- [x] The bug persists in the latest version.
- [x] Issues without environment info and a minimal reproducible demo are hard to resolve and may receive no feedback.
- [x] If this is not a bug report but a general question, please start a discussion at https://github.com/sgl-project/sglang/discussions. Otherwise, it will be closed.
- [ ] Please use English. Otherwise, it will be closed.
### Describe the bug
## Bug: GLM-5.2 produces garbled / corrupted text in long-tail generation cases
### Summary
When serving GLM-5.2 with SGLang, I occasionally encounter garbled output during generation, especially in long-tail cases. The model starts normally, but after a certain point the generated text may contain corrupted characters, repeated abnormal tokens, or unreadable mixed text.
I am not sure whether this is caused by tokenizer handling, chat template formatting, sampling settings, model compatibility, or a known issue in the current SGLang runtime. I would like to ask whether the community has seen similar behavior and whether there is a recommended workaround.
### Environment
- SGLang version: `latest / main branch`
- GPU: `B300`
- Model: GLM-5.2
### Reproduction
The issue is intermittent and appears more often on long-tail prompts or longer generations.
<img width="786" height="494" alt="Image" src="https://github.com/user-attachments/assets/43981185-105d-4d97-bc68-07ce99e707d7" />
<img width="1631" height="513" alt="Image" src="https://github.com/user-attachments/assets/48abdfb8-1911-448c-ab5b-2f124dcd4543" />
### Reproduction
The issue is intermittent, but it is easier to reproduce with long-tail prompts or long generations when serving GLM-5.2-FP8 on the latest SGLang with MTP/EAGLE speculative decoding and Mooncake hierarchical cache enabled.
My deployment setup:
- 4 machines
- 8 GPUs per machine
- 2 SGLang servers per machine:
- `CUDA_VISIBLE_DEVICES=0,1,2,3`, port `30000`
- `CUDA_VISIBLE_DEVICES=4,5,6,7`, port `30001`
- Each SGLang server uses `tp-size=4`
- Model path: `/modules/GLM-5.2-FP8`
- Speculative decoding / MTP enabled:
- `--speculative-algorithm EAGLE`
- `--speculative-num-steps 5`
- `--speculative-eagle-topk 1`
- `--speculative-num-draft-tokens 6`
- Mooncake hierarchical cache enabled:
- `--enable-hierarchical-cache`
- `--hicache-storage-backend mooncake`
- `--hicache-write-policy write_through`
- `--hicache-storage-prefetch-policy timeout`
- `--hicache-mem-layout page_first_direct`
- KV cache dtype: `fp8_e4m3`
Example launch command for one SGLang instance:
```bash
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 -m sglang.launch_server \
--model-path /modules/GLM-5.2-FP8 \
--host 0.0.0.0 \
--port 30000 \
--trust-remote-code \
--dist-init-addr 127.0.0.1:5501 \
--nnodes 1 \
--tp-size 4 \
--speculative-algorithm EAGLE \
--speculative-num-steps 5 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 6 \
--served-model-name glm5.2-jz \
--tool-call-parser glm47 \
--reasoning-parser glm45 \
--mem-fraction-static 0.90 \
--kv-cache-dtype fp8_e4m3 \
--chunked-prefill-size 32768 \
--max-prefill-tokens 32768 \
--cuda-graph-max-bs 16 \
--max-running-requests 100 \
--enable-request-time-stats-logging \
--enable-metrics \
--enable-cache-report \
--schedule-conservativeness 0.1 \
--stream-interval 1 \
--stream-response-default-include-usage \
--model-loader-extra-config '{"enable_multithread_load": true}' \
--enable-hierarchical-cache \
--hicache-ratio 2 \
--hicache-write-policy write_through \
--hicache-storage-prefetch-policy timeout \
--hicache-mem-layout page_first_direct \
--hicache-storage-backend mooncake \
--hicache-storage-backend-extra-config '{"standalone_storage": false, "master_server_address": "10.218.104.1:53011", "metadata_server": "http://10.218.104.1:8011/metadata", "local_hostname": "10.218.104.1", "global_segment_size": "0", "protocol": "rdma", "device_name": "mlx5_0,mlx5_4,mlx5_6,mlx5_14", "check_server": true, "master_metrics_port": 9011}'
Mooncake master/client are also enabled with RDMA and offload:
mooncake_master \
--rpc_port=53011 \
--enable_http_metadata_server=true \
--http_metadata_server_port=8011 \
--metrics_port=9011 \
--eviction_high_watermark_ratio=0.95 \
--allocation_strategy=free_ratio_first \
--enable_offload=true
mooncake_client \
--host=<machine_ip> \
--port=52011 \
--global_segment_size=250GB \
--master_server_address=10.218.104.1:53011 \
--metadata_server=http://10.218.104.1:8011/metadata \
--protocol=rdma \
--device_names=<mlx5 devices> \
--enable_offload=true
After the servers are up, I send long-tail prompts or long-generation requests through the OpenAI-compatible API. The response often starts normally, but in some requests the later part becomes garbled/corrupted, with unreadable characters, abnormal repeated tokens, or semantically broken text.
The issue is not 100% reproducible, but it appears more frequently with long-tail prompts or longer generations under this MTP + Mooncake configuration.
```
### Environment
- SGLang version: latest / main branch
- Model: GLM-5.2-FP8
- Model path: `/modules/GLM-5.2-FP8`
- Serving API: OpenAI-compatible API
关闭于 28 天前 22 条评论