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] move pir, hlir code generating from make stage to cmake stage #59129

Merged
merged 9 commits into from
Nov 21, 2023

Conversation

MarioLulab
Copy link
Contributor

@MarioLulab MarioLulab commented Nov 19, 2023

PR types

Others

PR changes

Others

Description

主要工作

  1. paddle/fluid/pir/dialect/CMakeLists.txt 的代码生成逻辑从 build 阶段放到 cmake 阶段,由 cmake 生成对应的
    pd_op.h
    pd_op.cc
    pd_op_vjp.cc
    pd_api.h
    pd_api.cc
    static_op_function.h
    static_op_function.cc
    ops_api.cc

  2. paddle/cinn/hlir/dialect/operator/ir/CMakeLists.txt 的代码生成逻辑从 build 阶段放到 cmake 阶段,由 cmake 生成对应的
    ops.parsed.yaml
    cinn_op.cc
    cinn_op.h

存在风险:
没有改变 include 的路径,使得增量编译存在新老两个自动生成的头文件时,一个存在于 source 路径下,一个存在于 build 路径下,若不清理 build/paddle/fluid/pir 和 build/paddle/cinn 目录,会错误的引用老的头文件(即 build/ 目录下的头文件)。例如:

./build/paddle/fluid/pir/dialect/operator/ir/pd_op.h       <--------- 以前的 build 阶段生成的头文件
./paddle/fluid/pir/dialect/operator/ir/pd_op.h                         <---------- cmake 阶段生成的头文件

进而产生变量未声明的编译错误

Copy link

paddle-bot bot commented Nov 19, 2023

你的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.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 19, 2023
@MarioLulab MarioLulab marked this pull request as ready for review November 20, 2023 08:02
@MarioLulab MarioLulab changed the title [PIR] move pir op def, api, python_c, ops_api generating from build stage to cmake stage [PIR] move pir, hlir code generating from build stage to cmake stage Nov 20, 2023
include_directories(${CMAKE_CURRENT_BINARY_DIR})
delete include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
endforeach()

add_custom_target(
Copy link
Contributor

Choose a reason for hiding this comment

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

是否可以删除?

Copy link
Contributor

Choose a reason for hiding this comment

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

可以先推动合入,后续完善

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到。当前 pr 先推动合入,后续完善

Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

Great work!

@MarioLulab MarioLulab closed this Nov 21, 2023
@MarioLulab MarioLulab reopened this Nov 21, 2023
@MarioLulab MarioLulab changed the title [PIR] move pir, hlir code generating from build stage to cmake stage [PIR] move pir, hlir code generating from make stage to cmake stage Nov 21, 2023
@zhangbo9674 zhangbo9674 merged commit 20063ce into PaddlePaddle:develop Nov 21, 2023
28 checks passed
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
…addlePaddle#59129)

* initial modifying

* fix error for copy_if_different

* add add gitignore

* modify
paddle/cinn/hlir/dialect/operator/ir/CMakeLists.txt

* modify gitignore

* fix

* polish

* remove
include_directories(${CMAKE_CURRENT_BINARY_DIR})

* revert
delete include_directories(${CMAKE_CURRENT_BINARY_DIR})
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.

3 participants