Prioritize raising error message about unused parameters when rebuild_buckets fails#45933
Prioritize raising error message about unused parameters when rebuild_buckets fails#45933rohan-varma wants to merge 4 commits intogh/rohan-varma/180/basefrom
Conversation
…_buckets fails Occasionally users run DDP with models with unused params, in this case we would like to surface an error message telling them to run with find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made it so that we raise a size mismatch error when this happens, but the information about unused parameters is likely to be more useful and likely to be the most common case of failure. Prefer raising this error over the subsequent size mismatch errors. Differential Revision: [D24151256](https://our.internmc.facebook.com/intern/diff/D24151256/) [ghstack-poisoned]
…hen rebuild_buckets fails" Occasionally users run DDP with models with unused params, in this case we would like to surface an error message telling them to run with find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made it so that we raise a size mismatch error when this happens, but the information about unused parameters is likely to be more useful and likely to be the most common case of failure. Prefer raising this error over the subsequent size mismatch errors. Differential Revision: [D24151256](https://our.internmc.facebook.com/intern/diff/D24151256/) [ghstack-poisoned]
…_buckets fails Pull Request resolved: #45933 Occasionally users run DDP with models with unused params, in this case we would like to surface an error message telling them to run with find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made it so that we raise a size mismatch error when this happens, but the information about unused parameters is likely to be more useful and likely to be the most common case of failure. Prefer raising this error over the subsequent size mismatch errors. ghstack-source-id: 113713050 Differential Revision: [D24151256](https://our.internmc.facebook.com/intern/diff/D24151256/)
| // has unused parameters for example, this will raise an error recommending to | ||
| // run with find_unused_parameters=True, instead of the size mismatch exception | ||
| // below. | ||
| ensure_prior_reduction_finished(); |
There was a problem hiding this comment.
looks like self.reducer._rebuild_buckets is always invoked. Will it be sufficient if we move this to the front of the above if clause and then remove the other ensure_prior_reduction_finished invocation in prepare_for_backward?
There was a problem hiding this comment.
Yes, I believe this should be okay. Originally I was concerned about require_backward_grad_sync flag, but I don't think its an issue. If we don't require_backward_grad_sync this iteration, we should still have the previous iteration reduction finished, where "previous iteration" here means the previous iteration that required grad sync, or the initial state of require_finalize_, which is false.
Codecov Report
@@ Coverage Diff @@
## gh/rohan-varma/180/base #45933 +/- ##
==========================================================
Coverage ? 68.25%
==========================================================
Files ? 410
Lines ? 53251
Branches ? 0
==========================================================
Hits ? 36349
Misses ? 16902
Partials ? 0
Continue to review full report at Codecov.
|
…hen rebuild_buckets fails" Occasionally users run DDP with models with unused params, in this case we would like to surface an error message telling them to run with find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made it so that we raise a size mismatch error when this happens, but the information about unused parameters is likely to be more useful and likely to be the most common case of failure. Prefer raising this error over the subsequent size mismatch errors. Differential Revision: [D24151256](https://our.internmc.facebook.com/intern/diff/D24151256/) [ghstack-poisoned]
…hen rebuild_buckets fails" Occasionally users run DDP with models with unused params, in this case we would like to surface an error message telling them to run with find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made it so that we raise a size mismatch error when this happens, but the information about unused parameters is likely to be more useful and likely to be the most common case of failure. Prefer raising this error over the subsequent size mismatch errors. Differential Revision: [D24151256](https://our.internmc.facebook.com/intern/diff/D24151256/) [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit ec9826a (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
❄️ 1 failure tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
|
This pull request has been merged in 62554a3. |
|
This pull request has been merged in 62554a3. |
Stack from ghstack:
Occasionally users run DDP with models with unused params, in this
case we would like to surface an error message telling them to run with
find_unused_params=True. However, a recent change to rebuild_buckets logic (#44798) made
it so that we raise a size mismatch error when this happens, but the
information about unused parameters is likely to be more useful and likely to
be the most common case of failure. Prefer raising this error over the
subsequent size mismatch errors.
Differential Revision: D24151256