Error when executing SGLang test in examples
When executing tests in SGLang under examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn_test.sh, facing several problems when setting up the env: I use: pip install -e .[sglang] to setup the SGLang env and use pip install flash_attn to install flash attention, the version of flash attention is flash-attn 2.8.0.post2, then I face the problem:
undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
I fix the problem by using flash-attn 2.7.3 But when I execute the test script: examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn_test.sh, a strange error happens:
(WorkerDict pid=3055529) warnings.warn(
(TaskRunner pid=3055089) [2025-07-08 05:55:08,908] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:08,908] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:09,886] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:12,944] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:12,944] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:13,903] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:16,946] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:16,946] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:17,912] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:20,956] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:20,957] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:21,927] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:24,979] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:24,979] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:25,955] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:29,002] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:29,003] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:29,974] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:33,023] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:33,023] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:33,992] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
(TaskRunner pid=3055089) [2025-07-08 05:55:37,072] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:37,073] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:38,043] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
Error executing job with overrides: ['data.train_files=/home/dki/data/gsm8k/train.parquet', 'data.val_files=/home/dki/data/gsm8k/test.parquet', 'data.train_batch_size=64', 'data.max_prompt_length=1024', 'data.max_response_length=1024', 'actor_rollout_ref.rollout.name=sglang', 'actor_rollout_ref.model.path=Qwen/Qwen2.5-1.5B-Instruct', 'actor_rollout_ref.actor.optim.lr=1e-6', 'actor_rollout_ref.actor.ppo_mini_batch_size=64', 'actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=4', 'actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=8', '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.tensor_model_parallel_size=2', 'actor_rollout_ref.rollout.gpu_memory_utilization=0.6', 'actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=4', 'critic.optim.lr=1e-5', 'critic.model.path=Qwen/Qwen2.5-1.5B-Instruct', 'critic.ppo_micro_batch_size_per_gpu=4', 'critic.model.fsdp_config.param_offload=True', 'critic.model.fsdp_config.optimizer_offload=True', 'algorithm.kl_ctrl.kl_coef=0.001', 'trainer.logger=[console]', 'trainer.val_before_train=False', 'trainer.n_gpus_per_node=2', 'trainer.nnodes=1', 'trainer.save_freq=-1', 'trainer.test_freq=10', 'trainer.total_epochs=15']
Traceback (most recent call last):
File "/storage/v-yihaoliu/fuck/verl/verl/trainer/main_ppo.py", line 34, in main
run_ppo(config)
File "/storage/v-yihaoliu/fuck/verl/verl/trainer/main_ppo.py", line 57, in run_ppo
ray.get(runner.run.remote(config))
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/ray/_private/auto_init_hook.py", line 22, in auto_init_wrapper
return fn(*args, **kwargs)
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/ray/_private/client_mode_hook.py", line 104, in wrapper
return func(*args, **kwargs)
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/ray/_private/worker.py", line 2849, in get
values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout)
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/ray/_private/worker.py", line 937, in get_objects
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray::TaskRunner.run() (pid=3055089, ip=10.0.0.9, actor_id=2adda08dfa04ebbd48c04bc201000000, repr=<main_ppo.TaskRunner object at 0x73e5b082b730>)
File "/storage/v-yihaoliu/fuck/verl/verl/trainer/main_ppo.py", line 207, in run
trainer.fit()
File "/storage/v-yihaoliu/fuck/verl/verl/trainer/ppo/ray_trainer.py", line 1091, in fit
for batch_dict in self.train_dataloader:
File "/home/test/.local/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 450, in __next__
return super().__next__()
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 708, in __next__
data = self._next_data()
File "/home/test/.local/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 1456, in _next_data
return self._process_data(data, worker_id, state_dict)
File "/home/test/.local/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 1543, in _process_data
data.reraise()
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/torch/_utils.py", line 733, in reraise
raise exception
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/test/.local/lib/python3.10/site-packages/torchdata/stateful_dataloader/worker.py", line 242, in _worker_loop
data = fetcher.fetch(index) # type: ignore[union-attr]
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/test/.conda/envs/ggsg/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/storage/v-yihaoliu/fuck/verl/verl/utils/dataset/rl_dataset.py", line 215, in __getitem__
row_dict: dict = self.dataframe[item]
AttributeError: 'RLHFDataset' object has no attribute 'dataframe'
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
The dataset is GSM8K using python3 examples/data_preprocess/gsm8k.py to preprocess, the problem occurs at the same time when testing SGLang demo at: https://verl.readthedocs.io/en/latest/workers/sglang_worker.html#sglang-backend
+1
It's related to the incompatible symbol used by flash-attn latest version.
Two solutions:
- Downgrade:
uv pip install flash-attn==2.7.3 --no-build-isolation - Force rebuild:
MAX_JOBS=10 FLASH_ATTENTION_FORCE_BUILD=TRUE uv pip install flash-attn --no-build-isolation
+1
+1
+1
I fixed this problem for myself by setting self.serialize_dataset = True within verl's RLHFDataset class in __init__, and added self._read_files_and_tokenize() to the else block of the resume_dataset_state function. Not sure of the root cause.
@alexanderliu-creator The following
(TaskRunner pid=3055089) [2025-07-08 05:55:08,908] [WARNING] [real_accelerator.py:209:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(TaskRunner pid=3055089) [2025-07-08 05:55:08,908] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cpu (auto detect)
(TaskRunner pid=3055089) [2025-07-08 05:55:09,886] [INFO] [logging.py:107:log_dist] [Rank -1] [TorchCheckpointEngine] Initialized with serialization = False
have you tried to solve? I've noticed that during training, this issue doesn't trigger any warnings. However, when entering the testing phase (such as running the test set every 10 training epochs), I encounter similar warning messages to yours, and at this point, the GPU utilisation drops to zero.
中文
定时清理检查结论:这个 issue 最近一次非当前运行账号的公开回复或引用是 2025-09-17T10:58:09Z,截至本轮运行时间 2026-07-10T01:03:01Z 已经超过 6 个月。检查来源包括 issue comments API https://api.github.com/repos/verl-project/verl/issues/2411/comments 和 timeline API https://api.github.com/repos/verl-project/verl/issues/2411/timeline;最近证据:https://api.github.com/repos/verl-project/verl/issues/events/19747590925。
因此按社区 issue 定时清理标准关闭。若作者或社区成员仍能提供当前版本的复现、日志、PR 关联或新的需求背景,欢迎继续评论请求重开,或创建一个带有最新证据的新 issue。
English
Scheduled cleanup check: the latest public reply or reference from an account other than the current automation account was 2025-09-17T10:58:09Z, which is more than 6 months before this run time 2026-07-10T01:03:01Z. The checked public sources were the issue comments API https://api.github.com/repos/verl-project/verl/issues/2411/comments and the timeline API https://api.github.com/repos/verl-project/verl/issues/2411/timeline; latest evidence: https://api.github.com/repos/verl-project/verl/issues/events/19747590925.
Closing this under the scheduled issue cleanup policy. If the author or community can still provide a current reproduction, logs, PR reference, or updated requirement context, please comment to request reopening or open a new issue with fresh evidence.
This response was generated by a scheduled Codex GPT5.5 issue processing task.