Skip to content

[CustomOp]Support MacOS platform and Remove libpaddle_custom_op.so dependency#31976

Merged
Aurelius84 merged 13 commits intoPaddlePaddle:developfrom
Aurelius84:pr-31813
Apr 9, 2021
Merged

[CustomOp]Support MacOS platform and Remove libpaddle_custom_op.so dependency#31976
Aurelius84 merged 13 commits intoPaddlePaddle:developfrom
Aurelius84:pr-31813

Conversation

@Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Mar 31, 2021

PR types

New features

PR changes

Others

Describe

What's New?

Custom Op supports to compile on MacOS platform

1. Remove libpaddle_custom_op.so

After this PR, we no long link libpaddle_custom_op.so on Linux and libpaddle_custom_op.dylib on Mac platform. Of course, we don't need to cc_library them and inlcude into bdist whl. The main benefit is to decrease the size of Paddle whl package.

2. Only Need core_(no)avx.so

We finally decouple the third DSO lib and only rely on core_(no)avx.so. According our experiment, the cost time is almost same as before.

zh doc: PaddlePaddle/docs#3413

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@Aurelius84 Aurelius84 changed the title [CustomOp]Support with MacOS [CustomOp]Support with MacOS platform and Remove libpaddle_custom_op.so dependency Apr 7, 2021
@Aurelius84 Aurelius84 changed the title [CustomOp]Support with MacOS platform and Remove libpaddle_custom_op.so dependency [CustomOp]Support MacOS platform and Remove libpaddle_custom_op.so dependency Apr 7, 2021
self.build_lib = self.output_dir

def build_extensions(self):
if OS_NAME.startswith("darwin"):
Copy link
Contributor

Choose a reason for hiding this comment

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

why only need to check mac compiler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because self.compiler will use gcc on some mac devices.

# create symbol link
if not os.path.exists(new_lib_core_path):
try:
os.symlink(core_path, new_lib_core_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it be impossible to create symlnik here due to permission issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If users can install paddle, there will be no permission issues.

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants