Skip to content

add Laguna XS-2.1 SWE example - #3186

Open
rasdani wants to merge 4 commits into
mainfrom
exp/laguna-xs21-swe-example
Open

add Laguna XS-2.1 SWE example#3186
rasdani wants to merge 4 commits into
mainfrom
exp/laguna-xs21-swe-example

Conversation

@rasdani

@rasdani rasdani commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a standalone poolside/Laguna-XS-2.1 RL example for ScaleSWE with online pass@1 evaluation on SWE-Bench Verified.

The example captures the tested setup:

  • two trainer nodes and four single-node DEP8 inference groups (TP1, DP8, EP8)
  • the Laguna XS-2.1 renderer and vLLM's built-in poolside_v1 parsers
  • vLLM expert parallel inference and routed-expert replay for MoE training
  • the standard bash harness without a judge
  • checkpointing every 25 steps and startup/every-20-step SWE-Bench Verified evaluation
  • trainer compilation enabled following a successful five-step, two-node compiled trainer validation
  • labeled Prime sandboxes with startup cleanup

This is based directly on current main, so it does not carry the earlier local parser workaround, old dependency pins, GLM configs, or cluster-specific node exclusions.

Validation

  • uv run rl @ examples/advanced/laguna-xs-2.1/swe.toml --dry-run --output-dir <temp-dir>
  • uv lock --check
  • built and installed the standalone prime-rl-configs wheel outside the workspace
  • verified the slim install imports against verifiers==0.2.2.dev76 and vf.ServeConfig
  • git diff --check

The dry run generated trainer, orchestrator, inference, and Slurm configs successfully with throughput-oriented DEP8 inference and the 10,000-step CLI override. The external slim-wheel import reproducing the previous CI failure also passes. A compiled two-node, 16-GPU trainer run completed five steps on current main; step 1 took 2m17s and subsequent steps took 19–22s without NCCL errors.

Historical trainer compilation failure

An earlier compiled trainer failed in Slurm job 1578 on 2026-08-01. The current config restores compilation after the two-node five-step validation described above. At sequence 3750, rank 0 entered FSDP _REDUCE_SCATTER_BASE while rank 1 (and ranks 2–7) entered Ulysses ALLTOALL_BASE. After the 3,600-second watchdog timeout, NCCL terminated the process group. The relevant rank-0 and rank-1 stderr is reproduced verbatim below.

Full NCCL collective-mismatch trace (job 1578)
[rank0]:[E801 01:01:39.260111354 ProcessGroupNCCL.cpp:1849] [PG ID 0 PG GUID 0(default_pg) Rank 0] Observed flight recorder dump signal from another rank via TCPStore.
[rank0]:[E801 01:01:39.261254230 ProcessGroupNCCL.cpp:1914] [PG ID 0 PG GUID 0(default_pg) Rank 0] Received a dump signal due to a collective timeout from  rank 3 and we will try our best to dump the debug info. Last enqueued NCCL work: 3751, last completed NCCL work: 3749.This is most likely caused by incorrect usages of collectives, e.g., wrong sizes used across ranks, the order of collectives is not same for all ranks or the scheduled collective, for some reason, didn't run. Additionally, this can be caused by GIL deadlock or other reasons such as network errors or bugs in the communications library (e.g. NCCL), etc.
[rank0]:[E801 01:01:39.262164320 ProcessGroupNCCL.cpp:1628] [PG ID 0 PG GUID 0(default_pg) Rank 0] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1, only active collectives: 0
[rank0]:[E801 01:01:40.633196518 ProcessGroupNCCL.cpp:689] [Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3750, OpType=_REDUCE_SCATTER_BASE, NumelIn=79794432, NumelOut=9974304, Timeout(ms)=3600000) ran for 3600097 milliseconds before timing out.
[rank0]:[E801 01:01:40.633637525 ProcessGroupNCCL.cpp:2303] [PG ID 0 PG GUID 0(default_pg) Rank 0]  failure detected by watchdog at work sequence id: 3750 PG status: last enqueued work: 3751, last completed work: 3749
[rank0]:[E801 01:01:40.634292450 ProcessGroupNCCL.cpp:733] Stack trace of the failed collective:
#0 reduce_scatter_tensor from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/distributed_c10d.py:4652
#1 wrapper from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/c10d_logger.py:83
#2 __call__ from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_collectives.py:125
#3 foreach_reduce from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_collectives.py:544
#4 decorate_context from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/utils/_contextlib.py:124
#5 post_backward from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_param_group.py:567
#6 backward from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_param_group.py:902
#7 apply from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/autograd/function.py:317

