RuntimeError: pidfd_getfd: Operation not permitted
Has anyone encountered this kind of error?Has anyone encountered this kind of error?Has anyone encountered this kind of error?Has anyone encountered this kind of error?
Capturing batches (avail_mem=32.75 GB): 0%| | 0/23 [00:00<?, ?it/s]
Loading checkpoint shards: 50%|█████ | 1/2 [00:03<00:03, 3.85s/it]
Loading checkpoint shards: 100%|██████████| 2/2 [00:05<00:00, 2.98s/it] [repeated 7x across cluster]
Capturing batches (avail_mem=32.55 GB): 4%|▍ | 1/23 [00:00<00:11, 1.84it/s]
Capturing batches (avail_mem=32.75 GB): 4%|▍ | 1/23 [00:00<00:12, 1.81it/s]
Capturing batches (avail_mem=32.55 GB): 4%|▍ | 1/23 [00:00<00:12, 1.81it/s]
Capturing batches (avail_mem=32.75 GB): 0%| | 0/23 [00:00<?, ?it/s] [repeated 7x across cluster]
Capturing batches (avail_mem=31.18 GB): 83%|████████▎ | 19/23 [00:05<00:01, 3.78it/s] [repeated 145x across cluster]
Capturing batches (avail_mem=31.59 GB): 57%|█████▋ | 13/23 [00:03<00:02, 3.76it/s] [repeated 4x across cluster]
Capturing batches (avail_mem=31.45 GB): 91%|█████████▏| 21/23 [00:05<00:00, 3.63it/s]
Capturing batches (avail_mem=31.45 GB): 100%|██████████| 23/23 [00:06<00:00, 3.69it/s]
Capturing batches (avail_mem=31.45 GB): 100%|██████████| 23/23 [00:06<00:00, 3.56it/s]
(WorkerDict pid=3546248) /home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py:690: FutureWarning: FSDP.state_dict_type() and FSDP.set_state_dict_type() are being deprecated. Please use APIs, get_state_dict() and set_state_dict(), which can support different parallelisms, FSDP1, FSDP2, DDP. API doc: https://pytorch.org/docs/stable/distributed.checkpoint.html#torch.distributed.checkpoint.state_dict.get_state_dict .Tutorial: https://pytorch.org/tutorials/recipes/distributed_checkpoint_recipe.html .
(WorkerDict pid=3546248) warnings.warn(
(TaskRunner pid=3536185) wandb: Tracking run with wandb version 0.21.0
(TaskRunner pid=3536185) wandb: W&B syncing is set to offline in this directory. Run wandb online or set WANDB_MODE=online to enable cloud syncing.
(TaskRunner pid=3536185) Checkpoint tracker file does not exist: /data/abibulla/tester/verl/checkpoints/search_r1_like_async_rl/qwen2.5-3b-instruct_function_rm-search-async-sgl-multi-w-searchtool-verify-n16/latest_checkpointed_iteration.txt
(TaskRunner pid=3536185) Training from scratch
(WorkerDict pid=3546253) { [repeated 7x across cluster]
(WorkerDict pid=3546253) "type": "function", [repeated 7x across cluster]
(WorkerDict pid=3546253) "function": { [repeated 7x across cluster]
(WorkerDict pid=3546253) "name": "search", [repeated 7x across cluster]
(WorkerDict pid=3546253) "description": "Searches the web for relevant information based on the given query.", [repeated 7x across cluster]
(WorkerDict pid=3546253) "parameters": { [repeated 7x across cluster]
(WorkerDict pid=3546253) "type": "object", [repeated 7x across cluster]
(WorkerDict pid=3546253) "properties": { [repeated 7x across cluster]
(WorkerDict pid=3546253) "query_list": { [repeated 7x across cluster]
(WorkerDict pid=3546253) "type": "array", [repeated 7x across cluster]
(WorkerDict pid=3546253) "description": "A list of fully-formed semantic queries. The tool will return search results for each query." [repeated 7x across cluster]
(WorkerDict pid=3546253) } [repeated 28x across cluster]
(WorkerDict pid=3546253) }, [repeated 7x across cluster]
(WorkerDict pid=3546253) "required": [ [repeated 7x across cluster]
(WorkerDict pid=3546253) "query_list" [repeated 7x across cluster]
(WorkerDict pid=3546253) ] [repeated 7x across cluster]
Training Progress: 0%| | 0/2650 [00:00<?, ?it/s]
Capturing batches (avail_mem=31.46 GB): 87%|████████▋ | 20/23 [00:06<00:00, 3.37it/s] [repeated 10x across cluster]
Capturing batches (avail_mem=31.46 GB): 87%|████████▋ | 20/23 [00:05<00:00, 3.64it/s] [repeated 2x across cluster]
(WorkerDict pid=3545763) [2025-07-31 22:08:54] Scheduler hit an exception: Traceback (most recent call last):
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 2311, in run_scheduler_process
(WorkerDict pid=3545763) scheduler.event_loop_overlap()
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
(WorkerDict pid=3545763) return func(*args, **kwargs)
(WorkerDict pid=3545763) ^^^^^^^^^^^^^^^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 662, in event_loop_overlap
(WorkerDict pid=3545763) self.process_input_requests(recv_reqs)
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 889, in process_input_requests
(WorkerDict pid=3545763) output = self._request_dispatcher(recv_req)
(WorkerDict pid=3545763) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/utils.py", line 471, in call
(WorkerDict pid=3545763) return fn(obj)
(WorkerDict pid=3545763) ^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 2035, in update_weights_from_tensor
(WorkerDict pid=3545763) success, message = self.tp_worker.update_weights_from_tensor(recv_req)
(WorkerDict pid=3545763) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/tp_worker_overlap_thread.py", line 254, in update_weights_from_tensor
(WorkerDict pid=3545763) success, message = self.worker.update_weights_from_tensor(recv_req)
(WorkerDict pid=3545763) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/managers/tp_worker.py", line 255, in update_weights_from_tensor
(WorkerDict pid=3545763) success, message = self.model_runner.update_weights_from_tensor(
(WorkerDict pid=3545763) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 742, in update_weights_from_tensor
(WorkerDict pid=3545763) named_tensors = [
(WorkerDict pid=3545763) ^
(WorkerDict pid=3545763) File "/home/abibulla/anaconda3/envs/verl/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 743, in
same problem
fixed with fsdp2, add following line into script:
actor_rollout_ref.ref.strategy=fsdp2 actor_rollout_ref.actor.strategy=fsdp2 critic.strategy=fsdp2 reward_model.strategy=fsdp2
@sysuyy fix worked for me (you're a hero! 🚀)
fixed with fsdp2, add following line into script:
actor_rollout_ref.ref.strategy=fsdp2 actor_rollout_ref.actor.strategy=fsdp2 critic.strategy=fsdp2 reward_model.strategy=fsdp2
Is there any solution for megatron?
fixed with fsdp2, add following line into script:
actor_rollout_ref.ref.strategy=fsdp2 actor_rollout_ref.actor.strategy=fsdp2 critic.strategy=fsdp2 reward_model.strategy=fsdp2
this did not worked for me. anyone else experiencing the same issue?
fixed with fsdp2, add following line into script:
actor_rollout_ref.ref.strategy=fsdp2 actor_rollout_ref.actor.strategy=fsdp2 critic.strategy=fsdp2 reward_model.strategy=fsdp2
That also worked for me! Thanks!
中文:
从目前的信息看,这个报错还不能安全地判定为已解决。已有用户反馈把相关组件切到 FSDP2 可以规避:
actor_rollout_ref.ref.strategy=fsdp2
actor_rollout_ref.actor.strategy=fsdp2
critic.strategy=fsdp2
reward_model.strategy=fsdp2
但同一串 RuntimeError: pidfd_getfd: Operation not permitted 在关联 issue #3377 中也有用户反馈 FSDP2 不生效,并且后续讨论指向 SGLang/PyTorch CUDA IPC 与 Linux ptrace/Yama 或容器权限限制的可能性。PyTorch 侧也有讨论指出 Operation not permitted 这类 pidfd_getfd 报错通常和 ptrace/Yama 访问限制相关。
为了继续定位,请补充以下信息:
- 完整启动脚本或最小复现命令;
verl,torch,sglang,CUDA,ray版本;- 当前是
rollout.name=sglang还是vllm,以及训练 backend 是fsdp/fsdp2/megatron; - 是否在 Docker/Kubernetes/Slurm/Pyxis 等容器环境中运行,以及容器的 seccomp/AppArmor/securityContext/privileged 配置;
cat /proc/sys/kernel/yama/ptrace_scope的输出;- 切换到
vllm是否消失,切换到 FSDP2 是否消失。
在补充这些信息之前,更保守的结论是:FSDP2 是一个可尝试 workaround,但该问题可能不是单纯的 verl 配置问题,也可能需要调整运行环境权限或等待/跟进 SGLang/PyTorch 侧修复。
English:
Based on the current evidence, this should not be considered safely resolved yet. Some users reported that switching the related components to FSDP2 avoids the error:
actor_rollout_ref.ref.strategy=fsdp2
actor_rollout_ref.actor.strategy=fsdp2
critic.strategy=fsdp2
reward_model.strategy=fsdp2
However, in the related issue #3377, at least one user reported that the FSDP2 workaround did not fix the same RuntimeError: pidfd_getfd: Operation not permitted. The later discussion also points to a possible interaction between SGLang/PyTorch CUDA IPC and Linux ptrace/Yama or container permission restrictions. A PyTorch-side discussion also notes that pidfd_getfd: Operation not permitted cases are related to ptrace/Yama access limitations.
Could you please provide:
- the full launch script or a minimal reproduction command;
- versions of
verl,torch,sglang,CUDA, andray; - whether
rollout.nameissglangorvllm, and whether the training backend isfsdp,fsdp2, ormegatron; - whether this runs inside Docker/Kubernetes/Slurm/Pyxis, including seccomp/AppArmor/securityContext/privileged settings;
- the output of
cat /proc/sys/kernel/yama/ptrace_scope; - whether the error disappears when switching to
vllm, and whether it disappears when switching to FSDP2.
Until then, the conservative conclusion is: FSDP2 is a workaround worth trying, but the root cause may also be environment permissions or SGLang/PyTorch CUDA IPC behavior, not only a verl-side configuration issue.
This response was generated by a scheduled Codex GPT5.5 issue processing task.