verl icon indicating copy to clipboard operation
verl copied to clipboard

CUDA Illegal Memory Access during get_actor_weights_info() in OneStepOffRayTrainer with Distributed Setup

Open none0663 opened this issue 1 year ago • 4 comments

When using OneStepOffRayTrainer with 2 H20 nodes, where the training node is configured with 1 node and 8 GPUs, and rollout is also set similarly,

trainer.n_gpus_per_node=8 \
trainer.nnodes=1 \
trainer.save_freq=300 \
rollout.nnodes=1 \
rollout.n_gpus_per_node=8

I encounter the following error during initialization of workers:

recipe/one_step_off_policy/ray_trainer.py", line 273, in init_workers                
    weights_info = self.actor_wg.get_actor_weights_info()[0]                                                                                                                                                   
  File "verl/verl/single_controller/ray/base.py", line 50, in __call__                                                                                                                                   
    output = ray.get(output)                                                                                                                                                                                   
ray.exceptions.RayTaskError(RuntimeError): ray::WorkerDict.actor_get_actor_weights_info() (pid=1367993, ip=xxxx, actor_id=9a57364463cf6c6081c69bad0d000000, repr=<verl.single_controller.ray.base.Wor
kerDict object at 0x7faeef87a9b0>)                                                                                                                                                                             
  File "/verl/verl/single_controller/ray/base.py", line 720, in func                                                                                                                                      
    return getattr(self.worker_dict[key], name)(*args, **kwargs)                                                                                                                                               
  File "/verl/verl/single_controller/base/decorator.py", line 514, in inner                                                                                                                               
    return func(*args, **kwargs)                                                                                                                                                                               
  File "/tmp/ray/session_2025-07-28_11-50-39_457167_1220198/runtime_resources/working_dir_files/_ray_pkg_354c1ed8560ae922/recipe/one_step_off_policy/megatron_workers.py", line 102, in get_actor_weights_info 
    for key, tensor in params_generator:                                                                                                                                                                       
  File "/verl/verl/utils/megatron_utils.py", line 872, in per_tensor_generator                                                                                                                            
    infer_params = default_tp_concat_fn(                                                                                                                                                                       
  File "/verl/verl/utils/megatron_utils.py", line 741, in default_tp_concat_fn                                                                                                                            
    infer_params = torch.cat(infer_params, dim=tp_utils.get_tensor_parallel_partition_dim(train_params))                                                                                                       
RuntimeError: CUDA error: an illegal memory access was encountered                                                                                                                                             
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.                                                                                        
For debugging consider passing CUDA_LAUNCH_BLOCKING=1                                                                                                                                                          
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

However, when I use the colocate model configuration, this error does not occur.

Is there any bug with

infer_params = torch.cat(infer_params, dim=tp_utils.get_tensor_parallel_partition_dim(train_params))                                                                              
(TaskRunner pid=1371652) RuntimeError: CUDA error: an illegal memory access was encountered 

model info

qwq 32B with 
actor_rollout_ref.rollout.tensor_model_parallel_size=8 \
algorithm.use_kl_in_reward=False \
actor_rollout_ref.actor.megatron.pipeline_model_parallel_size=1 \
actor_rollout_ref.ref.megatron.pipeline_model_parallel_size=1 \
actor_rollout_ref.actor.megatron.tensor_model_parallel_size=8 \
actor_rollout_ref.ref.megatron.tensor_model_parallel_size=8 \

verl version and lastest commit info

commit c9ccbd5c4b5638ace446a2bd732b572e4d212798 (HEAD -> main, origin/main, origin/HEAD)
Author: Chi Zhang <[email protected]>
Date:   Mon Jul 28 10:03:28 2025 +0800```

none0663 avatar Jul 28 '25 12:07 none0663

Also meet the same error when runing the script dapo_7b_math_megatron_colocate.sh

none0663 avatar Jul 29 '25 04:07 none0663

Try

actor_rollout_ref.actor.megatron.param_offload=False

pia7a avatar Aug 28 '25 03:08 pia7a

@none0663 If you only have one node with 8 GPUs, here is a feasible configuration.

trainer.n_gpus_per_node=4
trainer.nnodes=1
trainer.save_freq=300
rollout.nnodes=1
rollout.n_gpus_per_node=4

ArronHZG avatar Oct 17 '25 12:10 ArronHZG

定时清理检查结论:按社区 issue 定时处理规则关闭此 issue。

证据:最近一次非当前运行账号的公开回复或引用是 2025-10-17T12:51:42Z(actor: none0663, kind: mentioned),早于本轮 6 个月阈值 2026-01-13T01:10:17.218155+00:00。 检查来源:https://github.com/verl-project/verl/issues/2779,comments API https://api.github.com/repos/verl-project/verl/issues/2779/comments,timeline API https://api.github.com/repos/verl-project/verl/issues/2779/timeline。

如果作者或社区成员仍能提供新的复现、证据或需求背景,请在这里重新评论请求维护者重开,或创建新的 issue 并链接到本 issue。

Scheduled cleanup conclusion: this issue is being closed under the community issue processing policy.

Evidence: The latest public reply or reference from an account other than the current automation account was 2025-10-17T12:51:42Z (actor: none0663, kind: mentioned), which is older than the six-month threshold for this run (2026-01-13T01:10:17.218155+00:00). Sources checked: https://github.com/verl-project/verl/issues/2779, comments API https://api.github.com/repos/verl-project/verl/issues/2779/comments, timeline API https://api.github.com/repos/verl-project/verl/issues/2779/timeline.

If the author or community can still provide a fresh reproduction, evidence, or requirement context, please comment here to ask maintainers to reopen it, or open a new issue and link back to this one.

This response was generated by a scheduled Codex GPT5.5 issue processing task.

Kirrito-k423 avatar Jul 13 '26 01:07 Kirrito-k423