fix(sampling): acquire PDL inputs before softmax reads - #1682
Draft
yechank-nvidia wants to merge 1 commit into
Draft
yechank-nvidia wants to merge 1 commit into
yechank-nvidia wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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