Repository navigation
Nemotron CUDA prompt reuse - #467
AdrianBinDC wants to merge 1 commit into
Conversation
f5dbbb3 to
62e200b
Compare
|
I tried this PR on today's base and served it on a DGX Spark. The receipt above couldn't cover that: it was run on Port to
Built with Setup.
Workload. Each conversation has a ~7.1K-token system prompt (the repo's
Result: 18/18 turns have the same
The first uncached turns were 11–12 % slower with the cache on in this run. I haven't alternated the runs, so I can't say whether that comes from the cache or from run-to-run variation. The server received 19 requests and logged 18 as done. The cancelled one has no Cache log at the end: Two things to look at:
Not run: Metal, sampled requests, and |
|
@SvangenStudios thanks for the port and the 18/18 run. Could you push it to a branch? I'd like to add a receipt from a second Spark (GB10, kernel 6.17) on the same base. |
|
@plotarmordev Here it is: I built and served it as before: |
|
Receipt for the port (
The uncached first turns were again a little slower with the cache on in the alone phase (1.10 s vs 0.99–1.00 s); in the concurrent phase the order varied between arms, so I wouldn't read anything into those. |
|
Thank you, @AdrianBinDC, and thanks to @SvangenStudios for the port to 1.0.2 and @plotarmordev for the second Our change is the one we mentioned. chunkEnd ended a prompt chunk at any keep mark, so the same prompt could be cut On a GB10, with a workload shaped like @SvangenStudios's (a 7,200-token system prompt, three turns, a stream |
What this changes
Nemotron on CUDA, from
tensorfold run, keeps a prompt snapshot so a later turn restores the shared prefix and reads only the new tokens. Drafts stay on. The bytes copied are the engine caches and the MTP head. No activation or sum changes type. The Metal server path is unchanged, and CUDA Nemotron is still not served.Receipt
zig-flashnextatdb28187, this commit on top. Zig 0.17.0. No MLX. PyTorch 2.13.0a0 was used only to capture the Triton cubins. DGX Spark, NVIDIA GB10. Checkpoint NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit at8bbcb5b6, withmtp-4bit.safetensors. Greedy, context 1024.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: those tools talk to the server, and this engine is not served. On this GPU, a resumed prefill reportedcached 64. Plain (--no-drafts), drafted, and reused matched on these tokens: 1267, 1784, 16194, 1880. A separate 1000-token--no-draftsprompt hashed95bce61a71a7on the base and on this branch. Concurrent versus solo was not run.tools/bench_openai.py: not run. That tool talks to the server, and this engine is not served yet.tools/prefill_cold.py: that tool talks to the server, so this istensorfold runon the same GPU, against the parent commit, not against the 0.6.6 release. 1000 tokens,--max-tokens 1 --no-drafts --eager --context 1024, order before, after, after, before. Prefill 0.1217 s, 0.1212 s, 0.1228 s, 0.1218 s. About 0.122 s both ways.zig build teston this branch, host only, no GPU: 60 passed, 0 failed, 0 skipped. That includes a host test that a prompt chunk ends on a keep. The GPU token comparison above is not a test in the tree.bench_concurrent.py,bench_openai.py, andprefill_cold.py, because CUDA Nemotron is not wired into the server.pytest, because issue Landing next #286 freezes the Python engine.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.