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

[ROCM] add custom op support, test=develop #36771

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

qili93
Copy link
Contributor

@qili93 qili93 commented Oct 27, 2021

PR types

New features

PR changes

Others

Describe

Revert PR #34050 add custom op support for ROCM.

Verification steps:

  1. Exactly same code with CUDA custom op such as setup_cuda.py

https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/07_new_op/new_custom_op_cn.html

from paddle.utils.cpp_extension import CUDAExtension, setup

setup(
    name='custom_setup_ops',
    ext_modules=CUDAExtension(
        sources=['relu_cuda.cc', 'relu_cuda.cu']
    )
)
  1. python setup_cuda.py install

image

  1. run custom op test with test.py content

image

Also unit test result on ROCM here:

image

@paddle-bot-old
Copy link

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

@qili93 qili93 requested a review from chenwhql October 27, 2021 05:27
@@ -401,15 +401,18 @@ def unix_custom_single_compiler(obj, src, ext, cc_args, extra_postargs,
# with dict type is dangerous.
src = os.path.abspath(src)
cflags = copy.deepcopy(extra_postargs)
print("0------------ cflags=", cflags)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个print提示是确定要保留的吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

忘记删 debug code了,已删,谢谢!

try:
original_compiler = self.compiler.compiler_so
# nvcc compile CUDA source
print("original_compiler=", original_compiler)
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.

忘记删 debug code了,已删,谢谢!

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

@qili93 qili93 requested a review from Aurelius84 October 27, 2021 08:38
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.

LGTM

@qili93 qili93 merged commit dd1d378 into PaddlePaddle:develop Oct 27, 2021
@qili93 qili93 deleted the rocm_custom_op branch October 27, 2021 12:08
ghost pushed a commit to piotrekobi/Paddle that referenced this pull request Nov 3, 2021
* [ROCM] add custom op support, test=develop

* remove debug codes, test=develop
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