-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add support for save and load mkldnn modules #20799
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
Differential Revision: D15447891 Differential Version: 82663074
dzhulgakov
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.
Btw, what happens if I just try to .save() a mkldnn tensor? does it magically convert to_dense? or do we produce a nice error message?
|
@pytorchbot retest this please |
|
@pytorchbot retest this please |
Differential Revision: D15447891 Differential Version: 82769280
Differential Revision: D15447891 Differential Version: 82814493
Differential Revision: D15447891 Differential Version: 82826426
Differential Revision: D15447891 Differential Version: 82829033
Differential Revision: D15447891 Differential Version: 82845519
Differential Revision: D15447891 Differential Version: 82882392
|
This pull request has been merged in 63585c3. |
| class MkldnnLinear(torch.jit.ScriptModule): | ||
| def __init__(self, dense_module): | ||
| super(MkldnnLinear, self).__init__() | ||
| self.register_buffer('weight', dense_module.weight.to_mkldnn()) |
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.
@bddppq , I doubt that why we regist weight to a buffer not a parameter, it is not suitable to training a mkldnn module if the weight is regist as a buffer. Can you tell me when we will use the jit save path?
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.
@bddppq , I have tried regist weight to a parameter to run backward, I found backward operation can be run, but the jit save and load have some problem, can you give me some advice? Thanks!
Stack:
:white_circle: #20820 Add mkldnn sigmoid operator 💚
:white_circle: #20800 Enable torch.jit.trace for mkldnn modules 💚
:black_circle: #20799 Add support for save and load mkldnn modules 💛
Pull Request resolved: #20799
Differential Revision: D15447891