VLM: wire performance instrumentation and logits output#72
Merged
Conversation
- Report prompt throughput (prefill t/s) and generation throughput for VLM inference, matching the LLM path performance summary - Wire --print-logits for VLM: shows top-5 token probabilities per step - Wire --save-logits for VLM: saves top-K logits to JSON file - Make TokenLogits and TopLogitEntry properties public (needed by runner) Tested with LLaVA-1.5-7B bundle: prompt 590 tokens at 579 t/s, generation 20 tokens at 19.4 t/s. Logits JSON output verified.
60c0a79 to
dbde899
Compare
a084bb9 to
5c68d49
Compare
carinapeng
reviewed
Jul 1, 2026
carinapeng
reviewed
Jul 1, 2026
Contributor
|
Thank you for taking this on @stikves ! We seem to have implemented the runner-level design ( in runVLMInference, call setPromptTokenCount(vlmTokens.count) and wrap the prefill + generation) #70 I proposed engine level here as well, seems to me it could be a more sustainable design because if we instrument I wonder if that'd be a better design to be more generic? |
tjia1818
approved these changes
Jul 1, 2026
20cfdc5 to
4e11890
Compare
- Report prompt throughput (prefill t/s) and generation throughput for VLM inference, matching the LLM path performance summary - Wire --print-logits for VLM: shows top-5 token probabilities per step - Wire --save-logits for VLM: saves top-K logits to JSON via LogitsWriter - Make TokenLogits and TopLogitEntry properties public (cross-module access) Tested with VLM bundle: prompt 590 tokens at 579 t/s, generation 20 tokens at 19.4 t/s. Logits JSON output verified.
9d33bfa to
91fecb2
Compare
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.
Wire performance metrics and logits output for the VLM inference path, matching the LLM path behavior.
Changes
--print-logitsfor VLM: shows top-5 token probabilities per generated step--save-logitsfor VLM: saves top-K logits to JSON (same format as LLM path)TokenLogitsandTopLogitEntryproperties public (cross-module access)Sample output
With
--print-logits:With
--save-logits /tmp/vlm_logits.json:{ "tokens": [{ "token_id": 450, "incremental_text": "The", "top_logits": [ {"token_id": 450, "incremental_text": "The", "logit": 26.8125}, {"token_id": 910, "incremental_text": "This", "logit": 25.406} ] }] }Test plan
--print-logitsdisplays top-5 logits per token during VLM generation--save-logitsproduces valid JSON with top-K entries--verbose) shows full timing breakdown table