verl icon indicating copy to clipboard operation
verl copied to clipboard

NCCL timeout during compute_log_prob crashing runs arbitrarily

Open sheikhshafayat opened this issue 8 months ago • 8 comments

Hi,

I’m encountering a consistent failure during PPO training in Verl, specifically at:

old_log_prob = self.actor_rollout_wg.compute_log_prob(batch)

The error happens at random times, in a different step in different run. But so far I couldn't get any run going more than 8 hours. In this particular run it crashed after 71 steps.

In this particular run I was using lmsys/gpt-oss-20b-bf16 model, but I have faced the same with Qwen/Qwen3-4B-Instruct-2507 model as well.

This is the command I was running:

export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export TOKENIZERS_PARALLELISM=false
export VLLM_WORKER_MULTIPROC_METHOD=spawn

# core hyperparams
FULL_BATCH_SIZE=16
PPO_MINI_BATCH_SIZE=16
PER_GPU_MINI_BATCH_SIZE=2
TRAIN_N=16
VAL_N=1
MAX_PROMPT_LENGTH=2100
MAX_RESPONSE_LENGTH=8192
LEARNING_RATE=1e-6
KL_COEFF=0.001

# hardware
N_GPUS_PER_NODE=4
NNODES=1

# model
MODEL_PATH=lmsys/gpt-oss-20b-bf16

python3 -m verl.trainer.main_ppo \
  algorithm.adv_estimator=grpo \
  data.train_files=<train.parquet> \ # my custom dataset, nothing special here
  data.val_files=<val.parquet> \
  data.train_batch_size=$FULL_BATCH_SIZE \
  data.max_prompt_length=$MAX_PROMPT_LENGTH \
  data.max_response_length=$MAX_RESPONSE_LENGTH \
  data.filter_overlong_prompts=True \
  data.truncation=error \
  actor_rollout_ref.model.path=$MODEL_PATH \
  actor_rollout_ref.actor.optim.lr=$LEARNING_RATE \
  actor_rollout_ref.model.use_remove_padding=True \
  actor_rollout_ref.model.enable_gradient_checkpointing=True \
  actor_rollout_ref.actor.ppo_mini_batch_size=$PPO_MINI_BATCH_SIZE \
  actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=$PER_GPU_MINI_BATCH_SIZE \
  actor_rollout_ref.actor.use_dynamic_bsz=True \
  actor_rollout_ref.actor.use_kl_loss=False \
  actor_rollout_ref.actor.fsdp_config.param_offload=False \
  actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \
  actor_rollout_ref.actor.fsdp_config.model_dtype=bf16 \
  actor_rollout_ref.ref.fsdp_config.model_dtype=bf16 \
  actor_rollout_ref.rollout.name=sglang \
  actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
  actor_rollout_ref.rollout.gpu_memory_utilization=0.6 \
  actor_rollout_ref.rollout.n=$TRAIN_N \
  actor_rollout_ref.rollout.val_kwargs.n=$VAL_N \
  actor_rollout_ref.rollout.val_kwargs.do_sample=True \
  actor_rollout_ref.rollout.val_kwargs.temperature=1.0 \
  actor_rollout_ref.rollout.val_kwargs.top_p=1.0 \
  actor_rollout_ref.rollout.val_kwargs.top_k=-1 \
  actor_rollout_ref.rollout.dtype=bfloat16 \
  +actor_rollout_ref.rollout.max_model_len=16000 \
  actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=$PER_GPU_MINI_BATCH_SIZE \
  actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=$PER_GPU_MINI_BATCH_SIZE \
  actor_rollout_ref.ref.fsdp_config.param_offload=False \
  algorithm.use_kl_in_reward=True \
  algorithm.kl_penalty=low_var_kl \
  algorithm.kl_ctrl.kl_coef=$KL_COEFF \
  ray_kwargs.ray_init.num_cpus=$((N_GPUS_PER_NODE * 12)) \
  trainer.n_gpus_per_node=$N_GPUS_PER_NODE \
  trainer.nnodes=$NNODES \
  trainer.total_epochs=1 \
  trainer.save_freq=-1 \
  trainer.test_freq=20 \
  trainer.val_before_train=True

The stack trace looks like this:

