Repository navigation
fix(sim-auto): support SM120 replay with dense FA4 batches - #312
Open
biofoolgreen wants to merge 1 commit into
Open
biofoolgreen wants to merge 1 commit into
biofoolgreen wants to merge 1 commit into
Conversation
Signed-off-by: Green Li <greenl@nvidia.com>
biofoolgreen
force-pushed
the
fix/sm120-sim-auto-replay
branch
from
October 26, 2026 08:07
318cc13 to
f2de74f
Compare
biofoolgreen
marked this pull request as ready for review
October 26, 2026 08:11
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 and behavior
Cosmos3-Nano-Sim-Auto is rejected at model construction on SM120 because replay admits only SM90 and SM10.x. Admitting
(12, 0)alone exposes a CUDA illegal-memory-access failure inside FA4's gapped-varlen forward on the published seven-camera joint RGB/LiDAR workload with the pinnedflash-attn-4==4.0.0b24.This PR offers a framework-side alternative that retains the existing dependency pins and still executes FA4's SM120 kernels. On SM120, segments with the same query/key lengths are stacked into dense batches, run through FA4 dense forward, and scattered back into their original output/LSE rows. The existing visibility partitions, GQA folding and FP32 LSE merge are retained. Other architectures keep their existing execution path. SM120 backward explicitly raises because training has not been qualified.
Related work and tradeoffs
This is a competing compatibility approach, not a claim that the existing PRs miss another independent FA4 bug. It adds host synchronization and temporary tensor copies per launch. It is intended for evaluation while the project still pins b24; it does not claim improved performance, general SM12x support, or validated training/backward support.
Validation
Manual hardware validation completed on 2026-10-26 against the exact PR commit
f2de74f022aa21de160e372802ae0dc75375f24bon 4 x NVIDIA RTX 6000D (SM120). The dedicated checkout was clean and the imported framework module path was checked before testing.CUDA_LAUNCH_BLOCKINGunset. All output checks passed: seven 1280x720 videos, 297 frames per view at 30 FPS, and 99 LiDAR sweeps. Range/intensity tensors had shape[99,128,1800], finite values, and frame IDs0,3,...,294.Observed device memory peaks from
nvidia-smi, sampled every 1 second over the inference process:Environment: Python 3.13, torch 2.10.0+cu130, torchcodec 0.10.0+cu130, flash-attn-4 4.0.0b24, nvidia-cutlass-dsl 4.6.0.dev0, driver 580.95.05. Model revision:
c3fa1378e93710242501a6288d7c9e7c9084a580; shared sample revision:b8dcc2f70421e31db86d1b81d194c791d65eaad2. Sampling, model weights and the published request were unchanged; guardrails were disabled for this public driving reference scene. The early/middle/late multiview preview was inspected as a basic visual check.This is one functional full-scene run, with existing runtime caches, rather than a repeated steady-state performance benchmark. Device memory includes CUDA/context/runtime allocations; 1-second sampling may miss short peaks. These manual results do not represent upstream GitHub Actions CI. SM90/SM10.x hardware regressions, SM121, and training/backward qualification remain untested. The earlier 732-second run used synchronous CUDA debugging and is not used to claim a speedup.
The retained evidence includes JUnit XML, per-case timing CSV, per-GPU numeric results, a 1-second GPU sampling CSV, stage timing JSON, output verification, source/lockfile SHA256s and SHA256-verified previews.
Regression command:
COSMOS_INTERNAL=0 COSMOS_TRAINING=0 python -m pytest --levels 0 -q \ cosmos_framework/model/generator/mot/maskless_attention_test.py \ cosmos_framework/model/generator/omni_mot_causal_model_test.py \ -k 'replay or gapped or FlashAttention'