verl icon indicating copy to clipboard operation
verl copied to clipboard

ImportError: cannot import name 'get_ip' from 'sglang.srt.utils'

Open zhaoyuewang827-coder opened this issue 1 year ago • 3 comments

System Info

cann't start run_qwen3_8b_grpo_sglang_1k_npu.sh

torch==2.6.0 torch_npu==2.6.0.post2 transformers==4.56.1

Is this an environment issue or a native adaptation issue? Has anyone encountered this?

Information

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

Tasks

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

Reproduction

errors: (WorkerDict pid=6327) Total steps: 18020, num_warmup_steps: 0 (WorkerDict pid=6328) /home/ma-user/verl/verl/utils/profiler/config.py:49: UserWarning: Torch profiler tool config is not fully supported now. (WorkerDict pid=6328) warnings.warn("Torch profiler tool config is not fully supported now.", stacklevel=1) (WorkerDict pid=6327) Actor use_remove_padding=True (WorkerDict pid=6327) Actor use_fused_kernels=False (WorkerDict pid=6327) /usr/local/python3.11.13/lib/python3.11/site-packages/torch_npu/dynamo/torchair/configs/compiler_config.py:74: UserWarning: The following torchair config or properties may not take effect or report error in max-autotune mode: (WorkerDict pid=6327) warnings.warn("The following torchair config or properties may not take effect or report " +
(WorkerDict pid=6327) /usr/local/python3.11.13/lib/python3.11/site-packages/torch_npu/dynamo/torchair/configs/compiler_config.py:74: UserWarning: The following torchair config or properties may not take effect or report error in max-autotune mode: (WorkerDict pid=6327) warnings.warn("The following torchair config or properties may not take effect or report " +
(WorkerDict pid=6327) /home/ma-user/verl/verl/utils/profiler/config.py:49: UserWarning: Torch profiler tool config is not fully supported now. (WorkerDict pid=6327) warnings.warn("Torch profiler tool config is not fully supported now.", stacklevel=1) (WorkerDict pid=6327) /home/ma-user/sglang/python/sglang/srt/layers/quantization/awq.py:62: UserWarning: Only CUDA and HIP support AWQ currently. (WorkerDict pid=6327) warnings.warn(f"Only CUDA and HIP support AWQ currently.") (WorkerDict pid=6327) /usr/local/python3.11.13/lib/python3.11/site-packages/torch_npu/dynamo/torchair/configs/compiler_config.py:74: UserWarning: The following torchair config or properties may not take effect or report error in max-autotune mode: (WorkerDict pid=6327) warnings.warn("The following torchair config or properties may not take effect or report " +
(WorkerDict pid=6327) /usr/local/python3.11.13/lib/python3.11/site-packages/torch_npu/dynamo/torchair/configs/compiler_config.py:74: UserWarning: The following torchair config or properties may not take effect or report error in max-autotune mode: (WorkerDict pid=6327) warnings.warn("The following torchair config or properties may not take effect or report " +
Error executing job with overrides: ['algorithm.adv_estimator=grpo', 'data.train_files=/home/ma-user/data/gsm8k/train.parquet', 'data.val_files=/home/ma-user/data/gsm8k//test.parquet', 'data.train_batch_size=2', 'data.max_prompt_length=128', 'data.max_response_length=256', 'data.filter_overlong_prompts=True', 'data.truncation=error', 'actor_rollout_ref.model.path=/home/ma-user/work/Qwen3-8B', 'actor_rollout_ref.actor.optim.lr=1e-6', 'actor_rollout_ref.model.use_remove_padding=True', 'actor_rollout_ref.actor.ppo_mini_batch_size=2', 'actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=1', 'actor_rollout_ref.actor.use_kl_loss=True', 'actor_rollout_ref.actor.entropy_coeff=0', 'actor_rollout_ref.actor.kl_loss_coef=0.001', 'actor_rollout_ref.actor.kl_loss_type=low_var_kl', 'actor_rollout_ref.actor.use_torch_compile=False', 'actor_rollout_ref.model.enable_gradient_checkpointing=True', 'actor_rollout_ref.actor.fsdp_config.param_offload=True', 'actor_rollout_ref.actor.fsdp_config.optimizer_offload=True', 'actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=2', 'actor_rollout_ref.rollout.tensor_model_parallel_size=2', 'actor_rollout_ref.rollout.name=sglang', 'actor_rollout_ref.rollout.gpu_memory_utilization=0.3', 'actor_rollout_ref.rollout.n=5', '+actor_rollout_ref.rollout.engine_kwargs.sglang.attention_backend=ascend', 'actor_rollout_ref.ref.fsdp_config.param_offload=True', 'actor_rollout_ref.rollout.enable_chunked_prefill=False', 'actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=2', 'actor_rollout_ref.ref.fsdp_config.param_offload=True', 'actor_rollout_ref.nccl_timeout=1800', 'algorithm.use_kl_in_reward=False', 'trainer.critic_warmup=0', 'trainer.logger=console', 'trainer.val_before_train=False', 'trainer.project_name=verl_grpo_example_512_1024_gsm8k', 'trainer.experiment_name=qwen3_8b_function_rm', 'trainer.n_gpus_per_node=2', 'trainer.nnodes=1', 'trainer.save_freq=1000', 'trainer.test_freq=10000', 'trainer.total_epochs=5', 'trainer.default_local_dir=/logs/ckpt/qwen3_8b', 'actor_rollout_ref.actor.ulysses_sequence_parallel_size=2', 'actor_rollout_ref.ref.ulysses_sequence_parallel_size=2', 'trainer.device=npu'] (TaskRunner pid=5726) Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): ray::WorkerDict.actor_rollout_init_model() (pid=6328, ip=172.16.0.96, actor_id=3dfd03b20b7a7e8ad33f4e3101000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0xffe1aab81650>) (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "/home/ma-user/verl/verl/single_controller/ray/base.py", line 700, in func (TaskRunner pid=5726) return getattr(self.worker_dict[key], name)(*args, **kwargs) (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "/home/ma-user/verl/verl/single_controller/base/decorator.py", line 433, in inner (TaskRunner pid=5726) return func(*args, **kwargs) (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "/home/ma-user/verl/verl/workers/fsdp_workers.py", line 792, in init_model (TaskRunner pid=5726) self._build_rollout(trust_remote_code=self.config.model.get("trust_remote_code", False)) (TaskRunner pid=5726) File "/home/ma-user/verl/verl/workers/fsdp_workers.py", line 600, in _build_rollout (TaskRunner pid=5726) self.rollout = get_rollout_class(rollout_config.name, rollout_config.mode)( (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "/home/ma-user/verl/verl/workers/rollout/base.py", line 101, in get_rollout_class (TaskRunner pid=5726) rollout_module = importlib.import_module(module_name) (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "/usr/local/python3.11.13/lib/python3.11/importlib/init.py", line 126, in import_module (TaskRunner pid=5726) return _bootstrap._gcd_import(name[level:], package, level) (TaskRunner pid=5726) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (TaskRunner pid=5726) File "", line 1204, in _gcd_import (TaskRunner pid=5726) File "", line 1176, in _find_and_load (TaskRunner pid=5726) File "", line 1147, in _find_and_load_unlocked (TaskRunner pid=5726) File "", line 690, in _load_unlocked (TaskRunner pid=5726) File "", line 940, in exec_module (TaskRunner pid=5726) File "", line 241, in _call_with_frames_removed (TaskRunner pid=5726) File "/home/ma-user/verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py", line 39, in (TaskRunner pid=5726) from sglang.srt.utils import ( (TaskRunner pid=5726) ImportError: cannot import name 'get_ip' from 'sglang.srt.utils' (/home/ma-user/sglang/python/sglang/srt/utils.py) Traceback (most recent call last): File "/home/ma-user/verl/verl/trainer/main_ppo.py", line 42, in main run_ppo(config) File "/home/ma-user/verl/verl/trainer/main_ppo.py", line 85, in run_ppo ray.get(runner.run.remote(config)) File "/usr/local/python3.11.13/lib/python3.11/site-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/python3.11.13/lib/python3.11/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/python3.11.13/lib/python3.11/site-packages/ray/_private/worker.py", line 2822, in get values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/python3.11.13/lib/python3.11/site-packages/ray/_private/worker.py", line 930, in get_objects raise value.as_instanceof_cause() ray.exceptions.RayTaskError(ImportError): ray::TaskRunner.run() (pid=5726, ip=172.16.0.96, actor_id=e79431c744c635a81324254301000000, repr=<main_ppo.TaskRunner object at 0xffff83e3c050>) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/verl/verl/trainer/main_ppo.py", line 314, in run trainer.init_workers() File "/home/ma-user/verl/verl/trainer/ppo/ray_trainer.py", line 755, in init_workers self.actor_rollout_wg.init_model() File "/home/ma-user/verl/verl/single_controller/ray/base.py", line 48, in call output = ray.get(output) ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ray.exceptions.RayTaskError(ImportError): ray::WorkerDict.actor_rollout_init_model() (pid=6327, ip=172.16.0.96, actor_id=16f2f23080ebc6d859b5f34801000000, repr=<verl.single_controller.ray.base.WorkerDict object at 0xffffa6da4410>) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/verl/verl/single_controller/ray/base.py", line 700, in func return getattr(self.worker_dict[key], name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/verl/verl/single_controller/base/decorator.py", line 433, in inner return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/verl/verl/workers/fsdp_workers.py", line 792, in init_model self._build_rollout(trust_remote_code=self.config.model.get("trust_remote_code", False)) File "/home/ma-user/verl/verl/workers/fsdp_workers.py", line 600, in _build_rollout self.rollout = get_rollout_class(rollout_config.name, rollout_config.mode)( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/verl/verl/workers/rollout/base.py", line 101, in get_rollout_class rollout_module = importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/python3.11.13/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/home/ma-user/verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py", line 39, in from sglang.srt.utils import ( ImportError: cannot import name 'get_ip' from 'sglang.srt.utils' (/home/ma-user/sglang/python/sglang/srt/utils.py)

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace. (WorkerDict pid=6328) /home/ma-user/sglang/python/sglang/srt/layers/quantization/awq.py:62: UserWarning: Only CUDA and HIP support AWQ currently. (WorkerDict pid=6328) warnings.warn(f"Only CUDA and HIP support AWQ currently.")

Expected behavior

how to solve it

zhaoyuewang827-coder avatar Oct 10 '25 07:10 zhaoyuewang827-coder

By replacing get_ip with get_local_ip_auto as get_ip works for me

Junxiao-Zhao avatar Oct 13 '25 11:10 Junxiao-Zhao

Hi, it looks like this PR fixes the issue. Could you please try again with the following change applied? https://github.com/volcengine/verl/pull/3860

zjchenn avatar Dec 16 '25 09:12 zjchenn

中文:

该 issue 命中定时清理的默认关闭规则:最近一次非当前运行账号的公开回复或公开引用发生在 2025-12-16T09:26:03Z(actor: zjchenn),早于本轮运行日期 2026-07-20 的 6 个月阈值(cutoff: 2026-01-20T00:00:00Z)。因此按定时清理标准关闭。

可追溯证据:

  • Issue: https://github.com/verl-project/verl/issues/3719
  • latest_non_self_reply_or_reference_at: 2025-12-16T09:26:03Z
  • 已检查 comments 与 timeline 来源:https://api.github.com/repos/verl-project/verl/issues/3719/comments 和 https://api.github.com/repos/verl-project/verl/issues/3719/timeline

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

English:

This issue matches the scheduled cleanup default-close rule: the latest public reply or public reference from an account other than the current automation account was at 2025-12-16T09:26:03Z (actor: zjchenn), which is older than the six-month cutoff for this run (2026-01-20T00:00:00Z, run date: 2026-07-20). Therefore, this issue is being closed under the scheduled cleanup policy.

Traceable evidence:

  • Issue: https://github.com/verl-project/verl/issues/3719
  • latest_non_self_reply_or_reference_at: 2025-12-16T09:26:03Z
  • Checked comments and timeline sources: https://api.github.com/repos/verl-project/verl/issues/3719/comments and https://api.github.com/repos/verl-project/verl/issues/3719/timeline

If the author or community can still provide a fresh reproduction, evidence, or additional context, please comment to request reopening or create a new linked issue.

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

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