Document and package DCP partial-batch runtime fix
Browse files- Dockerfile.runtime +5 -0
- README.md +9 -2
- docker-compose.yml +1 -1
- patch_dcp_workspace_stride.py +22 -0
- start.sh +1 -1
Dockerfile.runtime
CHANGED
|
@@ -7,3 +7,8 @@ COPY runtime/glm52_vision \
|
|
| 7 |
/opt/venv/lib/python3.12/site-packages/glm52_vision
|
| 8 |
COPY runtime/glm52_vision_vllm-0.1.0.dist-info \
|
| 9 |
/opt/venv/lib/python3.12/site-packages/glm52_vision_vllm-0.1.0.dist-info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
/opt/venv/lib/python3.12/site-packages/glm52_vision
|
| 8 |
COPY runtime/glm52_vision_vllm-0.1.0.dist-info \
|
| 9 |
/opt/venv/lib/python3.12/site-packages/glm52_vision_vllm-0.1.0.dist-info
|
| 10 |
+
|
| 11 |
+
# Preserve the fast DCP project-before-merge path for partial prefill batches.
|
| 12 |
+
COPY patch_dcp_workspace_stride.py /tmp/patch_dcp_workspace_stride.py
|
| 13 |
+
RUN python3 /tmp/patch_dcp_workspace_stride.py \
|
| 14 |
+
&& rm /tmp/patch_dcp_workspace_stride.py
|
README.md
CHANGED
|
@@ -62,15 +62,16 @@ as multimodal.
|
|
| 62 |
| Recipe ID | `glm-5.2-exl3` |
|
| 63 |
| Served model | `GLM-5.2-EXL3` |
|
| 64 |
| Checkpoint | `GLM-5.2-EXL3-TR3-3.0bpw` |
|
| 65 |
-
| Runtime image | `local/glm52-exl3-vision:
|
| 66 |
| Parallelism | TP4, DCP4, `ag_rs` |
|
| 67 |
| Context | 400,000 tokens |
|
| 68 |
-
| KV cache | FP8 MLA,
|
| 69 |
| Scheduler | async, 2,048 max batched tokens, 8 max sequences |
|
| 70 |
| Speculation | MTP-3, greedy, EXL3 TR3 3.0 bpw layer 78 |
|
| 71 |
| Collectives | NCCL; B12X PCIe all-reduce and DCP A2A disabled |
|
| 72 |
| Graph mode | `FULL_AND_PIECEWISE` CUDA graphs |
|
| 73 |
| API features | `glm45` reasoning, `glm47` tools |
|
|
|
|
| 74 |
|
| 75 |
### `EXL3-VISION` — multimodal profile
|
| 76 |
|
|
@@ -94,6 +95,12 @@ as multimodal.
|
|
| 94 |
Both profiles used the publisher-tested physical rank order `3,1,2,0`.
|
| 95 |
Every GPU remained capped at 300 W.
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
## Measured speed: text-only
|
| 98 |
|
| 99 |
Hardware: 4 x RTX PRO 6000 96 GB, power limit 300 W/GPU. The canonical decode
|
|
|
|
| 62 |
| Recipe ID | `glm-5.2-exl3` |
|
| 63 |
| Served model | `GLM-5.2-EXL3` |
|
| 64 |
| Checkpoint | `GLM-5.2-EXL3-TR3-3.0bpw` |
|
| 65 |
+
| Runtime image | `local/glm52-exl3-vision:v22-dcpstride` |
|
| 66 |
| Parallelism | TP4, DCP4, `ag_rs` |
|
| 67 |
| Context | 400,000 tokens |
|
| 68 |
+
| KV cache | FP8 MLA, 878,822 tokens, 2.20x concurrency at 400K |
|
| 69 |
| Scheduler | async, 2,048 max batched tokens, 8 max sequences |
|
| 70 |
| Speculation | MTP-3, greedy, EXL3 TR3 3.0 bpw layer 78 |
|
| 71 |
| Collectives | NCCL; B12X PCIe all-reduce and DCP A2A disabled |
|
| 72 |
| Graph mode | `FULL_AND_PIECEWISE` CUDA graphs |
|
| 73 |
| API features | `glm45` reasoning, `glm47` tools |
|
| 74 |
+
| Runtime fix | pitched DCP workspace validation for partial prefill batches |
|
| 75 |
|
| 76 |
### `EXL3-VISION` — multimodal profile
|
| 77 |
|
|
|
|
| 95 |
Both profiles used the publisher-tested physical rank order `3,1,2,0`.
|
| 96 |
Every GPU remained capped at 300 W.
|
| 97 |
|
| 98 |
+
The text runtime adds a one-line layout validation fix for partial DCP prefill
|
| 99 |
+
batches. The projection input was already compacted before `torch.bmm`; the
|
| 100 |
+
validator now accepts the actual pitched stride of the 2,048-token workspace.
|
| 101 |
+
This keeps DCP4, project-before-merge, and CUDA graphs enabled under concurrent
|
| 102 |
+
mixed-length requests.
|
| 103 |
+
|
| 104 |
## Measured speed: text-only
|
| 105 |
|
| 106 |
Hardware: 4 x RTX PRO 6000 96 GB, power limit 300 W/GPU. The canonical decode
|
docker-compose.yml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
# the merged Glm5v checkpoint and the packaged MoonViT/PatchMerger vLLM plugin.
|
| 4 |
services:
|
| 5 |
glm52:
|
| 6 |
-
image: ${IMAGE:-local/glm52-exl3-vision:
|
| 7 |
container_name: ${CONTAINER_NAME:-glm52-tr3-vision}
|
| 8 |
ports:
|
| 9 |
- "${BIND_ADDRESS:-127.0.0.1}:${PORT:-8000}:8000"
|
|
|
|
| 3 |
# the merged Glm5v checkpoint and the packaged MoonViT/PatchMerger vLLM plugin.
|
| 4 |
services:
|
| 5 |
glm52:
|
| 6 |
+
image: ${IMAGE:-local/glm52-exl3-vision:v22-dcpstride}
|
| 7 |
container_name: ${CONTAINER_NAME:-glm52-tr3-vision}
|
| 8 |
ports:
|
| 9 |
- "${BIND_ADDRESS:-127.0.0.1}:${PORT:-8000}:8000"
|
patch_dcp_workspace_stride.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
|
| 3 |
+
path = Path(
|
| 4 |
+
"/opt/venv/lib/python3.12/site-packages/vllm/v1/attention/"
|
| 5 |
+
"backends/mla/b12x_mla_sparse.py"
|
| 6 |
+
)
|
| 7 |
+
source = path.read_text()
|
| 8 |
+
old = """ expected_attn_stride = (
|
| 9 |
+
self.kv_lora_rank,
|
| 10 |
+
(self._max_batched if self._pad_heads else num_tokens) * self.kv_lora_rank,
|
| 11 |
+
1,
|
| 12 |
+
)
|
| 13 |
+
"""
|
| 14 |
+
new = """ expected_attn_stride = (
|
| 15 |
+
self.kv_lora_rank,
|
| 16 |
+
self._max_batched * self.kv_lora_rank,
|
| 17 |
+
1,
|
| 18 |
+
)
|
| 19 |
+
"""
|
| 20 |
+
if old not in source:
|
| 21 |
+
raise SystemExit("expected DCP workspace stride source was not found")
|
| 22 |
+
path.write_text(source.replace(old, new, 1))
|
start.sh
CHANGED
|
@@ -5,7 +5,7 @@ set -Eeuo pipefail
|
|
| 5 |
readonly MODEL_REPO="${MODEL_REPO:-0xSero/GLM-5.2-TR3-Vision}"
|
| 6 |
readonly MODEL_DIR="${MODEL_DIR:-$PWD/GLM-5.2-TR3-Vision}"
|
| 7 |
readonly CACHE_DIR="${CACHE_DIR:-$MODEL_DIR/.runtime-cache}"
|
| 8 |
-
readonly IMAGE="${IMAGE:-local/glm52-exl3-vision:
|
| 9 |
|
| 10 |
command -v docker >/dev/null
|
| 11 |
docker compose version >/dev/null
|
|
|
|
| 5 |
readonly MODEL_REPO="${MODEL_REPO:-0xSero/GLM-5.2-TR3-Vision}"
|
| 6 |
readonly MODEL_DIR="${MODEL_DIR:-$PWD/GLM-5.2-TR3-Vision}"
|
| 7 |
readonly CACHE_DIR="${CACHE_DIR:-$MODEL_DIR/.runtime-cache}"
|
| 8 |
+
readonly IMAGE="${IMAGE:-local/glm52-exl3-vision:v22-dcpstride}"
|
| 9 |
|
| 10 |
command -v docker >/dev/null
|
| 11 |
docker compose version >/dev/null
|