verl icon indicating copy to clipboard operation
verl copied to clipboard

Running `run_qwen3moe-30b_megatron_96gb.sh` on verl via provided docker image yields bug

Open BaiqingL opened this issue 1 year ago • 10 comments

System Info

Verl: Main branch at commit 1c99f4727ed184937e87c5b363ae69c0e79b8049, installed via pip install -e .

Hardware: 8XB200

Docker image: Built from docker/Dockerfile.stable.vllm

Sharing reproduction steps below, first sharing the error when running the example scripts

Traceback (most recent call last):
  File "/workfiles/verl/verl/trainer/main_ppo.py", line 42, in main
    run_ppo(config)
  File "/workfiles/verl/verl/trainer/main_ppo.py", line 96, 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 2882, in get
    values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/ray/_private/worker.py", line 968, in get_objects
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AcceleratorError): ray::TaskRunner.run() (pid=13379, ip=10.19.90.45, actor_id=4f5b6de2141318007e45b5d601000000, repr=<main_ppo.TaskRunner object at 0x78939993f530>)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/trainer/main_ppo.py", line 338, in run
    trainer.init_workers()
  File "/workfiles/verl/verl/trainer/ppo/ray_trainer.py", line 766, in init_workers
    self.actor_rollout_wg.init_model()
  File "/workfiles/verl/verl/single_controller/ray/base.py", line 48, in __call__
    output = ray.get(output)
             ^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ray.exceptions.RayTaskError(AcceleratorError): ray::WorkerDict.actor_rollout_init_model() (pid=14391, ip=10.19.90.45, actor_id=ec86711c2e3ef8335a6f49b201000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x79cd807c9bb0>)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
    return getattr(self.worker_dict[key], name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
    offload_megatron_model_to_cpu(self.actor_module)
  File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
    buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.AcceleratorError: CUDA error: invalid argument
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.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14389, ip=10.19.90.45, actor_id=c471d060101976cebda5778a01000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x7b673f9edee0>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14395, ip=10.19.90.45, actor_id=7d978b6bf3304cb92179fe0c01000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x7d82012ddd60>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14394, ip=10.19.90.45, actor_id=edbae2a1ab3d22973c22dc3a01000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x7624357fa060>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14393, ip=10.19.90.45, actor_id=592a8a6def7e2c5d4880423c01000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x7d50a7d75d90>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14390, ip=10.19.90.45, actor_id=809707f67715cc8cee20044f01000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x76eb7bc81820>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14396, ip=10.19.90.45, actor_id=d514040a521bde0a1ccefb3601000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x708f5dd856a0>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(TaskRunner pid=13379) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=14392, ip=10.19.90.45, actor_id=cd50a1b06c9f14b0dd580f7201000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0x7681c010dd30>)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/ray/base.py", line 700, in func
(TaskRunner pid=13379)     return getattr(self.worker_dict[key], name)(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/single_controller/base/decorator.py", line 442, in inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/transferqueue_utils.py", line 199, in dummy_inner
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/workers/megatron_workers.py", line 485, in init_model
(TaskRunner pid=13379)     offload_megatron_model_to_cpu(self.actor_module)
(TaskRunner pid=13379)   File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 120, in decorate_context
(TaskRunner pid=13379)     return func(*args, **kwargs)
(TaskRunner pid=13379)            ^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379)   File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu
(TaskRunner pid=13379)     buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory()
(TaskRunner pid=13379)                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(TaskRunner pid=13379) torch.AcceleratorError: CUDA error: invalid argument
(TaskRunner pid=13379) CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(TaskRunner pid=13379) For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(TaskRunner pid=13379) Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
(WorkerDict pid=14392) /workfiles/verl/verl/utils/megatron_utils.py:336: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage() [repeated 7x across cluster]
(WorkerDict pid=14392)   if buffer.param_data.storage().size() > 0: [repeated 7x across cluster]

Information

  • [x] The official example scripts
  • [ ] My own modified scripts

Tasks

  • [x] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [ ] My own task or dataset (give details below)

