Skip to content

fix(sampling): acquire PDL inputs before softmax reads - #1682

Draft
yechank-nvidia wants to merge 1 commit into
lightseekorg:mainfrom
yechank-nvidia:yechan/softmax-pdl-input-dependency
Draft

yechank-nvidia wants to merge 1 commit into
lightseekorg:mainfrom
yechank-nvidia:yechan/softmax-pdl-input-dependency

Conversation

@yechank-nvidia

Copy link
Copy Markdown
Collaborator

Problem:
The fused, map, and reduce softmax variants read per-request temperature before griddepcontrol.wait. Under programmatic dependent launch, a consumer could therefore observe stale producer data and emit all-NaN probabilities. A delayed-producer control reproduced the defect with PDL on; the same control was finite and exact with PDL off.

Correction:
Move the dependency wait ahead of every dependent temperature read and add a compiler memory clobber. Preserve softmax arithmetic, dtype, temperature semantics, and the existing PDL launch policy.

Validation on GB200 (recorded before this message-only amendment):

  • Original native fails the delayed-producer regression; corrected code passes eager and CUDA-graph producer/consumer tests.
  • Final suite: 120 passed, 36 strict expected failures for an unrelated, pre-existing zero-temperature padded-lane NaN case.
  • Serialized old/new comparison: 60 of 60 outputs bitwise identical, including the pre-existing NaN cases.
  • PDL stress control: 16 of 16 finite and exact across four GPUs.
  • Reduced-output graph replay with the separate request-local RNG fix: 48 of 48 passed. This is not a full model or serving evaluation.
  • Native sm100a disassembly confirms acquire precedes temperature load.
  • pre-commit run --all-files: passed again before this amendment.

Performance:
No clean latency or throughput comparison was collected; no speedup is claimed. This is a synchronization correctness fix, not PDL disablement. The original unobserved replay failure is not assigned a proven cause, and the unrelated zero-temperature bug remains open.

Summary

Test Plan

Problem:
The fused, map, and reduce softmax variants read per-request temperature
before griddepcontrol.wait. Under programmatic dependent launch, a
consumer could therefore observe stale producer data and emit all-NaN
probabilities. A delayed-producer control reproduced the defect with PDL
on; the same control was finite and exact with PDL off.

Correction:
Move the dependency wait ahead of every dependent temperature read and
add a compiler memory clobber. Preserve softmax arithmetic, dtype,
temperature semantics, and the existing PDL launch policy.

Validation on GB200 (recorded before this message-only amendment):
- Original native fails the delayed-producer regression; corrected code
  passes eager and CUDA-graph producer/consumer tests.
- Final suite: 120 passed, 36 strict expected failures for an unrelated,
  pre-existing zero-temperature padded-lane NaN case.
- Serialized old/new comparison: 60 of 60 outputs bitwise identical,
  including the pre-existing NaN cases.
- PDL stress control: 16 of 16 finite and exact across four GPUs.
- Reduced-output graph replay with the separate request-local RNG fix:
  48 of 48 passed. This is not a full model or serving evaluation.
- Native sm100a disassembly confirms acquire precedes temperature load.
- pre-commit run --all-files: passed again before this amendment.

Performance:
No clean latency or throughput comparison was collected; no speedup is
claimed. This is a synchronization correctness fix, not PDL disablement.
The original unobserved replay failure is not assigned a proven cause,
and the unrelated zero-temperature bug remains open.

Signed-off-by: yechank <161688079+yechank-nvidia@users.noreply.github.com>

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.

1 participant