-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Refac] Fix saving/loading models with device #477
Conversation
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.
Thank you @inafergra !
Overall looks good, I just pointed out a minor issue in the original qadence code that is still to be fixed.
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 @inafergra ,
- can we add a test which loads both legacy (without a device) and current checkpoints (with device) and asserts that they are successfully loaded?
- i remember @awennersteen proposed on the previous PR to handle both cases and log a error/debug in case the user uses legacy checkpoints. the most important thing is that this implementation handles both.
thanks!
Thanks for the comments Dominik. I added tests checking that both QNNs and QuantumModels can be loaded with the legacy ckpts names. The function |
Hey @inafergra have you tested how this modification with the device works with GPUs? |
Hey @gvelikova, yes I tested it in my local (single) gpu and it works fine |
hey @inafergra , @Roland-djee will take over the review here! |
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 this @inafergra. Can't say much since I'm less versed in torch intricacies than @gvelikova or @awennersteen (but slowly curing myself). So I let them be better judges at this point. Approving now but subjected to their final approval.
Changes are already implemented
@awennersteen if you don't have any more comments this should be ready to merge now |
Merging this now as discussed with @gvelikova, any additional changes can be included in a future PR solving #484 which also involves checkpointing. |
Fixes #475 following up on the work done by @dominikandreasseitz in this unfinished PR. The unfinished PR also included some refactoring of the
TrainConfig
class (not related to this bug) which was causing conflicts with main that were messy to solve, thus this new PR. As discussed, it would be better to add theTrainConfig
refactoring in a separate PR.