[Feature Enhancement] add subgrpah fetch tools: typical_sequence#239
Open
HeyDavid633 wants to merge 1 commit intoPaddlePaddle:developfrom
Open
[Feature Enhancement] add subgrpah fetch tools: typical_sequence#239HeyDavid633 wants to merge 1 commit intoPaddlePaddle:developfrom
HeyDavid633 wants to merge 1 commit intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
HeyDavid633
commented
Aug 25, 2025
HeyDavid633
commented
Aug 25, 2025
lixinqi
reviewed
Aug 25, 2025
| # Extract fx_graphs from src_model_path, type: fx.graphmodule | ||
| fx_graphs = [ | ||
| fx_graph | ||
| for leaf_model_path in _get_leaf_model_pathes(src_model_path) |
Collaborator
There was a problem hiding this comment.
问:所提取出来的 fx_graphs 为什么是多个的?
答:src_model_path 这个路径下可能不止有一个计算图,也许是整个 samples 目录塞进来。
|
|
||
| def _get_leaf_model_pathes(src_model_path: str): | ||
| # Traverse all submodule (features.0, classifier.6) in src_model_path | ||
| return |
Collaborator
There was a problem hiding this comment.
没有实现全的代码,一律 return TODO()
|
|
||
| # Generate unittests for each sequence | ||
| # Each folder: subgraph_<hash_id>_<count_id>.py | ||
| SequenceUnittestsGenerator(program_id, seq_stmts, dist_model_path) |
Collaborator
There was a problem hiding this comment.
program_id, seq_stmts 这两个变量没有定义,肯定理解错了,应该是program_seq_stmts_list ,这现在是一个 generator。为了便于理解,你可以在这句话前加一行:
program_seq_stmts_list = list(program_seq_stmts_list)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Feature Enhancement
Description
当前 PR 单独提交了
typical_sequence.py当前代码的目标仍然是只提取单个的模型;还没有泛化到提取所有模型子图。例如对于
src_model_path下的模型GraphNet/samples/torchvision/alexnet,读取其 6 个文件生成的
dist_model_path下的 模型应该在目录GraphNet/subgraphs/torchvision/alexnet/subgraph_<hash>_<count>,这个目录下复刻整图目录的内容但是尤其存在以下疑问
program_seq_stmts_list?