Distributed neighborhood-attention upsampling + consistent CUDA launch checking#231
Open
azrael417 wants to merge 3 commits into
Open
Distributed neighborhood-attention upsampling + consistent CUDA launch checking#231azrael417 wants to merge 3 commits into
azrael417 wants to merge 3 commits into
Conversation
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.
Summary
Adds the upsample direction to DistributedNeighborhoodAttentionS2 and hardens CUDA launch error checking across the attention and DISCO extensions.
ring while queries and the softmax state stay local. All three directions — self-attention, downsampling, upsampling — are now supported by the distributed layer. Previously the distributed
path asserted nlon_in % nlon_out == 0 and upsampling was unsupported.
transitive includes, so a bad launch surfaces at the launch site rather than at a later, unrelated sync.
Version bumped to 0.9.2c.
Motivation
The serial NeighborhoodAttentionS2 already supported all three resolution directions; the distributed layer only did self-attention and downsampling. Upsampling needs an input-keyed scatter
(each input cell contributes to multiple output cells) rather than the output-keyed gather used by the other directions, which is why it gets its own ring-step kernels and psi convention
(_build_local_psi_upsample) rather than reusing the existing ones.
Changes
backward_ring_step_upsample_pass2.
API / numerical behavior
Testing
CPU (CI equivalent):
python3 -m pytest tests/test_attention.py -x
PT2 contract for the new ops (opcheck, single-rank so no NCCL) — new test:
python3 -m pytest tests/test_attention.py -k ring_upsample_kernels_pt2_compatibility -x
Distributed (multi-GPU), including the new upsample rows (pscale_out = 2/3/4 and odd nlat_in→even nlat_out):
bash tests/run_tests.sh -d --grid_size_lat 2 --grid_size_lon 2
validated across 1x1, 1x2, 2x1, 2x2, 2x4, 4x2
All attention tests pass on CPU/CUDA; distributed attention tests pass across the split configs above, now covering the upsample direction.
Changelog
Changelog.md updated under v0.9.2c with both items.