Skip to content

Commit

Permalink
Fix get distributed config (#122)
Browse files Browse the repository at this point in the history
* fix(utils): get distributed deepspeed config error

* fix(contributing.md): dangling links
  • Loading branch information
maxreciprocate authored Dec 5, 2022
1 parent b229288 commit 5df5219
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ Follow these steps to start contributing code:
Finally ... 🥁 ... Create a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) to the `trlX` repository! Make sure to include a description of your changes and link to any relevant issues.
> __Tip__: If you're looking to introduce an experimental feature, we suggest testing the behavior of your proposed feature on some of the existing [examples](https://github.com/CarperAI/trlx/tree/master/examples), such as [random walks](https://github.com/CarperAI/trlx/blob/master/examples/randomwalks.py). This will help you get a better sense of how the feature would work in practice and will also help you identify any potential flaws in the implementation.
> __Tip__: If you're looking to introduce an experimental feature, we suggest testing the behavior of your proposed feature on some of the existing [examples](https://github.com/CarperAI/trlx/tree/master/examples), such as [random walks](https://github.com/CarperAI/trlx/blob/master/examples/randomwalks). This will help you get a better sense of how the feature would work in practice and will also help you identify any potential flaws in the implementation.

## Asking questions

Have a question? Rather than opening an issue, you can readily chat with the core team on our [Discord server](https://discord.gg/X2gHZMRP6m).
Have a question? Rather than opening an issue, you can readily chat with the core team on our [Discord server](https://discord.gg/canadagoose).

## Code of conduct

Expand Down
4 changes: 2 additions & 2 deletions trlx/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def get_distributed_config(accelerator: Accelerator):
"num_gpus": accelerate_config.num_processes,
}

if hasattr(accelerator.state, "deepspeed_plugin"):
if accelerator.state.deepspeed_plugin is not None:
ds_plugin = accelerator.state.deepspeed_plugin
dist_config.upate(
dist_config.update(
{
"gradient_accumulation_steps": ds_plugin.gradient_accumulation_steps,
"gradient_clipping": ds_plugin.gradient_clipping,
Expand Down

0 comments on commit 5df5219

Please sign in to comment.