-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[optim] be explicit about CPU scalar tensor dtypes #111008
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
[optim] be explicit about CPU scalar tensor dtypes #111008
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111008
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 18d6b92 with merge base b5dd37f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "release notes: optim" |
@@ -736,7 +736,7 @@ def _test_derived_optimizers_varying_tensors(self, optimizer_with_kwargs, kwarg) | |||
actual = mt_p_state[k] | |||
self.assertEqual(st_p_state[k], actual, rtol=rtol, atol=atol) | |||
|
|||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag): | |||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag, reduced_precision=False): |
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.
Don't think this tests sparseadam. I think it would have previously failed too.
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.
this doesn’t test sparseadam nor lbfgs since they do not have foreach/multitensor impls.
moreover, it looks like sparseadam doesn’t have its step as a tensor like the majority of our optimizers. moving step to be a tensor is a separate change that includes adding warnings and tests (as it’s BC breaking) and I would recommend moving the sparseadam changes to a separate PR and only focusing on the foreach impls in this one.
If you’re up for it, RMSProp and Rprop also were accidentally left out of the step to Tensor migration (done by @mikaylagawarecki almost 2 yrs ago) and should be brought into the fold. 😄
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.
this doesn’t test sparseadam nor lbfgs since they do not have foreach/multitensor impls.
moreover, it looks like sparseadam doesn’t have its step as a tensor like the majority of our optimizers. moving step to be a tensor is a separate change that includes adding warnings and tests (as it’s BC breaking) and I would recommend moving the sparseadam changes to a separate PR and only focusing on the foreach impls in this one.
If you’re up for it, Adadelta, RMSProp and Rprop also were accidentally left out of the step to Tensor migration (done by @mikaylagawarecki almost 2 yrs ago) and should be brought into the fold. 😄
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.
Sure, I recall this is actually a high prio as well. Let me migrate Adadelta, RMSProp and Rprop
next.
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.
thanks for taking this on!
@@ -736,7 +736,7 @@ def _test_derived_optimizers_varying_tensors(self, optimizer_with_kwargs, kwarg) | |||
actual = mt_p_state[k] | |||
self.assertEqual(st_p_state[k], actual, rtol=rtol, atol=atol) | |||
|
|||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag): | |||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag, reduced_precision=False): |
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.
this doesn’t test sparseadam nor lbfgs since they do not have foreach/multitensor impls.
moreover, it looks like sparseadam doesn’t have its step as a tensor like the majority of our optimizers. moving step to be a tensor is a separate change that includes adding warnings and tests (as it’s BC breaking) and I would recommend moving the sparseadam changes to a separate PR and only focusing on the foreach impls in this one.
If you’re up for it, RMSProp and Rprop also were accidentally left out of the step to Tensor migration (done by @mikaylagawarecki almost 2 yrs ago) and should be brought into the fold. 😄
@@ -736,7 +736,7 @@ def _test_derived_optimizers_varying_tensors(self, optimizer_with_kwargs, kwarg) | |||
actual = mt_p_state[k] | |||
self.assertEqual(st_p_state[k], actual, rtol=rtol, atol=atol) | |||
|
|||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag): | |||
def _test_derived_optimizers(self, optimizer_pairs_with_flags, flag, reduced_precision=False): |
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.
this doesn’t test sparseadam nor lbfgs since they do not have foreach/multitensor impls.
moreover, it looks like sparseadam doesn’t have its step as a tensor like the majority of our optimizers. moving step to be a tensor is a separate change that includes adding warnings and tests (as it’s BC breaking) and I would recommend moving the sparseadam changes to a separate PR and only focusing on the foreach impls in this one.
If you’re up for it, Adadelta, RMSProp and Rprop also were accidentally left out of the step to Tensor migration (done by @mikaylagawarecki almost 2 yrs ago) and should be brought into the fold. 😄
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.
hey--I am back. @jon-chuang How can I help get this over the finish line? Would want this in sooner rather than later!
Hello @janeyx99, great! Apologies for the lack of movement on this. Let me prioritize this today. |
@janeyx99 should be as requested now |
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.
thanks! let's ship this thing :D
@pytorchbot merge -r |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
The merge job was canceled. If you believe this is a mistake, then you can re trigger it through pytorch-bot. |
7f17207
to
18d6b92
Compare
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Rely on built in bash conditionals for doing the if statement rather than relying on $? To avoid issues observed in #111008 (comment) Signed-off-by: Eli Uriegas <eliuriegasmeta.com> [ghstack-poisoned]
Rely on built in bash conditionals for doing the if statement rather than relying on $? To avoid issues observed in #111008 (comment) Signed-off-by: Eli Uriegas <eliuriegas@meta.com> Pull Request resolved: #114295 Approved by: https://github.com/huydhn, https://github.com/malfet
Fixes #110940
cc @janeyx99 @crcrpar