Set server context to 1Mi with a 16Ki draft window
Browse filesApply the server changes from ripple-inference PR #18 (08fd9f4383). Default target context to 1048576, retain draft window 16384, and enable the stock SGLang positional-limit override required for the draft. Update the server README.
https://github.com/ricursive/ripple-inference/pull/18
- inference/server/README.md +6 -2
- inference/server/serve.py +6 -1
inference/server/README.md
CHANGED
|
@@ -28,10 +28,14 @@ curl http://127.0.0.1:30000/v1/chat/completions \
|
|
| 28 |
```
|
| 29 |
|
| 30 |
Defaults: TP=2, BF16 weights and KV cache, TRT-LLM target attention, Triton draft
|
| 31 |
-
attention, 16 draft tokens, and
|
|
|
|
| 32 |
The DFlash2 draft's last layer is global attention without RoPE. It was trained on
|
| 33 |
-
|
| 34 |
smaller windows are refused.
|
|
|
|
|
|
|
|
|
|
| 35 |
For four GPUs, run a second copy with `CUDA_VISIBLE_DEVICES=2,3` and `--port 30001`.
|
| 36 |
This gives two independent replicas, each using two GPUs. Send eight concurrent
|
| 37 |
requests to each port for sixteen total.
|
|
|
|
| 28 |
```
|
| 29 |
|
| 30 |
Defaults: TP=2, BF16 weights and KV cache, TRT-LLM target attention, Triton draft
|
| 31 |
+
attention, 16 draft tokens, and a **1Mi-token target context** (`--context-length 1048576`,
|
| 32 |
+
including prompt and generated tokens). Standard SGLang CLI flags apply.
|
| 33 |
The DFlash2 draft's last layer is global attention without RoPE. It was trained on
|
| 34 |
+
16Ki-token rows, so the draft keeps a **16Ki-token window** (`--speculative-draft-window-size 16384`);
|
| 35 |
smaller windows are refused.
|
| 36 |
+
The launcher defaults `SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1` so stock SGLang can
|
| 37 |
+
extend the draft's positional cache beyond its 128Ki checkpoint limit. This does not
|
| 38 |
+
increase the draft attention window. The target checkpoint supports up to 2Mi positions.
|
| 39 |
For four GPUs, run a second copy with `CUDA_VISIBLE_DEVICES=2,3` and `--port 30001`.
|
| 40 |
This gives two independent replicas, each using two GPUs. Send eight concurrent
|
| 41 |
requests to each port for sixteen total.
|
inference/server/serve.py
CHANGED
|
@@ -19,6 +19,11 @@ from pathlib import Path
|
|
| 19 |
|
| 20 |
sys.dont_write_bytecode = True
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Top-level registration also runs in SGLang's spawned worker processes.
|
| 23 |
from sglang.srt.models.registry import ModelRegistry
|
| 24 |
|
|
@@ -35,7 +40,7 @@ DEFAULT_ARGS = shlex.split("""
|
|
| 35 |
--speculative-algorithm DFLASH --speculative-draft-model-quantization unquant
|
| 36 |
--speculative-num-draft-tokens 16 --speculative-draft-window-size 16384
|
| 37 |
--speculative-draft-attention-backend triton
|
| 38 |
-
--context-length
|
| 39 |
--cuda-graph-backend-prefill disabled
|
| 40 |
--tool-call-parser ripple --reasoning-parser ripple
|
| 41 |
""")
|
|
|
|
| 19 |
|
| 20 |
sys.dont_write_bytecode = True
|
| 21 |
|
| 22 |
+
# SGLang sizes the draft's positional cache for the target context, even with
|
| 23 |
+
# windowed draft attention. Allow its 128Ki position limit to grow to 1Mi;
|
| 24 |
+
# --speculative-draft-window-size still limits draft attention to 16Ki tokens.
|
| 25 |
+
os.environ.setdefault("SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN", "1")
|
| 26 |
+
|
| 27 |
# Top-level registration also runs in SGLang's spawned worker processes.
|
| 28 |
from sglang.srt.models.registry import ModelRegistry
|
| 29 |
|
|
|
|
| 40 |
--speculative-algorithm DFLASH --speculative-draft-model-quantization unquant
|
| 41 |
--speculative-num-draft-tokens 16 --speculative-draft-window-size 16384
|
| 42 |
--speculative-draft-attention-backend triton
|
| 43 |
+
--context-length 1048576 --mem-fraction-static 0.80 --max-running-requests 16
|
| 44 |
--cuda-graph-backend-prefill disabled
|
| 45 |
--tool-call-parser ripple --reasoning-parser ripple
|
| 46 |
""")
|