Skip to content

Omit unsupported filter ranges from vocabulary-parallel DeepSeek packages - #180

Closed
jayinsine wants to merge 1 commit into
NVIDIA:mainfrom
jayinsine:vocabulary-parallel-filter-ranges
Closed

jayinsine wants to merge 1 commit into
NVIDIA:mainfrom
jayinsine:vocabulary-parallel-filter-ranges

Conversation

@jayinsine

Copy link
Copy Markdown

Problem

#167 declared a DeepSeek V4.1 top-p range of [0.95, 1]. --vocabulary-parallel-sampling supports only unfiltered target distributions (model-preparation.md: top-k, top-p, and min-p "must remain disabled"), and PreparedVocabularySoftmax marks a row invalid when top-p ≠ 1. Packages exported with the option after #167 accept top_p: 0.95, and every speculative round of that request then fails verification:

HTTP 500  prepared model reported device error 6   (INVALID_SPECULATION)

With --mtp-draft-tokens 0, the same package serves top_p: 0.95. Packages exported before #167 aren't affected because they clamp top-p to 1.

Change

  • SamplingDefaults.unfiltered() returns the policy without top-k, top-p, and min-p ranges, and rejects defaults that enable those filters.
  • DeepSeek V4.1's PreparationConfig.sampling_defaults packages that policy when vocabulary-parallel sampling is enabled, and __post_init__ checks it before any GPU work.
  • As with any absent range, requests are clamped to the default (top-p 1).
  • Other ranges, such as repetition_penalty [1, 1.1], are unchanged. Packages exported without the option keep the top-p range.
  • No kernel, Helios, or package-contract changes. docs/model-preparation.md and docs/api.md describe the packaged policy.

Validation

Unit tests:

  • New: the unfiltered policy keeps non-filter ranges (top-k −1 and 0) and rejects enabled filter defaults.
  • New: the DeepSeek export adapter packages the expected ranges, with and without --vocabulary-parallel-sampling. This test fails without the bootstrap change.
  • Affected suites (test_frontend_metadata, test_declarations, test_planning, test_speculative_graph_budget, test_deepseek41_frontend, test_native_recipe_contract, test_runtime_package; Heliopause built with qualification): 296 passed, 37 skipped, 11 failed.
  • The same 11 fail on cc696a6b without this change:
    • five need the Kimi K3 checkpoint
    • two are the deepseek41 and muse_spark cases of test_default_mode_uses_manually_declared_model_card_sampling
    • two are runtime collective-ladder cases in test_every_recipe_passes_collective_policy_to_preparation
    • three are graph-budget cases

GPU: TP4 on four RTX PRO 6000 Blackwell GPUs.

  • Export: a derivative of the qualified DeepSeek-V4.1-Flash-1017 revision, with --max-concurrency 32 --mtp-draft-tokens 7 --vocabulary-parallel-sampling --draft-head-quantization nvfp4 --markov-head-quantization fp8. Reuse retained warmup mappings across compiled warmup #154 was applied locally so the C32 export fits; it is not part of this PR. Served with flare run.
  • flare inspect: the new package has no top-p range and keeps the repetition-penalty range. A package exported from 902c88e2 shows top-p [0.95, 1].
  • top_p: 0.95: chat requests at C1 and C8 plus one streamed request all returned 200, with 3.4–3.8 accepted drafts per verification round. The 902c88e2 package returned device error 6 for the same request.
  • Functional and speed: API checks passed 34/34, and decode throughput was unchanged against the previous export.

Limitations

Prepared with an AI agent (Claude Opus 5.5); see the Design-Signed-Off-By trailer. It doesn't touch CUDA, Triton, or GPU optimization code (design-review principle 14).

…ages

Since NVIDIA#167, DeepSeek V4.1 declares a top-p range of [0.95, 1].
Vocabulary-parallel sampling supports only unfiltered target
distributions: its softmax marks a row invalid when top-p is not 1,
min-p is not 0, or top-k is active. A package exported with
--vocabulary-parallel-sampling after NVIDIA#167 therefore admits top_p 0.95,
every speculative round of that request fails verification, and the
request ends with HTTP 500 "prepared model reported device error 6"
(INVALID_SPECULATION). The same package serves top_p 0.95 with
--mtp-draft-tokens 0, and packages exported before NVIDIA#167 clamp top-p
to 1.