Reproduction

  1. Launched docker image via docker run -it --rm --gpus all --ipc=host --network=host -v /home/ubuntu/data:/workfiles --entrypoint /bin/bash verl (verl being the compiled docker image)
  2. Prepare required training files that examples/grpo_trainer/run_qwen3moe-30b_megatron_96gb.sh requires
  3. Log into wandb via wandb login, supply your own wandb api key
  4. Execute training file

Expected behavior

Normal training run with graphs published into a weights & biases account configured by the user

BaiqingL avatar Nov 15 '25 23:11 BaiqingL

As a follow up, turning off param offload seems to work

BaiqingL avatar Nov 16 '25 05:11 BaiqingL

But there still seems to be issues with DeepEp, applying fix from https://github.com/deepseek-ai/DeepEP/issues/224 did not seem to resolve.

BaiqingL avatar Nov 16 '25 07:11 BaiqingL

For anyone else facing the same issue, FSDP currently is functional, but obviously not ideal for MoE

BaiqingL avatar Nov 16 '25 19:11 BaiqingL

File "/workfiles/verl/verl/utils/megatron_utils.py", line 337, in offload_megatron_model_to_cpu buffer.param_data.cpu_data = buffer.param_data.data.cpu().pin_memory() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ torch.AcceleratorError: CUDA error: invalid argument

It is weird, seems like the torch version is not compatible. Can you find out which the invalid argument error is from, .cpu() or .pin_memory()?

ISEEKYAN avatar Nov 17 '25 09:11 ISEEKYAN

Seems like its from cpu, but after some investigations its more likely that an upstream process has failed, causing the pin memory action to yield an error

BaiqingL avatar Nov 28 '25 05:11 BaiqingL

Exactly the same issue. run_qwen3moe-30b-megatron_96gb.sh,officially provided verlai/verl:vllm011.latest docker, 2nodes*8a800 gpus So how to solve this problem other than compromising to fsdp?

Pangkachu avatar Dec 18 '25 06:12 Pangkachu

I also ran into a very similar issue when running on a large setup (8×8 H200 GPUs).

When I investigated this on my side, the final failure mode I could identify was an OOM. In my case, the problem disappeared after I reduced the tp_size used in SGLang rollout. I didn’t fully pin down the root cause.

Not sure if this applies to your setup, but it might be worth trying as a quick sanity check.

XChen-Zero avatar Jan 14 '26 07:01 XChen-Zero

hi @BaiqingL @Pangkachu @XChen-Zero , have you solved that issue afterwards? Does it work with some newer images?

ISEEKYAN avatar Feb 04 '26 11:02 ISEEKYAN

For what it’s worth, I managed to resolve this by lowering the TP size in sglang.

I didn’t try the latest image — just reducing TP fixed it for me. I don’t really know why this works though, and it could very well be environment-specific.

Sharing in case it helps you...

XChen-Zero avatar Feb 04 '26 16:02 XChen-Zero

Thanks for the reports and follow-ups. Based on the comments, this should not be closed as stale: the issue was explicitly reopened on 2026-02-04, and the latest non-maintainer data point says lowering the SGLang rollout TP size resolved a similar failure, although the root cause may be environment-specific.

A few actionable checks seem worth documenting here:

  1. If using SGLang rollout, try reducing actor_rollout_ref.rollout.tensor_model_parallel_size / the script's rollout TP value first. This matched XChen-Zero's workaround.
  2. If the failure is still at Megatron model CPU offload, try temporarily setting actor_rollout_ref.actor.megatron.param_offload=False / actor_rollout_ref.ref.megatron.param_offload=False to confirm whether it is the same offload path reported above.
  3. Please retest on the latest image/main if possible. Since this issue was opened, the Qwen3-30B-A3B Megatron recipe and stable vLLM Dockerfile have been updated, and Megatron offload has received related fixes such as #6635 and #6952.

中文补充:目前不建议直接关闭这个 issue。已有用户反馈降低 SGLang rollout TP size 可以绕过类似问题,原报告者也反馈关闭 param offload 后可运行;但还缺少在最新版镜像/main 上的复现结果。建议先按上述 TP/offload 两个方向确认,并贴出新版镜像、verl commit、rollout backend、TP/PP/EP/CP 配置以及第一处 OOM/CUDA error 日志。 This response was generated by a scheduled Codex GPT5.5 issue processing task.

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