Skip to content

perplexity: respect explicit -np instead of silently overriding it - #353

Merged
TheTom merged 1 commit into
TheTom:feature/turboquant-kv-cachefrom
giveen:fix/perplexity-explicit-np
Sep 6, 2026
Merged

perplexity: respect explicit -np instead of silently overriding it#353
TheTom merged 1 commit into
TheTom:feature/turboquant-kv-cachefrom
giveen:fix/perplexity-explicit-np

Conversation

@giveen

@giveen giveen commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Split out of #326 per review comment: #326 (comment)

The plain-PPL/KLD path in tools/perplexity/perplexity.cpp computed n_parallel = max(1, n_batch / n_ctx) unconditionally, discarding whatever -np/--parallel was passed on the command line — including an explicit -np 1 needed to satisfy --kv-stream's single-sequence gate.

  • Added n_parallel_explicit tracking (same pattern as the existing moe_cache.mode_explicit field) so an explicit -np now sticks.
  • The auto-batching heuristic still applies unchanged when -np isn't passed.

Test plan

  • Builds clean (llama-perplexity target)
  • No behavior change when -np is omitted (heuristic path untouched)

🤖 Generated with Claude Code

tools/perplexity/perplexity.cpp's plain-PPL/KLD path computed
n_parallel = max(1, n_batch / n_ctx) unconditionally, discarding
whatever -np/--parallel was passed - including an explicit -np 1
needed to satisfy --kv-stream's single-sequence gate. Added
n_parallel_explicit tracking (same pattern as the existing
moe_cache.mode_explicit field) so an explicit -np now sticks; the
auto-batching heuristic still applies unchanged when -np isn't passed.

Assisted-by: Claude
@TheTom
TheTom merged commit 23fcf04 into TheTom:feature/turboquant-kv-cache Sep 6, 2026
9 of 24 checks passed
@TheTom

TheTom commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Merged. Exactly the split I asked for: the heuristic only runs when -np was not passed, nothing else reads the new flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants