Skip to content

Conversation

@WHoutstanding
Copy link
Contributor

PR Category

other

Description

Fix outpit_dir of dtype generalization pass

@paddle-bot
Copy link

paddle-bot bot commented Feb 2, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Feb 2, 2026
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以和其他pass一样,使用rel_model_path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到

"weight_meta.py",
"input_meta.py",
"input_tensor_constraints.py",
"graph_hash.txt",
Copy link
Collaborator

Choose a reason for hiding this comment

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

graph_hash.txt应该是使用model.py的代码生成的:

from graph_net.hash_util import get_sha256_hash

file_hash = get_sha256_hash(py_code)
(Path(model_path) / "graph_hash.txt").write_text(file_hash)

另外,作用于子图的话,还有个subgraph_sources.json需要拷贝,这样原始样本里面没有,你直接一起拷贝哈。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

subgraph_sources.json是还没有是吗,我直接copy了

Copy link
Collaborator

Choose a reason for hiding this comment

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

subgraph_sources.json原始整图样本里面没有,子图样本里面会存在,你判断下存在就拷贝。

output_sample_dir.mkdir(parents=True, exist_ok=True)

# Copy all files
for fname in [
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里和 L404 都有对样本文件的拷贝,考虑优化下代码

@Xreki
Copy link
Collaborator

Xreki commented Feb 2, 2026

还有一处,也请一起修改下吧,就是样本试跑,config里面加一个参数try_run来控制,可以参考下别的已有的pass。下面3个配置可以直接写死在代码里面吧,不需要外面传入。

"model_runnable_predicator_filepath": "...",
"model_runnable_predicator_class_name": "...",
"model_runnable_predicator_config": {...},

Copy link
Collaborator

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM

@Xreki Xreki merged commit b6bc9cd into PaddlePaddle:develop Feb 2, 2026
3 checks passed
@WHoutstanding WHoutstanding deleted the fix_output_dir branch February 2, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants