Production diagnostic: QWEN36_HOST_SAMPLE_WHY (which request/param forces host sampling; logging only) #345

Merged
orchestra merged 1 commit from opus/host-sample-why into master 2026-11-04 01:55:34 +01:00
Member

Owner-approved 2026-11-04: fix 1 of the host-sampling investigation (logging only). No speed change intended.

Why

Production logs QWEN36_MTP_BATCH plain-decode fallback (host sampling) without naming a request or a param. Journal 10-30..11-03: 68,569 host-sampled plain steps vs 1,075,646 MTP steps (6.0% of steps; 1.2-25% per boot). The refusal in check_perform_device_sampling is batch-wide, so every co-batched user drops to plain decode (~7-11 TG tok/s/user in those windows, vs 33-68 tok/s at B1 with MTP). vLLM does not log request params (no --enable-log-requests).

What

  • patches/prod-local-plugin/src/vllm_tt_plugin/host_sample_why.py (new, pure Python): one line per (request, check):
    QWEN36_HOST_SAMPLE_WHY host sampling: req=<id> check=<check> params=<client param>=<value>
    Checks: greedy-only, sampling-tensors, num-reqs, device-k, top_k (>64), top_p, temperature, penalty, host-only-params (min_p / logit_bias / min_tokens / allowed_token_ids / bad_words), structured-output, logprobs. Ids and numbers/counts/kinds only; never prompt text, logit_bias keys, bad_words, token ids or grammar bodies. Rate limit 30 lines / 60 s (suppressed count carried on the next line); bounded seen-set, forgotten at request finish. A config-level refusal no request explains logs req=- once. Banner QWEN36_HOST_SAMPLE_WHY engaged.
  • model_runner.py: every decode-step return False in check_perform_device_sampling goes through _hsw_refuse(check) (reports, returns False). Verdict unchanged; one attribute test with the flag off. The first return False (prefill under decode_only) stays bare.
  • Arm s12-prefix-host-vsplit-sf: env QWEN36_HOST_SAMPLE_WHY=1, banner in [expect]. Nix specs regenerated (s12-prefix / s12-prefix-host-vsplit source lists too); tenstorrent-serving.nix mounts the module (list_tree rule); test_prod_matches_nix asserts the flag.

Gate

The prod arm's gate stamp cold-pp-gate-s12-prefix-host-vsplit-sf-20261103T221004Z becomes STALE (the CI sweep warns). Not re-gated: logging only, and the sampling verdict is unchanged (tests/test_host_sample_why.py Wiring runs the served check against real torch tensors with the flag on and off).

Verification

  • tests/test_host_sample_why.py: 20/20 (torch env), incl. no-prompt-text, rate limit, once-per-request, served-check wiring
  • python3 -m unittest discover -s tools/ttx/tests (ttx-test-python): 739 OK
  • ttx nix-spec --check OK; check-gate-parity --all OK (STALE warnings); check-cited-records OK; overview.py --check OK; nixfmt OK

