Skip to content

Conversation

@Honglei-Qiu
Copy link
Contributor

@Honglei-Qiu Honglei-Qiu commented Jan 9, 2026

PR Category

other

Description

Implement graph_net/torch/op_names_extractor.py as a subclass of SamplePass.

@paddle-bot
Copy link

paddle-bot bot commented Jan 9, 2026

Thanks for your contribution!

@Honglei-Qiu Honglei-Qiu changed the title other Implement graph_net/torch/op_names_extractor.py as a subclass of SamplePass. Jan 9, 2026
@Honglei-Qiu
Copy link
Contributor Author

Honglei-Qiu commented Jan 9, 2026

截屏2026-01-09 11 26 51 测试成功

from graph_net.sample_pass.sample_pass import SamplePass


class OpNamesExtractor(SamplePass):
Copy link
Collaborator

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能力。

Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考DeviceRewriteSamplePass,需要包含ResumableSamplePassMixin.declare_config的所有字段。

Copy link
Contributor Author

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数的内容应该移动到新的resume里。相关的sample_handled逻辑也得准备好。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@Honglei-Qiu Honglei-Qiu closed this Jan 9, 2026
@Honglei-Qiu Honglei-Qiu deleted the feature/q0 branch January 12, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants