NotImplementedError: sequence_length=5393 is larger than max_length=4096【严重错误】
I noticed that this issue was previously resolved in an earlier version, but it seems to have resurfaced in the latest release.
Steps Taken:
Set filter_overlong_prompts=True (no improvement) or Tried filter_overlong_prompts=False + truncation="left" (issue persists)
The problem still occurs under both configurations. Could you please look into this again? Let me know if you need additional details.
It is a bug of agent R1, please create an issue to that repo
I met the problem just in verl, not in agent R1.
I struct a custom dataset, the data sturct is:
{'data_source': 'PeijieWang/MV-MATH', 'ability': 'Combinatorial Geometry', 'reward_model': {'ground_truth': '4', 'style': 'rule'}, 'extra_info': {'analysis': 'Based on the front view, it can be determined that the stack of chalk consists of two layers. From the top view, it is evident that the first layer has 3 boxes of chalk. From the left view, it is clear that the second layer has 1 box. Therefore, there are a total of 4 boxes.\n\nHence, the answer is: 4.\n\n【Key Insight】This question tests the ability to determine the number of small cubes based on views from different directions. Mastering the relevant concepts is crucial for solving the problem.', 'difficulty': 'Low', 'image_relavance': '1', 'is_multi_img': True}, 'images': [<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=192x185 at 0x7F263E0E2950>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=189x185 at 0x7F263E0E29E0>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=191x185 at 0x7F263E0E2A40>]}
the error is:
File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 64, in main
run_ppo(config)
File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 76, in run_ppo
ray.get(runner.run.remote(config))
File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper
return fn(*args, **kwargs)
File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper
return func(*args, **kwargs)
File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/worker.py", line 2822, in get
values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout)
File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/worker.py", line 930, in get_objects
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(NotImplementedError): ray::TaskRunner.run() (pid=92799, ip=33.195.45.187, actor_id=d2bb25d8c710f7f8ed642b4101000000, repr=<main_ppo.TaskRunner object at 0x7f27dd9c1c60>)
File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 183, in run
trainer.fit()
File "/mnt/zhangh/wangzhikai/verl/verl/trainer/ppo/ray_trainer.py", line 868, in fit
val_metrics = self._validate()
File "/mnt/zhangh/wangzhikai/verl/verl/trainer/ppo/ray_trainer.py", line 563, in _validate
for test_data in self.val_dataloader:
File "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 450, in __next__
return super().__next__()
File "/usr/local/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 708, in __next__
data = self._next_data()
File "/usr/local/conda/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 "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 1543, in _process_data
data.reraise()
File "/usr/local/conda/lib/python3.10/site-packages/torch/_utils.py", line 733, in reraise
raise exception
NotImplementedError: Caught NotImplementedError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/worker.py", line 242, in _worker_loop
data = fetcher.fetch(index) # type: ignore[union-attr]
File "/usr/local/conda/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 "/usr/local/conda/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 "/mnt/zhangh/wangzhikai/verl/verl/utils/dataset/rl_dataset.py", line 203, in __getitem__
input_ids, attention_mask = verl_F.postprocess_data(
File "/mnt/zhangh/wangzhikai/verl/verl/utils/torch_functional.py", line 285, in postprocess_data
raise NotImplementedError(f"{sequence_length=} is larger than {max_length=}")
NotImplementedError: sequence_length=1055 is larger than max_length=1024
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
I met the problem just in verl, not in agent R1. I struct a custom dataset, the data sturct is:
{'data_source': 'PeijieWang/MV-MATH', 'ability': 'Combinatorial Geometry', 'reward_model': {'ground_truth': '4', 'style': 'rule'}, 'extra_info': {'analysis': 'Based on the front view, it can be determined that the stack of chalk consists of two layers. From the top view, it is evident that the first layer has 3 boxes of chalk. From the left view, it is clear that the second layer has 1 box. Therefore, there are a total of 4 boxes.\n\nHence, the answer is: 4.\n\n【Key Insight】This question tests the ability to determine the number of small cubes based on views from different directions. Mastering the relevant concepts is crucial for solving the problem.', 'difficulty': 'Low', 'image_relavance': '1', 'is_multi_img': True}, 'images': [<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=192x185 at 0x7F263E0E2950>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=189x185 at 0x7F263E0E29E0>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=191x185 at 0x7F263E0E2A40>]}the error is:File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 64, in main run_ppo(config) File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 76, in run_ppo ray.get(runner.run.remote(config)) File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper return fn(*args, **kwargs) File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, **kwargs) File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/worker.py", line 2822, in get values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout) File "/usr/local/conda/lib/python3.10/site-packages/ray/_private/worker.py", line 930, in get_objects raise value.as_instanceof_cause() ray.exceptions.RayTaskError(NotImplementedError): ray::TaskRunner.run() (pid=92799, ip=33.195.45.187, actor_id=d2bb25d8c710f7f8ed642b4101000000, repr=<main_ppo.TaskRunner object at 0x7f27dd9c1c60>) File "/mnt/zhangh/wangzhikai/verl/verl/trainer/main_ppo.py", line 183, in run trainer.fit() File "/mnt/zhangh/wangzhikai/verl/verl/trainer/ppo/ray_trainer.py", line 868, in fit val_metrics = self._validate() File "/mnt/zhangh/wangzhikai/verl/verl/trainer/ppo/ray_trainer.py", line 563, in _validate for test_data in self.val_dataloader: File "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 450, in __next__ return super().__next__() File "/usr/local/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 708, in __next__ data = self._next_data() File "/usr/local/conda/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 "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/stateful_dataloader.py", line 1543, in _process_data data.reraise() File "/usr/local/conda/lib/python3.10/site-packages/torch/_utils.py", line 733, in reraise raise exception NotImplementedError: Caught NotImplementedError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/conda/lib/python3.10/site-packages/torchdata/stateful_dataloader/worker.py", line 242, in _worker_loop data = fetcher.fetch(index) # type: ignore[union-attr] File "/usr/local/conda/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 "/usr/local/conda/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 "/mnt/zhangh/wangzhikai/verl/verl/utils/dataset/rl_dataset.py", line 203, in __getitem__ input_ids, attention_mask = verl_F.postprocess_data( File "/mnt/zhangh/wangzhikai/verl/verl/utils/torch_functional.py", line 285, in postprocess_data raise NotImplementedError(f"{sequence_length=} is larger than {max_length=}") NotImplementedError: sequence_length=1055 is larger than max_length=1024 Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
I have also encountered this problem. Have you solved it?