"src/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "cdf96cafdfe96bde017581678d8d870a9867d152"
setup.py 2.15 KB
Newer Older
liangjing's avatar
liangjing committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import paddle.fluid.core as core
from paddle.utils.cpp_extension import CUDAExtension, setup

compile_dir = os.environ.get('/public/home/zhangqha/padd_install/padd_build.bert/Paddle', '/public/home/zhangqha/padd_install/padd_build.bert/Paddle/build')

define_macros = []
if core.is_compiled_with_mkldnn():
    define_macros.append(('PADDLE_WITH_MKLDNN', None))
if core.is_compiled_with_nccl():
    define_macros.append(('PADDLE_WITH_NCCL', None))
define_macros.append(('PADDLE_WITH_HIP', None))
define_macros.append(('PADDLE_WITH_RCCL', None))

setup(
    name='custom_setup_ops',
    ext_modules=CUDAExtension(
        sources=[
            #'./fused_dense_op/fused_dense_cuda.cc',
            #'./fused_dense_op/fused_dense_cuda.cu',
            ###'./fused_dropout_residual_ln/fused_dropout_residual_ln_cuda.cc',
            ###'./fused_dropout_residual_ln/fused_dropout_residual_ln_cuda.cu',
            #'./fmhalib/fmha_cuda.cc',
            #'./fmhalib/fmha_cuda.cu',
            './sort_bert_inputs_across_devices/sort_bert_inputs_across_devices.cc',
            './sort_bert_inputs_across_devices/sort_bert_inputs_across_devices.cu',
            './lr_op/lr_op_cuda.cc',
            './lr_op/lr_op_cuda.cu',
            './acc_merge/acc_merge.cc',
            './acc_merge/acc_merge.cu',
        ],
        # extra_objects=[os.path.join(apex_lib_dir, 'libfmha.so')],
        # include_dirs=[apex_dir],
        # library_dirs=[apex_lib_dir],
        # extra_link_args=['-lfmha', '-ldl', '-lcublas'],
        _compile_dir=compile_dir,
        define_macros=define_macros))