You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An officially supported task in the examples folder
My own task or dataset (give details below)
Reproduction
I ran official examples for PPO and RLOO and got error when Accelerator is created.
I only made one change in examples/accelerate_configs/deepspeed_zero3.yaml: num_processes: 4 to run it with 4 GPUs.
[rank1]: File "/root/trl-orig/examples/scripts/ppo/ppo.py", line 152, in <module>
[rank1]: trainer = PPOTrainer(
[rank1]: ^^^^^^^^^^^
[rank1]: File "/opt/conda/lib/python3.11/site-packages/transformers/utils/deprecation.py", line 165, in wrapped_func
[rank1]: return func(*args, **kwargs)
[rank1]: ^^^^^^^^^^^^^^^^^^^^^
[rank1]: File "/opt/conda/lib/python3.11/site-packages/transformers/utils/deprecation.py", line 165, in wrapped_func
[rank1]: return func(*args, **kwargs)
[rank1]: ^^^^^^^^^^^^^^^^^^^^^
[rank1]: File "/opt/conda/lib/python3.11/site-packages/transformers/utils/deprecation.py", line 165, in wrapped_func
[rank1]: return func(*args, **kwargs)
[rank1]: ^^^^^^^^^^^^^^^^^^^^^
[rank1]: [Previous line repeated 1 more time]
[rank1]: File "/root/trl-orig/trl/trainer/ppo_trainer.py", line 186, in __init__
[rank1]: accelerator = Accelerator(gradient_accumulation_steps=args.gradient_accumulation_steps)
[rank1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank1]: File "/opt/conda/lib/python3.11/site-packages/accelerate/accelerator.py", line 302, in __init__
[rank1]: deepspeed_plugins = AcceleratorState().deepspeed_plugins
[rank1]: ^^^^^^^^^^^^^^^^^^
[rank1]: File "/opt/conda/lib/python3.11/site-packages/accelerate/state.py", line 887, in __init__
[rank1]: raise ValueError(
[rank1]: ValueError: Please make sure to properly initialize your accelerator via `accelerator = Accelerator()` before using any functionality from the `accelerate` library.
[rank0]: Traceback (most recent call last):
[rank0]: File "/root/trl-orig/examples/scripts/rloo/rloo.py", line 125, in <module>
[rank0]: trainer = RLOOTrainer(
[rank0]: ^^^^^^^^^^^^
[rank0]: File "/root/trl-orig/trl/trainer/rloo_trainer.py", line 124, in __init__
[rank0]: accelerator = Accelerator(gradient_accumulation_steps=args.gradient_accumulation_steps)
[rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]: File "/opt/conda/lib/python3.11/site-packages/accelerate/accelerator.py", line 302, in __init__
[rank0]: deepspeed_plugins = AcceleratorState().deepspeed_plugins
[rank0]: ^^^^^^^^^^^^^^^^^^
[rank0]: File "/opt/conda/lib/python3.11/site-packages/accelerate/state.py", line 887, in __init__
[rank0]: raise ValueError(
[rank0]: ValueError: Please make sure to properly initialize your accelerator via `accelerator = Accelerator()` before using any functionality from the `accelerate` library.
Expected behavior
This doesn't happen with accelerate==0.34.2. I also checked accelerate==1.0.0 and get same errors. Is trl supposed to work with accelerate>=1.0.0?
Checklist
I have checked that my issue isn't already filed (see open issues)
I have included my system information
Any code provided is minimal, complete, and reproducible (more on MREs)
Any code provided is properly formatted in code blocks, (no screenshot, more on code blocks)
Any traceback provided is complete
The text was updated successfully, but these errors were encountered:
System Info
Information
Tasks
examples
folderReproduction
I ran official examples for PPO and RLOO and got error when Accelerator is created.
I only made one change in
examples/accelerate_configs/deepspeed_zero3.yaml
:num_processes: 4
to run it with 4 GPUs.PPO
Traceback:
RLOO
Traceback:
Expected behavior
This doesn't happen with
accelerate==0.34.2
. I also checkedaccelerate==1.0.0
and get same errors. Is trl supposed to work withaccelerate>=1.0.0
?Checklist
The text was updated successfully, but these errors were encountered: