Skip to content

feat(dspark): expose forced-rejection diagnostics - #1170

Open
jhinpan wants to merge 1 commit into
lightseekorg:mainfrom
jhinpan:jhinpan/feat-1132-forced-rejection-v2
Open

feat(dspark): expose forced-rejection diagnostics#1170
jhinpan wants to merge 1 commit into
lightseekorg:mainfrom
jhinpan:jhinpan/feat-1132-forced-rejection-v2

Conversation

@jhinpan

@jhinpan jhinpan commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add TOKENSPEED_FORCE_SINGLE_TOKEN_VERIFY=1 to keep the full speculative proposal/target-verify round while committing exactly one target token
  • reuse the existing per-row force mask, preserve remote-recovery semantics, and keep the default local decode path unchanged
  • document the diagnostic and cover CPU, mixed-row, default-off, and CUDA-graph behavior

This supplies the acceptance-independent gate requested by #1132. On exact 131072/1024 TP8/EP8 it measured 36.80 ms per speculative round versus 17.06 ms ordinary decode (2.157x). Forced DSpark remained token-identical to ordinary greedy for a 4K/1K repeated prompt and an exact 131K/128 natural prompt.

Test plan

  • focused DSpark/runtime suite: 84 passed on gfx950
  • isort --check-only, black --check, git diff --check
  • exact 131072/1024, B1/C1, TP8/EP8, FP8 KV, greedy, decode graphs, prefix caching off: three unprofiled runs per arm
  • separate all-rank first-64 trace for attribution

Local pre-commit could not create its configured Python 3.12 hook environment because this ROCm container only ships Python 3.10; the equivalent Python formatting/syntax checks above passed.

Allow operators to commit one target token while preserving the full proposal and verification round, so infrastructure cost can be measured independently of model acceptance.

Signed-off-by: Jin Pan <jin.pan@amd.com>
@jhinpan
jhinpan force-pushed the jhinpan/feat-1132-forced-rejection-v2 branch 2 times, most recently from 3e31648 to 11ea9cb Compare August 25, 2026 23:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11ea9cb74f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +824 to +826
if row_count <= 0 or (
decode_input_ids is None and not FORCE_SINGLE_TOKEN_VERIFY
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep penalty history aligned with forced acceptance

When TOKENSPEED_FORCE_SINGLE_TOKEN_VERIFY=1 is used with the triton_full or flashinfer_full sampling backend and repetition, frequency, or presence penalties, this override happens only after verify() has already updated its token-count state from the unmodified accept_index (triton_full.py:548-560, flashinfer_full.py:476-488). Tokens discarded by forcing the returned length to one therefore remain in the sampler's history and alter penalties in subsequent rounds, so the diagnostic no longer behaves as though it committed exactly one token. Pass the forced width into verification or otherwise limit/undo the count accumulation for discarded tokens.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant