-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[FSDP] assert to runtime error #86336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86336
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit bdd5056: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Prefer raising an error over `assert` which should mostly to indicate a developer bug, but user can cause this error path. [ghstack-poisoned]
awgu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| assert self._is_root, "`no_sync()` on inner FSDP instances is not supported" | ||
| if not self._is_root: | ||
| raise RuntimeError( | ||
| "`no_sync()` on inner FSDP instances is not supported. Please call `no_sync()` on root FSDP module." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In case you are okay with re-pushing:
| "`no_sync()` on inner FSDP instances is not supported. Please call `no_sync()` on root FSDP module." | |
| "`no_sync()` on inner FSDP instances is not supported. Please call `no_sync()` on the root FSDP module." |
Prefer raising an error over `assert` which should mostly to indicate a developer bug, but user can cause this error path. [ghstack-poisoned]
Summary: Prefer raising an error over `assert` which should mostly to indicate a developer bug, but user can cause this error path. Pull Request resolved: #86336 Approved by: https://github.com/awgu Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/adfd8f382331adbf9cbfa14039ef3b61f2f4e10c Reviewed By: seemethere Differential Revision: D40167182 Pulled By: rohan-varma fbshipit-source-id: 3406bfb1effd4d221644cb5a1f7bb0a19ee8086b
Stack from ghstack (oldest at bottom):
Prefer raising an error over
assertwhich should mostly to indicate a developer bug, but user can cause this error path.