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

[cmake治理]Compile ddim as separate dynamic library #58899

Conversation

risemeup1
Copy link
Contributor

@risemeup1 risemeup1 commented Nov 10, 2023

PR types

Others

PR changes

Others

Description

  • 功能

在paddle下新建目录common,将一些基础组件放在此目录,并编译成libcommon.so/dll,此PR下沉ddim.cc和enforce.cc,解除pir依赖phi里的ddim。

image

Pcard-67010

@risemeup1 risemeup1 changed the title Compile ddim as separate dynamic library [cmake治理]Compile ddim as separate dynamic library Nov 10, 2023
@risemeup1 risemeup1 force-pushed the compile_ddim_as_separate_dynamic_library branch from b392caf to d7ba4dd Compare November 13, 2023 07:55
@risemeup1 risemeup1 force-pushed the compile_ddim_as_separate_dynamic_library branch from d7ba4dd to d901433 Compare November 13, 2023 08:48
namespace framework {
template <int D>
using Dim = common::Dim<D>;

Copy link
Contributor

Choose a reason for hiding this comment

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

commom中为什么还要添加 paddle::framework::Dim?

namespace paddle {
namespace framework {

using DDim = common::DDim;
Copy link
Contributor

Choose a reason for hiding this comment

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

commom中为什么还要添加 paddle::framework::Dim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

应该删掉的,马上修改

__COMMON_BINARY_COMPARE(__VAL0, __VAL1, <=, >, __VA_ARGS__)

} // namespace enforce
using namespace enforce; // NOLINT
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.

已经删掉

#include <sstream>
#include <string>

namespace paddle {
Copy link
Contributor

Choose a reason for hiding this comment

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

common?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对,应该改成common

@@ -69,6 +69,11 @@ if(WIN32)
list(APPEND EAGER_CODEGEN_DEPS ${eager_generator_path}/ir.dll)
endif()

add_custom_command(
OUTPUT ${eager_generator_path}/common.dll
COMMAND ${CMAKE_COMMAND} -E copy ${COMMON_LIB} ${eager_generator_path})
Copy link
Contributor

Choose a reason for hiding this comment

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

有必要添加这个 dll 到eager_generator_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.

我删掉看看可以编的过吗

@risemeup1 risemeup1 force-pushed the compile_ddim_as_separate_dynamic_library branch from 6e38346 to 136a7bd Compare November 14, 2023 08:51
@@ -361,6 +362,10 @@ if(WITH_PYTHON)
list(APPEND EAGER_OP_IMPL_DEPS ${op_impl_path}/ir.dll)
endif()

add_custom_command(
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.

已经删掉

YuanRisheng
YuanRisheng previously approved these changes Nov 15, 2023
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@risemeup1 risemeup1 merged commit cd6a7a4 into PaddlePaddle:develop Nov 15, 2023
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
* refine

* add common direcotry

* fix codestyle

* compile ddim.cc in common direcotry

* fix windows compile bug

* fix windows bug

* fix windows bug

* fix windows bug

* fix windows bug

* fix windows bug

* fix bug

* fix mac bug

* fix windows test

* fix bug

* delete some invalid code

* delete some unvalid code

---------

Co-authored-by: Wang Huan <wanghuan29@baidu.com>
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.

6 participants