question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: add an additional argument to auto_optim to allow for gradient accumulation

See original GitHub issue

When we use horovod backend and perform gradient accumulation, we get the following error: AssertionError: Gradients were computed more than backward_passes_per_step times before call to step(). Increase backward_passes_per_step to accumulate gradients locally.

Thus, we need to change the default argument backward_passes_per_step of horovod.DistributedOptimizer to enable gradient accumulation in the distributed setting. To do so, we can add this argument to ignite.distributed.auto_optim.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Chandan-h-509commented, Aug 20, 2021

ohk… Got it… Can i work on it?

1reaction
vfdev-5commented, Aug 17, 2021

@sandylaker thanks for the feature request ! Maybe, we can enable kwargs for auto_optim as it is done for auto_model. In the docs we can explicitly say where kwargs goes exactly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradient accumulation trick and Activation Checkpointing ...
Feature request Adds gradient accumulation trick to ... Adds Activation Checkpointing feature Motivation For GPU memory issue as well...
Read more >
Performing gradient accumulation with Accelerate
Gradient accumulation is a technique where you can train on bigger batch sizes than your machine would normally be able to fit into...
Read more >
Gradient Accumulation: Overcoming Memory Constraints in ...
So the question you want to ask is: why does the remaining 5% need something else. In order to answer, let's check out...
Read more >
Gradient Accumulation in PyTorch - Nikita Kozodoi
Now let's implement gradient accumulation! There are three things we need to do: Specify the accum_iter parameter. This is just an integer value ......
Read more >
Gradient Accumulation with Custom model.fit in TF.Keras?
The reason is if we want to get the benefit of keras built-in functionality like fit , callbacks , we don't want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found