-
Notifications
You must be signed in to change notification settings - Fork 45
Implement graph_net/torch/op_names_extractor.py as a subclass of SamplePass. #535
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
|
Thanks for your contribution! |
3663c8f to
130c799
Compare
| from graph_net.sample_pass.sample_pass import SamplePass | ||
|
|
||
|
|
||
| class OpNamesExtractor(SamplePass): |
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.
参考https://github.com/PaddlePaddle/GraphNet/blob/develop/graph_net/torch/sample_pass/device_rewrite_sample_pass.py#L11
让OpNamesExtractor继承ResumableSamplePassMixin。让其拥有resume能力。
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.
收到
| self.config = self._make_config(**config) | ||
|
|
||
| def declare_config( | ||
| self, model_path_prefix: str, output_dir: str, resume: bool = 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.
参考DeviceRewriteSamplePass,需要包含ResumableSamplePassMixin.declare_config的所有字段。
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.
收到
| ): | ||
| pass | ||
|
|
||
| def __call__(self, rel_model_path: str): |
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.
这个函数的内容应该移动到新的resume里。相关的sample_handled逻辑也得准备好。
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.
好的
…actor using ResumableSamplePassMixin

PR Category
other
Description
Implement graph_net/torch/op_names_extractor.py as a subclass of SamplePass.