Repository navigation
Conversation
Comparing a text's teacher-forced NLL with vLLM's needs vLLM's completions prompt_logprobs, which the CUDA server did not take. - prompt_logprobs: k (0..20, nonstreamed completions, engines that declare supports_prompt_logprobs) returns vLLM's shape: None, then per position the prompt token (vocabulary rank) and the top k (positional ranks). - GLM prefill, only when asked: after each chunk's forward and before the MTP absorb (which writes fnormed), the head runs on the chunk's rows in groups bounded as logprobs.capture bounds its temporaries; the prefill matmuls give a row the same bits in any group, so the rows do not depend on the chunking. Ranks combine by two gathers per group: lse, top k, and the logit at column target % shard (read from slot target // shard), then the counts at or above it. Such a request never resumes a kept prefix; rank 1 learns it from one more header field. - The no-request path only gains an is-None check: the tiny checkpoints' tokens and cache hashes (MLX 4-bit, dense and long) are unchanged.
…6.3's words v0.6.3 reads token-id prompts with server.token_routes.token_ids, which names booleans and floats as not integer ids instead of giving the range.
8 tasks done
Owner
|
Thank you, @Bizuayeu. Scoring a prompt the way vLLM does, the prompt token ranked in the whole vocabulary beside the top k, is what perplexity runs need. The Python engine is frozen (#286), so this PR won't merge. The Zig API reserves the |
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses part of #298: scoring a given text without generating, on GLM-5.3-Flash on two ranks. It does not add
logprobsfor generated tokens, theecho: trueform, orprompt_logprobson chat completions.What changes
prompt_logprobs: k(0 to 20) on nonstreamed/v1/completions, for engines that declaresupports_prompt_logprobs. The reply follows vLLM's shape:null, then for each later position the prompt token(ranked in the whole vocabulary) and the top k (ranked by position). Streaming and chat completions answer 400.
fnormed), the headruns on the chunk's rows in groups bounded as
logprobs.capturebounds its temporaries. The prefill matmuls give arow the same bits in any group, so the rows do not depend on the chunking.
target % shard(readfrom slot
target // shard), then the counts at or above it. This is the cross-rank denominator GLM-5.3 on CUDA (two Sparks):logprobsandprompt_logprobs, so quantization variants can be compared by perplexity #298 asks for.prompt_logprobsonly gains an is-None check. The tiny checkpoints' tokens and cache hashes (MLX4-bit, dense and long) are unchanged.
Tests
tests/test_cuda_prompt_logprobs_fields.py(host): token-id prompts reach the engine as sent; the vLLM shape;malformed requests are refused before generation; engines without prompt rows refuse them.
tests/cuda/test_glm_prompt_logprobs.py(tiny MLX 4-bit checkpoint): rows match a plain fp32 head; they do notdepend on the chunking; a repeat gives the same rows; the reply and caches are those without the request; a kept
prefix is never resumed; the reply's entries hold each position's own token, so the teacher-forced NLL reads off
them; a one-token prompt has no rows.
Receipt
GPU clock capped at 2,200 MHz), TP=2 over one RoCE link;
--context 0, MTP drafts only;TensorFold/GLM-5.3-Flash-MLX-4bit-MTP@d2b17f52.tools/bench_concurrent.py … --alone --serial: 48 of 48 and 10 of 10. One request twice, the secondwith
"draft": false:token_shaequal for 5 of 5 prompts (14 to 32,762 tokens). A request withoutprompt_logprobs, main / this: the sametoken_shafor 5 of 5.1,043 / 1,043, 1,033 / 1,034 tok/s at 2k / 8k / 16k / 32k / 64k tokens.
prompt_logprobs0 and 5: 2,036 positions, the first entrynull; with 5,each entry holds 5 keys, or 6 when the prompt token is outside the top 5, and the prompt token's logprob equals
the one
prompt_logprobs0 returns; mean NLL 0.237. The reply (token_sha2014c7cc1bc6) is the same with thefield at 0, 5 or absent. A one-token prompt returns one position. Streaming and chat requests with the field get
400 (
prompt_logprobs support nonstreamed completions); main accepts the field with 200 and returns noprompt_logprobs.tests/test_cuda_*.py tests/test_glm*.pyand the GLM files oftests/cuda: 1,530passed, 14 skipped (main: 1,506 passed, 14 skipped); the 24 new tests pass.
echoform).Written with Weave (My Symbiotic AI)