[rank1]:[E801 01:01:39.674967915 ProcessGroupNCCL.cpp:689] [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3750, OpType=ALLTOALL_BASE, NumelIn=201222144, NumelOut=201222144, Timeout(ms)=3600000) ran for 3600041 milliseconds before timing out.
[rank1]:[E801 01:01:39.675356666 ProcessGroupNCCL.cpp:2303] [PG ID 0 PG GUID 0(default_pg) Rank 1]  failure detected by watchdog at work sequence id: 3750 PG status: last enqueued work: 3755, last completed work: 3749
[rank1]:[E801 01:01:39.676667143 ProcessGroupNCCL.cpp:733] Stack trace of the failed collective:
#0 all_to_all_single from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/distributed_c10d.py:4829
#1 wrapper from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/c10d_logger.py:83
#2 forward from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/nn/functional.py:430
#3 apply from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/autograd/function.py:596
#4 backward from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/distributed/nn/functional.py:446
#5 apply from /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/autograd/function.py:317

[rank1]:[E801 01:01:39.677080285 ProcessGroupNCCL.cpp:2636] [PG ID 0 PG GUID 0(default_pg) Rank 1] First PG on this rank to signal dumping.
[rank1]:[E801 01:01:39.254662130 ProcessGroupNCCL.cpp:1914] [PG ID 0 PG GUID 0(default_pg) Rank 1] Received a dump signal due to a collective timeout from this local rank and we will try our best to dump the debug info. Last enqueued NCCL work: 3755, last completed NCCL work: 3749.This is most likely caused by incorrect usages of collectives, e.g., wrong sizes used across ranks, the order of collectives is not same for all ranks or the scheduled collective, for some reason, didn't run. Additionally, this can be caused by GIL deadlock or other reasons such as network errors or bugs in the communications library (e.g. NCCL), etc.
[rank1]:[E801 01:01:39.255294610 ProcessGroupNCCL.cpp:1628] [PG ID 0 PG GUID 0(default_pg) Rank 1] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1, only active collectives: 0
[rank1]:[E801 01:02:40.569782119 ProcessGroupNCCL.cpp:750] [Rank 1] Some NCCL operations have failed or timed out. Due to the asynchronous nature of CUDA kernels, subsequent GPU operations might run on corrupted/incomplete data.
[rank1]:[E801 01:02:40.569994989 ProcessGroupNCCL.cpp:764] [Rank 1] To avoid data inconsistency, we are taking the entire process down.
[rank1]:[E801 01:02:40.571318176 ProcessGroupNCCL.cpp:2119] [PG ID 0 PG GUID 0(default_pg) Rank 1] Process group watchdog thread terminated with exception: [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3750, OpType=ALLTOALL_BASE, NumelIn=201222144, NumelOut=201222144, Timeout(ms)=3600000) ran for 3600041 milliseconds before timing out.
Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:692 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x738bc797205d in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x2a7 (0x738af353fd87 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x17b1 (0x738af35451a1 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0x157 (0x738af3546597 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #4: <unknown function> + 0xecdb4 (0x738c0c376db4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #5: <unknown function> + 0x9caa4 (0x738c0ee54aa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #6: <unknown function> + 0x129c6c (0x738c0eee1c6c in /lib/x86_64-linux-gnu/libc.so.6)

terminate called after throwing an instance of 'c10::DistBackendError'
  what():  [PG ID 0 PG GUID 0(default_pg) Rank 1] Process group watchdog thread terminated with exception: [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3750, OpType=ALLTOALL_BASE, NumelIn=201222144, NumelOut=201222144, Timeout(ms)=3600000) ran for 3600041 milliseconds before timing out.
Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:692 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x738bc797205d in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x2a7 (0x738af353fd87 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x17b1 (0x738af35451a1 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0x157 (0x738af3546597 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #4: <unknown function> + 0xecdb4 (0x738c0c376db4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #5: <unknown function> + 0x9caa4 (0x738c0ee54aa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #6: <unknown function> + 0x129c6c (0x738c0eee1c6c in /lib/x86_64-linux-gnu/libc.so.6)

Exception raised from run at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:2125 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x738bc797205d in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x9b5d75 (0x738af2da6d75 in /home/daniel/git/prime-rl-laguna-xs21/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: <unknown function> + 0xecdb4 (0x738c0c376db4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #3: <unknown function> + 0x9caa4 (0x738c0ee54aa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #4: <unknown function> + 0x129c6c (0x738c0eee1c6c in /lib/x86_64-linux-gnu/libc.so.6)

Note

Low Risk
Documentation-only addition of an example TOML; no runtime, library, or training code paths change.

Overview
Adds examples/advanced/laguna-xs-2.1/swe.toml, a runnable recipe for GRPO on ScaleSWE with poolside/Laguna-XS-2.1, using the bash harness and pass@1 eval on SWE-Bench Verified every 20 steps.

The config wires a 2-node trainer (Ulysses CP=4, Muon, router replay, compile + activation checkpointing/offload) to four inference replicas at DP8 with expert parallel and routed-expert return for MoE training. Orchestration uses the laguna-xs-2.1 renderer with thinking enabled, Prime sandboxes labeled laguna-xs21-swe (with Slurm pre-run cleanup), and vLLM poolside_v1 tool/reasoning parsers.

Reviewed by Cursor Bugbot for commit a5e6abf. Bugbot is set up for automated code reviews on this repo. Configure here.

@rasdani rasdani changed the title exp: add Laguna XS-2.1 SWE example add Laguna XS-2.1 SWE example Aug 4, 2026
@rasdani
rasdani marked this pull request as ready for review August 4, 2026 01:40
@rasdani
rasdani requested review from S1ro1 and mikasenghaas August 4, 2026 01:40
@rasdani
rasdani force-pushed the exp/laguna-xs21-swe-example branch from fba1792 to 8d0f43b Compare August 4, 2026 01:56

[inference.model]
max_model_len = 131072
tool_call_parser = "poolside_v1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also add this into our auto-map if not there yet


[orchestrator.train.sampling]
temperature = 1.0
max_completion_tokens = 32768

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this?

[orchestrator.train.sampling]
temperature = 1.0
max_completion_tokens = 32768
extra_body = { top_k = 20, min_p = 0.0 }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top k is not supported yet, see #2979 for pr to enable replay on trainer. should acc prob block if this is extra body to prevent corrupt training

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1886ecb. Configure here.

fused_lm_head_token_chunk_size = 1024
optim_cpu_offload = true

[trainer.model.compile]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trainer compile left enabled

High Severity

The empty [trainer.model.compile] table keeps torch.compile on (CompileConfig is the default). Disabling it requires compile = "None". This run already hit a compiled-trainer MoE collective mismatch and NCCL timeout, so leaving compile enabled is likely to reproduce that failure.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1886ecb. Configure here.

[orchestrator.train.sampling]
temperature = 1.0
max_completion_tokens = 32768
extra_body = { top_k = 20, min_p = 0.0 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Train top_k can corrupt ratios

High Severity

orchestrator.train.sampling.extra_body sets top_k = 20, which overrides the policy-rollout default of top_k = -1. Truncated train sampling without trainer kept-set / acceptance-prob replay support makes inference and trainer logprobs disagree and can silently corrupt GRPO importance ratios.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1886ecb. Configure here.

rasdani commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The full-scale compiled run reproduced the NCCL failure on Slurm job 1643 during the first real training step. Rank 13 timed out in the expert-parallel ALLTOALL_BASE after 600 seconds; rank 0 received the corresponding default-process-group dump signal.

Full NCCL all-to-all timeout trace (job 1643)

Rank 0 (stderr.log):

[rank0]:[E804 23:05:54.816499929 ProcessGroupNCCL.cpp:1849] [PG ID 0 PG GUID 0(default_pg) Rank 0] Observed flight recorder dump signal from another rank via TCPStore.
[rank0]:[E804 23:05:54.817424543 ProcessGroupNCCL.cpp:1914] [PG ID 0 PG GUID 0(default_pg) Rank 0] Received a dump signal due to a collective timeout from  rank 13 and we will try our best to dump the debug info. Last enqueued NCCL work: 1261, last completed NCCL work: 1259.This is most likely caused by incorrect usages of collectives, e.g., wrong sizes used across ranks, the order of collectives is not same for all ranks or the scheduled collective, for some reason, didn't run. Additionally, this can be caused by GIL deadlock or other reasons such as network errors or bugs in the communications library (e.g. NCCL), etc. 
[rank0]:[E804 23:05:54.818690144 ProcessGroupNCCL.cpp:1628] [PG ID 0 PG GUID 0(default_pg) Rank 0] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1, only active collectives: 0

Rank 13 (stderr.log):

[rank13]:[E804 23:05:54.516665906 ProcessGroupNCCL.cpp:689] [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=1438, OpType=ALLTOALL_BASE, NumelIn=195004416, NumelOut=195004416, Timeout(ms)=600000) ran for 600093 milliseconds before timing out.
[rank13]:[E804 23:05:54.517045067 ProcessGroupNCCL.cpp:2303] [PG ID 3 PG GUID d03ba143833c6bf31b072ffdb22f1745957fcbfb Rank 1]  failure detected by watchdog at work sequence id: 1438 PG status: last enqueued work: 1441, last completed work: 1437
[rank13]:[E804 23:05:54.518322344 ProcessGroupNCCL.cpp:733] Stack trace of the failed collective: 
#0 all_to_all_single from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/distributed/distributed_c10d.py:4829
#1 wrapper from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/distributed/c10d_logger.py:83
#2 forward from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/distributed/nn/functional.py:430
#3 apply from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/autograd/function.py:596
#4 backward from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/distributed/nn/functional.py:446
#5 apply from /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/autograd/function.py:317

[rank13]:[E804 23:05:54.518766430 ProcessGroupNCCL.cpp:2636] [PG ID 3 PG GUID d03ba143833c6bf31b072ffdb22f1745957fcbfb Rank 1] First PG on this rank to signal dumping.
[rank13]:[E804 23:05:54.822622768 ProcessGroupNCCL.cpp:1914] [PG ID 0 PG GUID 0(default_pg) Rank 13] Received a dump signal due to a collective timeout from this local rank and we will try our best to dump the debug info. Last enqueued NCCL work: 1261, last completed NCCL work: 1259.This is most likely caused by incorrect usages of collectives, e.g., wrong sizes used across ranks, the order of collectives is not same for all ranks or the scheduled collective, for some reason, didn't run. Additionally, this can be caused by GIL deadlock or other reasons such as network errors or bugs in the communications library (e.g. NCCL), etc. 
[rank13]:[E804 23:05:54.823232107 ProcessGroupNCCL.cpp:1628] [PG ID 0 PG GUID 0(default_pg) Rank 13] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1, only active collectives: 0
[rank13]:[E804 23:06:55.076739461 ProcessGroupNCCL.cpp:750] [Rank 1] Some NCCL operations have failed or timed out. Due to the asynchronous nature of CUDA kernels, subsequent GPU operations might run on corrupted/incomplete data.
[rank13]:[E804 23:06:55.076928781 ProcessGroupNCCL.cpp:764] [Rank 1] To avoid data inconsistency, we are taking the entire process down.
[rank13]:[E804 23:06:55.078015856 ProcessGroupNCCL.cpp:2119] [PG ID 3 PG GUID d03ba143833c6bf31b072ffdb22f1745957fcbfb Rank 1] Process group watchdog thread terminated with exception: [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=1438, OpType=ALLTOALL_BASE, NumelIn=195004416, NumelOut=195004416, Timeout(ms)=600000) ran for 600093 milliseconds before timing out.
Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:692 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x7e910a97205d in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x2a7 (0x7e8ff733fd87 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x17b1 (0x7e8ff73451a1 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0x157 (0x7e8ff7346597 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #4: <unknown function> + 0xecdb4 (0x7e911031ddb4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #5: <unknown function> + 0x9caa4 (0x7e9112dfbaa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #6: <unknown function> + 0x129c6c (0x7e9112e88c6c in /lib/x86_64-linux-gnu/libc.so.6)

terminate called after throwing an instance of 'c10::DistBackendError'
  what():  [PG ID 3 PG GUID d03ba143833c6bf31b072ffdb22f1745957fcbfb Rank 1] Process group watchdog thread terminated with exception: [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=1438, OpType=ALLTOALL_BASE, NumelIn=195004416, NumelOut=195004416, Timeout(ms)=600000) ran for 600093 milliseconds before timing out.
Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:692 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x7e910a97205d in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x2a7 (0x7e8ff733fd87 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x17b1 (0x7e8ff73451a1 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0x157 (0x7e8ff7346597 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #4: <unknown function> + 0xecdb4 (0x7e911031ddb4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #5: <unknown function> + 0x9caa4 (0x7e9112dfbaa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #6: <unknown function> + 0x129c6c (0x7e9112e88c6c in /lib/x86_64-linux-gnu/libc.so.6)

Exception raised from run at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:2125 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x9d (0x7e910a97205d in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x9b5d75 (0x7e8ff6ba6d75 in /home/daniel/git/prime-rl-laguna-upstream/.venv/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so)
frame #2: <unknown function> + 0xecdb4 (0x7e911031ddb4 in /lib/x86_64-linux-gnu/libstdc++.so.6)
frame #3: <unknown function> + 0x9caa4 (0x7e9112dfbaa4 in /lib/x86_64-linux-gnu/libc.so.6)
frame #4: <unknown function> + 0x129c6c (0x7e9112e88c6c in /lib/x86_64-linux-gnu/libc.so.6)

rasdani pushed a commit that referenced this pull request Aug 5, 2026
…L deadlock

When torch.compile is used with Ulysses context parallelism and FSDP,
the all-to-all collectives are traced into the compiled backward graph
while FSDP's reduce-scatter hooks fire eagerly via the autograd engine.
The compiler may reorder the all-to-all backward differently across
ranks, causing rank 0 to wait on reduce_scatter while rank 1 waits on
all_to_all — a classic collective ordering mismatch that deadlocks NCCL
after the 1-hour watchdog timeout (PR #3186, job 1578).

Wrapping _all_to_all_seq_to_head and _all_to_all_head_to_seq with
torch._dynamo.disable forces a graph break around the collectives so
they execute eagerly in the autograd engine, restoring a single
consistent backward ordering between the two collective systems.
samsja added a commit that referenced this pull request Aug 6, 2026
…L deadlock (#3195)

When torch.compile is used with Ulysses context parallelism and FSDP,
the all-to-all collectives are traced into the compiled backward graph
while FSDP's reduce-scatter hooks fire eagerly via the autograd engine.
The compiler may reorder the all-to-all backward differently across
ranks, causing rank 0 to wait on reduce_scatter while rank 1 waits on
all_to_all — a classic collective ordering mismatch that deadlocks NCCL
after the 1-hour watchdog timeout (PR #3186, job 1578).

Wrapping _all_to_all_seq_to_head and _all_to_all_head_to_seq with
torch._dynamo.disable forces a graph break around the collectives so
they execute eagerly in the autograd engine, restoring a single
consistent backward ordering between the two collective systems.
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.

2 participants