-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Fix QuantizableMobileNetV3 weight loading issue #4966
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
💊 CI failures summary and remediationsAs of commit 9d1a609 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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 @datumbox! Should we add a unit test to cover this?
@prabhat00155 Yes, we should. Unfortunately we can't do it yet. To test it we would need to download the weights and try to load them on the model. Our current practice is to avoid downloading the weights in all tests to avoid flakiness. I think we should review this an redesign our model testing approach. This is probably a big effort and we should plan for it. |
IIUC, we want to test loading the state dict, right? If yes, the solution is probably not that hard to achieve. Can't we have a separate test that loads the model with from collections import OrderedDict
state_dict = OrderedDict([(name, torch.randn_like(weight)) for name, weight in model.state_dict()])
model.load_state_dict(state_dict)
torch.testing.assert_close(model.state_dict(), state_dict) |
@pmeier It's a creative proposal. :) Unfortunately I don't think this tests all scenarios because it assumes that the current keys retrieved from |
In that case, there is probably little we can do besides #4772 or downloading the weights in the background while doing something not I/O bound such as compiling |
Reviewed By: NicolasHug Differential Revision: D32694308 fbshipit-source-id: 1fde05de57fb7d0911a8b86ea364f66dc33bfe78
Fixes #4959
cc @pmeier, @NicolasHug This is a bug which wasn't caught due to our current testing strategy. Anything that depends on loading the real weights of the models is currently not covered.