-
Notifications
You must be signed in to change notification settings - Fork 25
[Feature Enhancement] add subgrpah fetch tools: typical_sequence #239
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
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
# 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) |
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.
问:所提取出来的 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 |
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.
没有实现全的代码,一律 return TODO()
|
||
# Generate unittests for each sequence | ||
# Each folder: subgraph_<hash_id>_<count_id>.py | ||
SequenceUnittestsGenerator(program_id, seq_stmts, dist_model_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.
program_id, seq_stmts
这两个变量没有定义,肯定理解错了,应该是program_seq_stmts_list
,这现在是一个 generator。为了便于理解,你可以在这句话前加一行:
program_seq_stmts_list = list(program_seq_stmts_list)
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
?