Deploy: nixos-llm pin bump after merge, outside the 01:45-05:15 CET P/D rehearsal window. Post-deploy check: banners (new + #344's), and one WHY line for a logprobs: true smoke.

🤖 Generated with Claude Code

Owner-approved 2026-11-04: fix 1 of the host-sampling investigation (logging only). No speed change intended. ## Why Production logs `QWEN36_MTP_BATCH plain-decode fallback (host sampling)` without naming a request or a param. Journal 10-30..11-03: 68,569 host-sampled plain steps vs 1,075,646 MTP steps (6.0% of steps; 1.2-25% per boot). The refusal in `check_perform_device_sampling` is batch-wide, so every co-batched user drops to plain decode (~7-11 TG tok/s/user in those windows, vs 33-68 tok/s at B1 with MTP). vLLM does not log request params (no `--enable-log-requests`). ## What - `patches/prod-local-plugin/src/vllm_tt_plugin/host_sample_why.py` (new, pure Python): one line per (request, check): `QWEN36_HOST_SAMPLE_WHY host sampling: req=<id> check=<check> params=<client param>=<value>` Checks: greedy-only, sampling-tensors, num-reqs, device-k, top_k (>64), top_p, temperature, penalty, host-only-params (min_p / logit_bias / min_tokens / allowed_token_ids / bad_words), structured-output, logprobs. Ids and numbers/counts/kinds only; never prompt text, logit_bias keys, bad_words, token ids or grammar bodies. Rate limit 30 lines / 60 s (suppressed count carried on the next line); bounded seen-set, forgotten at request finish. A config-level refusal no request explains logs `req=-` once. Banner `QWEN36_HOST_SAMPLE_WHY engaged`. - `model_runner.py`: every decode-step `return False` in `check_perform_device_sampling` goes through `_hsw_refuse(check)` (reports, returns False). Verdict unchanged; one attribute test with the flag off. The first `return False` (prefill under decode_only) stays bare. - Arm `s12-prefix-host-vsplit-sf`: env `QWEN36_HOST_SAMPLE_WHY=1`, banner in `[expect]`. Nix specs regenerated (s12-prefix / s12-prefix-host-vsplit source lists too); `tenstorrent-serving.nix` mounts the module (list_tree rule); `test_prod_matches_nix` asserts the flag. ## Gate The prod arm's gate stamp `cold-pp-gate-s12-prefix-host-vsplit-sf-20261103T221004Z` becomes STALE (the CI sweep warns). Not re-gated: logging only, and the sampling verdict is unchanged (`tests/test_host_sample_why.py` Wiring runs the served check against real torch tensors with the flag on and off). ## Verification - `tests/test_host_sample_why.py`: 20/20 (torch env), incl. no-prompt-text, rate limit, once-per-request, served-check wiring - `python3 -m unittest discover -s tools/ttx/tests` (ttx-test-python): 739 OK - `ttx nix-spec --check` OK; `check-gate-parity --all` OK (STALE warnings); `check-cited-records` OK; `overview.py --check` OK; nixfmt OK Deploy: nixos-llm pin bump after merge, outside the 01:45-05:15 CET P/D rehearsal window. Post-deploy check: banners (new + #344's), and one WHY line for a `logprobs: true` smoke. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
QWEN36_HOST_SAMPLE_WHY: log which request and param send a decode step to host sampling (production, logging only)
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 3m54s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 12m50s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 13m2s
cards-fresh cards: not measured (serving active or MemAvailable low); add cards:go to retry
tt-stack-ci / Serialized card gate (pull_request) Successful in 15m56s
cards-fresh / Re-check cards-fresh on open PRs (push) Successful in 12m11s
502d0ea22f
Owner-approved 2026-11-04 (fix 1 of the host-sampling investigation, logging only).
Production logs "QWEN36_MTP_BATCH plain-decode fallback (host sampling)" without naming a request or a
parameter: 68,569 host-sampled plain steps vs 1,075,646 MTP steps over 10-30..11-03, and the refusal is
batch-wide (every co-batched user drops to plain decode, ~7-11 TG tok/s/user in those windows).

- host_sample_why.py (new, pure Python): one line per (request, check),
  "QWEN36_HOST_SAMPLE_WHY host sampling: req=<id> check=<check> params=<client param>=<value>", the
  check being the return point that refused device sampling. Ids and numbers / counts / kinds only
  (never prompt text, logit_bias keys, bad_words, token ids or grammar bodies); <= 30 lines per 60 s
  with the suppressed count carried on the next line; bounded seen-set, forgotten when the request
  finishes. Banner "QWEN36_HOST_SAMPLE_WHY engaged".
- model_runner.py: every decode-step `return False` in check_perform_device_sampling goes through
  _hsw_refuse(check), which reports and returns False (verdict unchanged; one attribute test when off).
- Arm s12-prefix-host-vsplit-sf: env += QWEN36_HOST_SAMPLE_WHY=1, banner in [expect]; nix specs
  regenerated (s12-prefix, s12-prefix-host-vsplit source lists too); tenstorrent-serving.nix mounts
  host_sample_why.py (list_tree rule); test_prod_matches_nix asserts the flag.
- The prod arm's gate stamp is now STALE (identity changed by the diagnostic flag + sources; the
  CI sweep warns). Not re-gated: the change is logging only and the device-sampling verdict is
  unchanged (tests/test_host_sample_why.py Wiring runs the served check with and without the flag).

