-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add tests to verify disabled optimizers #118919
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/118919
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b5e4cf5 with merge base e9b78f2 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 starting to do this; we should be more formal with our approach to include:
- all configs of each optimizer
- the unsupported forloop optimizer configs
- more clarity/maybe an invariant where "if the compiler can handle it, we test it and check the number of kernels, otherwise we just make sure it doesn't error". Today, this invariant isn't obvious so coverage isn't certain.
I left some chill comments on the test cases but I'm looking for a more overarching solution that would make the third point clear. One way I can see is having the current make_test pipe out configurations to "supported" and "unsupported" and then having the tests be made accordingly.
Leaving first round of review as there's merge conflict + as mentioned in review, it'd be good to use |
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.
Two highlevel questions:
I am not sure I like the story as much when there are caveats for the disabled configs being grouped as one. If we just lump them all into one, how do we differentiate disabled fused/forloop vs enabled foreach?
This leads to a more general question I’ve now been thinking about. Right now there are two tests, one that checks correctness and another that checks for correctness and kernel count. Theoretically, I’m imagining these can be the same test, which we can then pipe all the configs through. Maybe the default is to not check KERNEL COUNT unless it’s flagged in some way. I’m thinking this would make the test easier to maintain and allow it to be applied more generally across more configs—why do we not do this in the PR today?
The categories are basically optimizers that are fully disabled, and optimizers where some configs are disabled (ie forloop disabled, etc.). If an optimizer is fully disabled, it does not have an entry in the KernelCounts dict and a disabled test is created for it, which checks that the kernel count is zero, correctness matches eager and nothing else. If only a certain config is disabled we have carveouts in the non-disabled test. I could possibly reconcile these, but I don't really think it's necessary because in the end I do want to treat disabled tests differently because SparseAdam and LBFGS have their own initializations. I could abstract out the initializations, but it will basically save replicating the model code, which I don't find worth it, esp since it's pretty basic. Wdyt? |
Does this mean that some disabled configs are tested as a part of the non-disabled test? If so, that is conceptually confusing and is not an intuitive divide of tests.
The consolidation of code is just one pro. The stronger pro (and what I find necessary) is to be to able to have a test that just verifies " At this point, I prefer having one solid test for "
|
@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 |
Merge failedReason: 2 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@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 |
optim_inputs_func=optim_inputs_func_adadelta, | ||
optim_error_inputs_func=optim_error_inputs_func_adadelta, | ||
supported_impls=("foreach", "differentiable"), | ||
decorators=( |
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.
You definitely don't need all these!
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.
I think I do, I only want to require cuda on the tests that use cuda ..
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.
That should already be true....do you have an HUD link on what is failing?
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.
You should be able to apply a skip on the instantiated cuda class def itself
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.
Yeah I'm going to submit a PR to use skipCUDAIf, (Jane and I discussed offline)
As title
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler