Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Open
HeyDavid633 wants to merge 1 commit into PaddlePaddle:develop
base: develop
Choose a base branch
Loading
from HeyDavid633:add_typical_sequence

Conversation

@HeyDavid633
Copy link
Contributor

@HeyDavid633 HeyDavid633 commented Aug 25, 2025
edited
Loading

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> ,这个目录下复刻整图目录的内容

但是尤其存在以下疑问

  • Line49 所提取出来的 fx_graphs 为什么是多个的? 从整图中提取如果是多个 那不是已经在进行划分了吗
  • Line78 的结构如何在 torch 这里的逻辑下,得到像 Paddle 中的 program_seq_stmts_list ?

Copy link

paddle-bot bot commented Aug 25, 2025

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

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

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lixinqi lixinqi lixinqi left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /