Skip to content

cuda: skip unused sample probability outputs for GLM and MiniMax - #4665

Draft
tacosta wants to merge 4 commits into
ashhart:mainfrom
tacosta:feat/3711-unused-prob-output
Draft

tacosta wants to merge 4 commits into
ashhart:mainfrom
tacosta:feat/3711-unused-prob-output

Conversation

@tacosta

@tacosta tacosta commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

GLM and MiniMax M3 CUDA samplers do not consume tf_draw's optional probability output. They now pass a null device pointer and drop the unused allocation and cleanup. Full-vocabulary sampling can skip its post-selection probability-mass pass; candidate sampling keeps the normalization needed to select a token.

Fixes #3711.

Rebased head and review fixes

  • Rebased onto current main at 93dd46c33c87d953678893ca3d0e929118553c33.
  • Local head: 8d599c96c89befd758322cbe46bcfc8662965146 (four commits, seven changed files).
  • Expanded the optional-probability test across the existing logit distributions, GLM/MiniMax vocabulary widths, masked logits, multiple rows, seeds, positions and sampling settings; added the top-k 1024/1025 boundary.
  • Poisoned token outputs before both launches and assert valid IDs, preventing a stale-buffer false pass.
  • Explicitly attached the GLM sampler regression to aggregate host tests.

Qualification on this head

  • zig fmt --check build.zig zig: pass.
  • git diff --check origin/main...HEAD: pass.
  • python3 tools/pr_check.py --base origin/main --pr 4665: 0 errors, 4 advisory warnings; 7 changed files; lean 123 vs 123, with 0 new findings.
  • Focused host tests: GLM 11/11, MiniMax 2/2, CUDA host 2/2 passed.
  • Aggregate zig build: 1,174/1,176 steps succeeded; 14,100/14,207 tests passed and 107 skipped. The single failing test process is draft_sources_xpu_test, which logged zeInit: ze result 0x78000001; it is outside the sampler changes.
  • CUDA sample suite on an RTX 5090 Laptop GPU: pass. 3,168 host-reference draws had 0 differences; optional-probability parity passed for 2,304 full-row cases and 256 GLM/MiniMax-width settings across 1,024 rows; pitched proposal checks passed 54/54.
  • LocalATC job job_20261126_212546_87af0d; retained artifacts: patch art_3711-unused-prob-output_job_20261126_212546_87af0d_d84311, qualification script ..._3a0921, log ..._225721. Patch SHA-256: 0983db48e5150cf434f18062c8ca1d7b37db5b68daa24c5868876205a9955146.

The local GPU is not GB10, so these results are correctness evidence only and make no performance claim.

Maintainer gates still outstanding

  • On a supported GLM checkpoint, verify drafted output against "draft": false, resumed prompt against a fresh run, and concurrent output against solo output (with the requested tensor-parallel configuration).
  • On GB10, measure full-row sampler timing and compare main versus this branch on the same checkpoint for decode and prompt performance at one stream and the widest admitted configuration, greedy and sampled, with and without --drafter.
  • Served-model parity for the required model/checkpoint configurations remains outstanding.

Overlap and status

The post-rebase ATC overlap scan is incomplete (otherPullRequestsLimit, pullRequestsLimit). It reports possible ledger conflicts with #4416 and #4701, and overlap with #4698 in the optimization ledger, GLM CUDA sampler and CUDA sample tests (two conflict files reported). Several worktree conflicts were also found, but atc who could not retrieve PR file data, so additional conflicts may be missing. Leaving cross-PR coordination to Ash.

Keeping this PR in draft until the maintainer gates and overlap coordination are resolved.

@tacosta

tacosta commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ashhart, the published head’s listed CI checks have passed; the host-nightly checks were skipped. The GLM and MiniMax wrapper regression tests pass without CUDA hardware. The requested served-GLM parity and GB10 performance runs remain outstanding and are documented in the PR. Are those runs required before I mark this ready for review, or is the source-level patch ready for review?

@tacosta
tacosta force-pushed the feat/3711-unused-prob-output branch 2 times, most recently from 8580658 to 99f3510 Compare November 24, 2026 20:28
@tacosta

tacosta commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 3942d68 and resolved the optimization-ledger row collision by preserving upstream row 39 and placing the sampler entry at row 40. Main has since advanced to d30325d; GitHub reports the PR mergeable.

@tacosta

tacosta commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ashhart — I mapped your Nov 22 gate to the evidence on this PR.

  • Fixed-logit token identity (small-k and full-row): covered. probabilityOutputOptional() compares identical logits, seed, position and rules with a valid PROB pointer versus null across 8 settings: top-k 20/1024 for candidate sampling, top-k 0/1500 for full-vocabulary sampling, and top-p 1.0/0.95. The earlier GPU qualification on base 2686dde passed all 8 identity cases and 2,880/2,880 host-reference draws. On current head 7628c54, the focused host targets and static checks passed, including 13/13 GLM/MiniMax host tests; the CUDA sample has not been rerun after the rebase.
  • Served-model identity (sampled and drafted hashes versus main for both families, GLM with TP): outstanding. The available GLM checkpoint is unsupported by the current native CUDA engine, and no MiniMax checkpoint is available. The requested GLM drafted-versus-drafter-off, resumed-versus-fresh, and concurrent-versus-solo comparisons are also pending.
  • Full-row sampler timing: outstanding. We have no GB10 runner, so the requested GB10 timing and same-checkpoint main-versus-branch decode/prompt comparisons have not been run. The local RTX 5090 is not a substitute, and no performance claim is made.

To complete the remaining checks, could you point us to supported GLM and MiniMax checkpoint revisions, the intended GLM tensor-parallel setup, and a GB10 runner? Should the draft stay in draft until those runs are complete, or can source-level review proceed while we arrange access? I’ve added this evidence map to the PR description as well.

@tacosta

tacosta commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@ashhart — update on the rebase and overlap check.

Could you coordinate the overlapping work and let me know when the branch should be refreshed again? I’m leaving the PR in draft pending that coordination.

@tacosta
tacosta force-pushed the feat/3711-unused-prob-output branch from 7628c54 to 8d599c9 Compare November 26, 2026 22:49

This branch has not been deployed

No deployments
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.

GLM/MiniMax CUDA: unused probability outputs force an extra full-vocabulary reduction

1 participant