SamplingDefaults.unfiltered() returns the policy without top-k, top-p,
and min-p ranges and rejects defaults that enable those filters.
DeepSeek V4.1's PreparationConfig packages that policy when
vocabulary-parallel sampling is enabled and validates it on
construction. As for any absent range, requests are clamped to the
default (top-p 1), which keeps the documented requirement that these
filters stay disabled for this option. Other ranges, including
repetition_penalty [1, 1.1], are unchanged, and packages exported
without the option keep the top-p range. The preparation and API
documents describe the packaged policy.

Validation:
- New tests cover the unfiltered policy (non-filter ranges kept for
  top-k -1 and 0, enabled filter defaults rejected) and the DeepSeek
  export adapter with and without --vocabulary-parallel-sampling. The
  adapter test fails without the bootstrap change.
- tests/preparation/test_frontend_metadata.py,
  tests/recipes/test_declarations.py, tests/cli/test_planning.py,
  tests/cli/test_speculative_graph_budget.py,
  tests/recipes/test_deepseek41_frontend.py,
  tests/preparation/test_native_recipe_contract.py and
  tests/preparation/test_runtime_package.py, with Heliopause built with
  the qualification feature: 296 passed, 37 skipped, 11 failed. The
  same 11 fail on cc696a6 without this change: five need the Kimi K3
  checkpoint, two are the deepseek41 and muse_spark default-sampling
  expectations, two are runtime collective-ladder cases, and three are
  graph-budget cases.
- GPU: exported a derivative of the qualified DeepSeek-V4.1-Flash-1017
  revision at TP4 on four RTX PRO 6000 Blackwell GPUs (C32, MTP 7,
  --vocabulary-parallel-sampling, NVFP4 draft head, FP8 Markov head;
  NVIDIA#154 applied locally so the C32 export fits) and served it with
  flare run. flare inspect shows no top-p range and keeps the
  repetition-penalty range; a package exported from 902c88e shows
  top-p [0.95, 1]. Chat requests with top_p 0.95 at C1 and C8 and one
  streamed request all returned 200 with 3.4-3.8 accepted drafts per
  verification round, where the 902c88e package returned device
  error 6. Functional API checks passed 34/34 and decode throughput was
  unchanged.

Limitations: on these packages a request for top_p below 1 receives
top-p 1, as before NVIDIA#167, rather than a filtered distribution. Top-p
support in vocabulary-parallel verification would change its sampling
kernels and is not attempted here. Only single-host TP4 was exercised.

Design-Signed-Off-By: Claude Opus 5.5 (agent for Josh Cartu); design-review=a38f
Signed-off-by: Josh Cartu <j@mail99.me>
@jayinsine
jayinsine force-pushed the vocabulary-parallel-filter-ranges branch from 998842a to 38963a4 Compare November 4, 2026 08:21
@original-el8 original-el8 added the triage:superseded Behavior appears covered by main; check residual scope, then close if none remains. label Nov 5, 2026
@original-el8

Copy link
Copy Markdown
Collaborator

Merged #208 (5e356e6) addresses the unsupported DeepSeek sampling range. It removes the top-p range from the DeepSeek V4.1-1017 declaration and rejects filtered defaults/ranges during vocabulary-parallel planning. This PR's expectation that non-vocabulary-parallel exports retain the 0.95–1 range also differs from #208's model-card correction.

Marked triage:superseded: close unless a distinct unsupported-filter case remains on main. Previously exported packages retain their stored sampling ranges and require re-export; merging another source patch would not update those packages.

@jayinsine

Copy link
Copy Markdown
Author

Closing as superseded by #208. On main, DeepSeek V4.1-1017 declares no top-p range and vocabulary-parallel planning rejects filtered sampling defaults and ranges, which covers the device error 6 failure this PR addressed. Packages exported before #208, including ones built with this patch applied, keep their stored ranges until re-export.

@jayinsine jayinsine closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:superseded Behavior appears covered by main; check residual scope, then close if none remains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants