Skip to content
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

[PIR+CINN]Add FusionInfo interface and Polish CompilationCache #63269

Merged
merged 11 commits into from
Apr 12, 2024

Conversation

Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Apr 6, 2024

PR Category

CINN

PR Types

New features

Description

Pcard-67164

  1. 添加了FusionInfo,依次内含OperationInfo、ValueInfo、AttributeInfo,表示一个FusionOp对应的静态化Group信息。其中ValueInfo里包含了Type的所有信息(如Shape、dtype等),AttributeInfo包含了Op属性信息,也包含了S0、S1类似的符号化信息;
  2. 优化了PirCompiler里并行编译的线程设置。默认使用unqiue_and_new_group_size(若超出硬件最大支持线程数,则使用硬件层线程数);如果指定FLAGS_enbale_compile_cache=false,则强制设置线程池中线程数为1,表示串行编译,同时禁掉缓存策略,方便后期分析是否是缓存策略引入的问题。
  3. 将group.h中的函数改为仅声明形式,把定义移动到了group.cc,方便查看group的接口

hidden_layer_size=8下,llama 101个子图去重后只有22个:
image

image

在支持过程中发现了其他模块待优化的地方:

  1. group以const shared_ptr传递给BuketLower后,在BuketLower内部存在使用Mut接口修改group信息的用法,违反const的直觉,容易引入问题
  2. group中int_args_map关键信息的处理是在PostProcess里做的,其实可以在构建完Group之后就可以解析出来,也应该将此信息做我FusionInfo的成员来计算hash

Copy link

paddle-bot bot commented Apr 6, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

fix compilation problem

fix conflict

fix conflict

fix compilation problem

fix UT
@Aurelius84 Aurelius84 changed the title [WIP][PIR+CINN]Add FusionInfo interface and Polish CompilationCache [PIR+CINN]Add FusionInfo interface and Polish CompilationCache Apr 10, 2024
tc20042008
tc20042008 previously approved these changes Apr 11, 2024
@Aurelius84 Aurelius84 merged commit d60ed19 into PaddlePaddle:develop Apr 12, 2024
29 checks passed
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