Traceback (most recent call last):
  File "/workspace/verl/verl/trainer/main_ppo.py", line 45, in main
    run_ppo(config)
  File "/workspace/verl/verl/trainer/main_ppo.py", line 99, in run_ppo
    ray.get(runner.run.remote(config))
  File "/usr/local/lib/python3.12/dist-packages/ray/_private/auto_init_hook.py", line 22, in auto_init_wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/ray/_private/client_mode_hook.py", line 104, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/ray/_private/worker.py", line 2961, in get
    values, debugger_breakpoint = worker.get_objects(
                                  ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/ray/_private/worker.py", line 1026, in get_objects
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(ActorDiedError): ray::TaskRunner.run() (pid=4030, ip=10.0.2.100, actor_id=3c87465a346071ce4fca78a401000000, repr=<main_ppo.TaskRunner object at 0x7123673b92b0>)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/verl/verl/trainer/main_ppo.py", line 359, in run
    trainer.fit()
  File "/workspace/verl/verl/trainer/ppo/ray_trainer.py", line 1396, in fit
    old_log_prob, old_log_prob_mfu = self._compute_old_log_prob(batch)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/verl/verl/trainer/ppo/ray_trainer.py", line 1151, in _compute_old_log_prob
    old_log_prob = self.actor_rollout_wg.compute_log_prob(batch)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/verl/verl/single_controller/ray/base.py", line 55, in __call__
    output = ray.get(output)
             ^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^
                                  ^^^^^^^^^^^^^^^^^^^
ray.exceptions.ActorDiedError: The actor died unexpectedly before finishing this task.
	class_name: create_colocated_worker_cls.<locals>.WorkerDict
	actor_id: 3d603d9cf74211ae8450a62901000000
	pid: 7594
	name: U9vHRYWorkerDict_0:3
	namespace: 683f2801-5a12-483e-87e3-167f009aacfe
	ip: 10.0.2.100
The actor is dead because its worker process has died. Worker exit type: SYSTEM_ERROR Worker exit detail: Worker unexpectedly exits with a connection error code 2. End of file. There are some potential root causes. (1) The process is killed by SIGKILL by OOM killer due to high memory usage. (2) ray stop --force is called. (3) The worker is crashed unexpectedly due to SIGSEGV or other unexpected errors.

Above this, there is the following:

Training Progress:  13%|█▎        | 71/562 [8:33:48<57:46:26, 423.60s/it]
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.371750182 ProcessGroupNCCL.cpp:685] [Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=310463, OpType=_ALLGATHER_BASE, NumelIn=205796744, NumelOut=823186976, Timeout(ms)=600000) ran for 600021 milliseconds before timing out.
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.371904222 ProcessGroupNCCL.cpp:2252] [PG ID 0 PG GUID 0(default_pg) Rank 0]  failure detected by watchdog at work sequence id: 310463 PG status: last enqueued work: 310463, last completed work: 310462
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.371917042 ProcessGroupNCCL.cpp:732] Stack trace of the failed collective not found, potentially because FlightRecorder is disabled. You can enable it by setting TORCH_NCCL_TRACE_BUFFER_SIZE to a non-zero value.
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.371950532 ProcessGroupNCCL.cpp:2584] [PG ID 0 PG GUID 0(default_pg) Rank 0] First PG on this rank to signal dumping.
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.393476459 ProcessGroupNCCL.cpp:1870] [PG ID 0 PG GUID 0(default_pg) Rank 0] 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: 310463, last completed NCCL work: 310462.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. 
(WorkerDict pid=7591) [rank0]:[E325 04:12:11.393794695 ProcessGroupNCCL.cpp:1589] [PG ID 0 PG GUID 0(default_pg) Rank 0] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1
(WorkerDict pid=7592) [rank1]:[E325 04:12:11.213659395 ProcessGroupNCCL.cpp:1806] [PG ID 0 PG GUID 0(default_pg) Rank 1] Observed flight recorder dump signal from another rank via TCPStore.
(WorkerDict pid=7592) [rank1]:[E325 04:12:11.213814527 ProcessGroupNCCL.cpp:1870] [PG ID 0 PG GUID 0(default_pg) Rank 1] 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: 310462, last completed NCCL work: 310462.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. 
(WorkerDict pid=7591) [rank0]:[E325 04:13:11.372066194 ProcessGroupNCCL.cpp:746] [Rank 0] 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.
(WorkerDict pid=7591) [rank0]:[E325 04:13:11.372179233 ProcessGroupNCCL.cpp:760] [Rank 0] To avoid data inconsistency, we are taking the entire process down.
(WorkerDict pid=7591) [rank0]:[E325 04:13:11.373519468 ProcessGroupNCCL.cpp:2068] [PG ID 0 PG GUID 0(default_pg) Rank 0] Process group watchdog thread terminated with exception: [Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=310463, OpType=_ALLGATHER_BASE, NumelIn=205796744, NumelOut=823186976, Timeout(ms)=600000) ran for 600021 milliseconds before timing out.
(WorkerDict pid=7591) Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:688 (most recent call first):
(WorkerDict pid=7591) frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x80 (0x7f71fc777eb0 in /usr/local/lib/python3.12/dist-packages/torch/lib/libc10.so)
(WorkerDict pid=7591) frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x247 (0x7f6ec9b1ebc7 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x1591 (0x7f6ec9b225e1 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0xd2 (0x7f6ec9b23942 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #4: <unknown function> + 0xdc253 (0x7f7262087253 in /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
(WorkerDict pid=7591) frame #5: <unknown function> + 0x94ac3 (0x7f726472eac3 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591) frame #6: <unknown function> + 0x1268c0 (0x7f72647c08c0 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591) 
(WorkerDict pid=7591) [2026-03-25 04:13:11,115 E 7591 7880] logging.cc:118: Unhandled exception: N3c1016DistBackendErrorE. what(): [PG ID 0 PG GUID 0(default_pg) Rank 0] Process group watchdog thread terminated with exception: [Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=310463, OpType=_ALLGATHER_BASE, NumelIn=205796744, NumelOut=823186976, Timeout(ms)=600000) ran for 600021 milliseconds before timing out.
(WorkerDict pid=7591) Exception raised from checkTimeout at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:688 (most recent call first):
(WorkerDict pid=7591) frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x80 (0x7f71fc777eb0 in /usr/local/lib/python3.12/dist-packages/torch/lib/libc10.so)
(WorkerDict pid=7591) frame #1: c10d::ProcessGroupNCCL::WorkNCCL::checkTimeout(std::optional<std::chrono::duration<long, std::ratio<1l, 1000l> > >) + 0x247 (0x7f6ec9b1ebc7 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #2: c10d::ProcessGroupNCCL::Watchdog::runLoop() + 0x1591 (0x7f6ec9b225e1 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #3: c10d::ProcessGroupNCCL::Watchdog::run() + 0xd2 (0x7f6ec9b23942 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #4: <unknown function> + 0xdc253 (0x7f7262087253 in /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
(WorkerDict pid=7591) frame #5: <unknown function> + 0x94ac3 (0x7f726472eac3 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591) frame #6: <unknown function> + 0x1268c0 (0x7f72647c08c0 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591) 
(WorkerDict pid=7591) Exception raised from run at /pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:2074 (most recent call first):
(WorkerDict pid=7591) frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x80 (0x7f71fc777eb0 in /usr/local/lib/python3.12/dist-packages/torch/lib/libc10.so)
(WorkerDict pid=7591) frame #1: <unknown function> + 0xe4ec21 (0x7f6ec9afac21 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #2: <unknown function> + 0x945664 (0x7f6ec95f1664 in /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so)
(WorkerDict pid=7591) frame #3: <unknown function> + 0xdc253 (0x7f7262087253 in /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
(WorkerDict pid=7591) frame #4: <unknown function> + 0x94ac3 (0x7f726472eac3 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591) frame #5: <unknown function> + 0x1268c0 (0x7f72647c08c0 in /usr/lib/x86_64-linux-gnu/libc.so.6)
(WorkerDict pid=7591)  /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x15fd74a) [0x7f72637de74a] ray::operator<<()
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x15fe1fc) [0x7f72637df1fc] ray::RayLog::operator<< <>()
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x7f1389) [0x7f72629d2389] ray::TerminateHandler()
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x7f726205920c]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x7f7262059277]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x7f72620591fe]
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x7f6ec95f16e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f7262087253]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f726472eac3]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x7f72647c08c0]
(WorkerDict pid=7591) 
(WorkerDict pid=7591) [2026-03-25 04:13:11,118 E 7591 7880] logging.cc:125: Stack trace: 
(WorkerDict pid=7591)  /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x15fd74a) [0x7f72637de74a] ray::operator<<()
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x15fe1fc) [0x7f72637df1fc] ray::RayLog::operator<< <>()
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/ray/_raylet.so(+0x16007b8) [0x7f72637e17b8] ray::TerminateHandler()
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x7f726205920c]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x7f7262059277]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x7f72620591fe]
(WorkerDict pid=7591) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x7f6ec95f16e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f7262087253]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f726472eac3]
(WorkerDict pid=7591) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x7f72647c08c0]
(WorkerDict pid=7591) 
(WorkerDict pid=7591) *** SIGABRT received at time=1774411991 on cpu 130 ***
(WorkerDict pid=7591) PC: @     0x7f72647309fc  (unknown)  pthread_kill
(WorkerDict pid=7591)     @     0x7f72646dc520  (unknown)  (unknown)
(WorkerDict pid=7591) [2026-03-25 04:13:11,118 E 7591 7880] logging.cc:474: *** SIGABRT received at time=1774411991 on cpu 130 ***
(WorkerDict pid=7591) [2026-03-25 04:13:11,118 E 7591 7880] logging.cc:474: PC: @     0x7f72647309fc  (unknown)  pthread_kill
(WorkerDict pid=7591) [2026-03-25 04:13:11,118 E 7591 7880] logging.cc:474:     @     0x7f72646dc520  (unknown)  (unknown)
(WorkerDict pid=7591) Fatal Python error: Aborted
(WorkerDict pid=7591) 
(WorkerDict pid=7591) 
(WorkerDict pid=7591) Extension modules: msgpack._cmsgpack, psutil._psutil_linux, google._upb._message, charset_normalizer.md, requests.packages.charset_normalizer.md, requests.packages.chardet.md, yaml._yaml, uvloop.loop, ray._raylet, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, torch._C, torch._C._dynamo.autograd_compiler, torch._C._dynamo.eval_frame, torch._C._dynamo.guards, torch._C._dynamo.utils, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special, regex._regex, markupsafe._speedups, PIL._imaging, scipy._lib._ccallback_c, scipy.linalg._fblas, scipy.linalg._flapack, _cyutility, scipy._cyutility, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_schur_sqrtm, scipy.linalg._matfuncs_expm, scipy.linalg._linalg_pythran, scipy.linalg.cython_blas, scipy.linalg._decomp_update, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.linalg._propack._spropack, scipy.sparse.linalg._propack._dpropack, scipy.sparse.linalg._propack._cpropack, scipy.sparse.linalg._propack._zpropack, scipy.optimize._group_columns, scipy._lib.messagestream, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._slsqplib, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy._lib._uarray._uarray, scipy.special._ufuncs_cxx, scipy.special._ellip_harm_2, scipy.special._special_ufuncs, scipy.special._gufuncs, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.linalg._decomp_interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.spatial._ckdtree, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._hausdorff, scipy.spatial._distance_wrap, scipy.spatial.transform._rotation, scipy.spatial.transform._rigid_transform, scipy.optimize._direct, PIL._imagingft, av._core, av.logging, av.bytesource, av.buffer, av.audio.format, av.error, av.dictionary, av.container.pyio, av.option, av.descriptor, av.format, av.utils, av.stream, av.container.streams, av.sidedata.motionvectors, av.sidedata.sidedata, av.opaque, av.packet, av.container.input, av.container.output, av.container.core, av.codec.context, av.video.format, av.video.reformatter, av.plane, av.video.plane, av.video.frame, av.video.stream, av.codec.hwaccel, av.codec.codec, av.frame, av.audio.layout, av.audio.plane, av.audio.frame, av.audio.stream, av.filter.link, av.filter.context, av.filter.graph, av.filter.filter, av.filter.loudnorm, av.audio.resampler, av.audio.codeccontext, av.audio.fifo, av.bitstream, av.video.codeccontext, _cffi_backend, pyarrow.lib, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pyarrow._compute, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing, pyarrow._parquet, pyarrow._fs, pyarrow._azurefs, pyarrow._hdfs, pyarrow._gcsfs, pyarrow._s3fs, multidict._multidict, yarl._quoting_c, propcache._helpers_c, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket.mask, aiohttp._websocket.reader_c, frozenlist._frozenlist, xxhash._xxhash, pyarrow._acero, pyarrow._csv, pyarrow._json, pyarrow._substrait, pyarrow._dataset, pyarrow._dataset_orc, pyarrow._parquet_encryption, pyarrow._dataset_parquet_encryption, pyarrow._dataset_parquet, nvtx._lib.lib, nvtx._lib.profiler, pybase64._pybase64, zmq.backend.cython._zmq, setproctitle._setproctitle, sentencepiece._sentencepiece, msgspec._core, core, tvm_ffi.core, cuda_utils, __triton_launcher (total: 212)
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.371819906 ProcessGroupNCCL.cpp:685] [Rank 3] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=310463, OpType=_ALLGATHER_BASE, NumelIn=205796744, NumelOut=823186976, Timeout(ms)=600000) ran for 600021 milliseconds before timing out. [repeated 2x across cluster]
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.372426754 ProcessGroupNCCL.cpp:2252] [PG ID 0 PG GUID 0(default_pg) Rank 3]  failure detected by watchdog at work sequence id: 310463 PG status: last enqueued work: 310463, last completed work: 310462 [repeated 2x across cluster]
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.372447555 ProcessGroupNCCL.cpp:732] Stack trace of the failed collective not found, potentially because FlightRecorder is disabled. You can enable it by setting TORCH_NCCL_TRACE_BUFFER_SIZE to a non-zero value. [repeated 2x across cluster]
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.372477169 ProcessGroupNCCL.cpp:2584] [PG ID 0 PG GUID 0(default_pg) Rank 3] First PG on this rank to signal dumping. [repeated 2x across cluster]
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.213594618 ProcessGroupNCCL.cpp:1870] [PG ID 0 PG GUID 0(default_pg) Rank 3] 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: 310463, last completed NCCL work: 310462.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.  [repeated 2x across cluster]
(WorkerDict pid=7594) [rank3]:[E325 04:12:11.213803771 ProcessGroupNCCL.cpp:1589] [PG ID 0 PG GUID 0(default_pg) Rank 3] ProcessGroupNCCL preparing to dump debug info. Include stack trace: 1 [repeated 3x across cluster]
(WorkerDict pid=7593) 
(WorkerDict pid=7593) 
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x7095eed8f20c]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x7095eed8f277]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x7095eed8f1fe]
(WorkerDict pid=7593) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x7092555f16e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7095eedbd253]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7095f1464ac3]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x7095f14f68c0]
(WorkerDict pid=7593) 
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x7095eed8f20c]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x7095eed8f277]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x7095eed8f1fe]
(WorkerDict pid=7593) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x7092555f16e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7095eedbd253]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7095f1464ac3]
(WorkerDict pid=7593) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x7095f14f68c0]
(WorkerDict pid=7593) 
(WorkerDict pid=7593) 
(WorkerDict pid=7593) 
(WorkerDict pid=7594) 
(WorkerDict pid=7594) 
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x79418b4e820c]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x79418b4e8277]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x79418b4e81fe]
(WorkerDict pid=7594) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x793df22de6e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x79418b516253]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x79418dabdac3]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x79418db4f8c0]
(WorkerDict pid=7594) 
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c) [0x79418b4e820c]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277) [0x79418b4e8277]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xae1fe) [0x79418b4e81fe]
(WorkerDict pid=7594) /usr/local/lib/python3.12/dist-packages/torch/lib/libtorch_cuda.so(+0x9456e8) [0x793df22de6e8] c10d::ProcessGroupNCCL::Watchdog::run()
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x79418b516253]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x79418dabdac3]
(WorkerDict pid=7594) /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1268c0) [0x79418db4f8c0]
(WorkerDict pid=7594) 
(WorkerDict pid=7594) 
(WorkerDict pid=7594) 

My system specification is as follows:

----------Python Info----------
Version      : 3.12.12
Compiler     : GCC 11.4.0
Build        : ('main', 'Oct 10 2025 08:52:57')
Arch         : ('64bit', 'ELF')
------------Pip Info-----------
Version      : 25.3
Directory    : /usr/local/lib/python3.12/dist-packages/pip
vllm         : not found.
sglang       : 0.5.5
ray          : 2.51.1
torch        : 2.8.0+cu129
----------verl Info-----------
Version      : 0.8.0.dev
Directory    : /workspace/verl/verl
Commit Hash  : d9d94b4da93fbacc06bb546629171c67c0a674aa
----------Platform Info----------
Platform     : Linux-6.18.7.1.amd64-smp-x86_64-with-glibc2.35
system       : Linux
node         : <redacted>
release      : 6.18.7.1.amd64-smp
version      : #1 SMP PREEMPT_DYNAMIC Wed Jan 28 14:07:53 CET 2026
----------Environment----------
CUDA Runtime : 12.9
CUDA Compiler : Cuda compilation tools, release 12.9, V12.9.86
----------System Info----------
CPU Memory      : 1007.34 GB
GPU Count       : 2 # I asked for four GPUs when I was running this run; but to get this system config, I got two gpus in interactive mode in slurm. GPU count is not the issue here.
GPU 1   Type    : NVIDIA H100 PCIe
GPU 1   Memory  : 79.65 GB
GPU 2   Type    : NVIDIA H100 PCIe
GPU 2   Memory  : 79.65 GB

I am using the verlai/verl:sgl055.latest docker container. But this happens with vllm as well.

I had faced the same in several other slurm machines as well other than this particular machine, so I don't think this is about GPU.

Any help related to this will be very much appreciated 🙏

sheikhshafayat avatar Mar 25 '26 09:03 sheikhshafayat

Thank you for the detailed bug report. The NCCL timeout during _ALLGATHER_BASE operation is a common distributed training issue with several potential causes.

Root Cause Analysis:

The error WorkNCCL ran for 600021 milliseconds before timing out indicates a 10-minute NCCL operation timeout. This typically happens when:

  1. GIL Deadlock: Python's Global Interpreter Lock can block NCCL operations if a long-running Python operation holds the GIL while another rank is waiting for NCCL communication.

  2. Asymmetric Collective Operations: The error message mentions "wrong sizes used across ranks, the order of collectives is not same for all ranks" - this can happen if different ranks take different code paths.

  3. SGLang Rollout Blocking: The issue occurs during compute_log_prob which interacts with SGLang rollout. SGLang's async operations can sometimes block the main process.

Suggested Workarounds:

  1. Increase NCCL timeout (temporary mitigation):

    export NCCL_TIMEOUT=1800  # 30 minutes
    export NCCL_BLOCKING_WAIT=1
    
  2. Enable NCCL debugging:

    export NCCL_DEBUG=INFO
    export NCCL_DEBUG_SUBSYS=ALL
    export TORCH_NCCL_TRACE_BUFFER_SIZE=1000000
    
  3. Try with vLLM backend to isolate if this is SGLang-specific:

    actor_rollout_ref.rollout.name=vllm
    
  4. Reduce TP size to 1 if possible, to minimize cross-GPU communication:

    actor_rollout_ref.rollout.tensor_model_parallel_size=1
    
  5. Check for GIL-blocking operations in your data pipeline or reward function that might cause rank desynchronization.