Tests: tests/test_host_sample_why.py 20/20 (torch); tools/ttx/tests 739 OK; nix-spec --check OK;
check-gate-parity --all OK (STALE warnings); cited-records OK; utilization --check OK; nixfmt OK.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner

[ho-9c0a9487c50b] verdict: approve
tier: T1

rationale: Logging-only diagnostic, exactly as described. host_sample_why.py is pure Python, flag-gated (inert unless QWEN36_HOST_SAMPLE_WHY=1), and leaks no prompt content — ids, counts, and param values only; logit_bias/allowed_token_ids/bad_words/grammar bodies are count/kind only. Every decode-step return False in check_perform_device_sampling routes through _hsw_refuse(), which is try/except-wrapped and always returns False, so the verdict is provably unchanged (one cheap attribute test when off). Stale gate stamp is disclosed and justified. Tests: 20/20 module + wiring (served code exec'd against real torch tensors, flag on/off), 739 ttx, nix-spec/gate-parity/nixfmt clean.

concerns:

  • [nit] model_runner.py:_hsw_refuse rebuilds the rows list from input_batch on every refused step while the flag is on — fine for a bounded diagnostic, just plan the arm for removal (or a follow-up flag-off) once the answer is in.
  • [nit] tests/test_host_sample_why.py Source test asserts an exact return False count — intentionally brittle as a wiring guard; will need touching if any future refusal is added, which is the point.
[ho-9c0a9487c50b] **verdict:** approve **tier:** T1 **rationale:** Logging-only diagnostic, exactly as described. `host_sample_why.py` is pure Python, flag-gated (inert unless `QWEN36_HOST_SAMPLE_WHY=1`), and leaks no prompt content — ids, counts, and param values only; `logit_bias`/`allowed_token_ids`/`bad_words`/grammar bodies are count/kind only. Every decode-step `return False` in `check_perform_device_sampling` routes through `_hsw_refuse()`, which is try/except-wrapped and always returns `False`, so the verdict is provably unchanged (one cheap attribute test when off). Stale gate stamp is disclosed and justified. Tests: 20/20 module + wiring (served code exec'd against real torch tensors, flag on/off), 739 ttx, nix-spec/gate-parity/nixfmt clean. **concerns:** - [nit] `model_runner.py:_hsw_refuse` rebuilds the rows list from `input_batch` on every refused step while the flag is on — fine for a bounded diagnostic, just plan the arm for removal (or a follow-up flag-off) once the answer is in. - [nit] `tests/test_host_sample_why.py` Source test asserts an exact `return False` count — intentionally brittle as a wiring guard; will need touching if any future refusal is added, which is the point.
Member

Cards skipped

Cards unavailable on cfx-llm0 for PR #345 502d0ea22fe1c03955bfc3bd2c5cf5a1a221b864.

  • systemctl is-active tenstorrent-serving.service = active (need inactive)
  • MemAvailable = 67416804 kB (need >= 4000000)

No slot taken, no boot. This skip is green.

## Cards skipped Cards unavailable on `cfx-llm0` for PR #345 `502d0ea22fe1c03955bfc3bd2c5cf5a1a221b864`. - `systemctl is-active tenstorrent-serving.service` = `active` (need `inactive`) - MemAvailable = `67416804` kB (need >= 4000000) No slot taken, no boot. This skip is green.
orchestra merged commit 502d0ea22f into master 2026-11-04 01:55:34 +01:00
Owner

agent-gateway closeout (merged): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (merged): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack!345
No description provided.