Related Issues:

  • This might be related to #5663 (TP communication overlap issues)
  • Similar to #5597 (SGLang actor death during initialization)

Could you try:

  1. Running with vLLM backend to see if the issue persists
  2. Reducing max_model_len from 16000 to 8192 to reduce communication volume
  3. Setting actor_rollout_ref.actor.use_dynamic_bsz=False to simplify batching

This will help determine if the issue is SGLang-specific or a broader NCCL configuration problem.

Kirrito-k423 avatar Mar 25 '26 11:03 Kirrito-k423

@sheikhshafayat It may be a bug in legacy fsdp worker https://github.com/verl-project/verl/pull/5747

wuxibin89 avatar Mar 25 '26 12:03 wuxibin89

Hi @Kirrito-k423, I have faced this with vllm as well. The behavior was identical.

Right now, I am experimenting with actor_rollout_ref.actor.use_dynamic_bsz=False and trying to see if the bug reproduces. It often takes 6-7 hours of training before it crashes. I will let you know if it works now.

sheikhshafayat avatar Mar 25 '26 16:03 sheikhshafayat

Hi @Kirrito-k423, I have faced this with vllm as well. The behavior was identical.

Right now, I am experimenting with actor_rollout_ref.actor.use_dynamic_bsz=False and trying to see if the bug reproduces. It often takes 6-7 hours of training before it crashes. I will let you know if it works now.

when running multi-turn rollout it Appears immediately when starting the program

zhaichenhao1889 avatar Mar 26 '26 06:03 zhaichenhao1889

@sheikhshafayat Fixed in https://github.com/verl-project/verl/pull/5591

wuxibin89 avatar Mar 26 '26 08:03 wuxibin89

@sheikhshafayat Fixed in #5591

I tried it, but it seems doesn't work.

zhaichenhao1889 avatar Mar 26 '26 09:03 zhaichenhao1889

Hi @wuxibin89, with actor_rollout_ref.actor.use_dynamic_bsz=False I could get a run going on for 18 hours now without crashing (the longest so far), and I believe the bug was indeed coming from FSDP workers.

sheikhshafayat avatar Mar 26 '26 09:03 sheikhshafayat

l also met this issue when using the megatron backend, with actor_rollout_ref.actor.use_dynamic_bsz=True. l used verl==0.7.0.

fiberleif avatar Apr 09 '26 23:04 fiberleif