未验证 提交 56410b4a 编写于 作者: Q Qi Li 提交者: GitHub

[MLU] add compile ci scripts for MLU, test=mlu_ci (#39122)

上级 a8879215
proto_library(index_dataset_proto SRCS index_dataset.proto)
cc_library(index_wrapper SRCS index_wrapper.cc DEPS index_dataset_proto fs)
if(WITH_MKLDNN)
cc_library(index_sampler SRCS index_sampler.cc DEPS xxhash index_wrapper mkldnn)
cc_library(index_sampler SRCS index_sampler.cc DEPS xxhash index_wrapper eigen3 mkldnn)
else()
cc_library(index_sampler SRCS index_sampler.cc DEPS xxhash index_wrapper)
cc_library(index_sampler SRCS index_sampler.cc DEPS xxhash index_wrapper eigen3)
endif()
if(WITH_PYTHON)
py_proto_compile(index_dataset_py_proto SRCS index_dataset.proto)
......
......@@ -45,7 +45,8 @@ class ConcatMLUKernel : public framework::OpKernel<T> {
ins_dims[i] = ins[i]->dims();
}
framework::DDim out_dims = ComputeAndCheckShape(true, ins_dims, axis);
framework::DDim out_dims =
pten::funcs::ComputeAndCheckShape(true, ins_dims, axis);
out->Resize(out_dims);
}
const int axis_t = axis;
......
......@@ -63,7 +63,8 @@ class FillConstantMLUKernel : public framework::OpKernel<T> {
framework::Tensor mlu_tensor;
auto tmp_place = value_tensor->place();
if (platform::is_mlu_place(tmp_place)) {
TensorCopySync(*value_tensor, platform::CPUPlace(), &mlu_tensor);
framework::TensorCopySync(*value_tensor, platform::CPUPlace(),
&mlu_tensor);
tensor_data = mlu_tensor.data<T>();
}
value = tensor_data[0];
......
IF(WITH_MLU)
cc_library(mlu_baseop SRCS mlu_baseop.cc DEPS neuware_lib framework_proto xxhash)
cc_library(mlu_baseop SRCS mlu_baseop.cc DEPS neuware_lib device_context)
cc_test(activation_op_mlu_test SRCS activation_op_mlu_test.cc DEPS op_registry activation_op scope device_context executor)
ENDIF()
......@@ -58,7 +58,6 @@ class SplitMLUKernel : public framework::OpKernel<T> {
std::vector<void*> vct_tensor;
std::vector<MLUCnnlTensorDesc> output_descs;
std::vector<cnnlTensorDescriptor_t> desc_vector;
auto place = ctx.GetPlace();
for (size_t i = 0; i < outs.size(); i++) {
outs[i]->mutable_data<T>(ctx.GetPlace());
output_descs.emplace_back(MLUCnnlTensorDesc(
......
......@@ -33,7 +33,7 @@ class SumMLUKernel : public framework::OpKernel<T> {
auto place = ctx.GetPlace();
int ins_size = static_cast<int>(ins.size());
if (ins_size == 1) {
TensorCopy(*ins[0], place, out);
framework::TensorCopy(*ins[0], place, out);
return;
}
......
......@@ -55,6 +55,12 @@ ENDIF()
cc_library(place SRCS place.cc DEPS enforce boost pten_place)
cc_test(place_test SRCS place_test.cc DEPS place glog gflags)
IF(WITH_MKLDNN)
set(MKLDNN_CTX_DEPS mkldnn)
ELSE()
set(MKLDNN_CTX_DEPS)
ENDIF()
add_subdirectory(device)
add_subdirectory(dynload)
add_subdirectory(stream)
......@@ -85,12 +91,6 @@ IF(WITH_MLU)
set(MLU_CTX_DEPS mlu_device_context)
ENDIF()
IF(WITH_MKLDNN)
set(MKLDNN_CTX_DEPS mkldnn)
ELSE()
set(MKLDNN_CTX_DEPS)
ENDIF()
IF(WITH_ASCEND_CL OR WITH_MLU)
cc_library(stream_callback_manager SRCS stream_callback_manager.cc DEPS simple_threadpool enforce)
ENDIF()
......
# GPU
IF(WITH_GPU OR WITH_ROCM)
add_subdirectory(gpu)
ENDIF()
# XPU
IF(WITH_XPU)
add_subdirectory(xpu)
ENDIF()
IF(WITH_GPU OR WITH_ROCM)
add_subdirectory(gpu)
ENDIF()
# NPU
IF(WITH_ASCEND OR WITH_ASCEND_CL)
......
IF(WITH_MLU)
cc_test(mlu_enforce_test SRCS enforce_test.cc DEPS stringpiece)
cc_library(mlu_info SRCS mlu_info.cc DEPS enforce glog monitor neuware_lib)
if(NOT WITH_MLU)
return()
endif()
cc_library(mlu_stream SRCS mlu_stream.cc DEPS boost mlu_info stream_callback_manager)
cc_library(mlu_device_context SRCS device_context.cc DEPS mlu_stream eigen3)
cc_test(mlu_device_context_test SRCS device_context_test.cc DEPS mlu_device_context)
ENDIF()
cc_test(mlu_enforce_test SRCS enforce_test.cc DEPS stringpiece)
cc_library(mlu_info SRCS mlu_info.cc DEPS enforce glog monitor neuware_lib)
cc_library(mlu_stream SRCS mlu_stream.cc DEPS boost mlu_info stream_callback_manager eigen3 ${MKLDNN_CTX_DEPS})
cc_library(mlu_device_context SRCS device_context.cc DEPS mlu_stream)
cc_test(mlu_device_context_test SRCS device_context_test.cc DEPS mlu_device_context)
IF(WITH_MKLDNN)
set(MKLDNN_CTX_DEPS mkldnn)
ELSE()
set(MKLDNN_CTX_DEPS)
ENDIF()
IF(WITH_GPU OR WITH_ROCM)
cc_library(cuda_stream SRCS cuda_stream.cc DEPS enforce boost ${MKLDNN_CTX_DEPS})
cc_library(cuda_stream SRCS cuda_stream.cc DEPS enforce boost eigen3 ${MKLDNN_CTX_DEPS})
ENDIF()
......@@ -227,6 +227,7 @@ function cmake_base() {
-DWITH_GLOO=${gloo_flag}
-DWITH_LITE=${WITH_LITE:-OFF}
-DWITH_XPU=${WITH_XPU:-OFF}
-DWITH_MLU=${WITH_MLU:-OFF}
-DLITE_GIT_TAG=release/v2.10
-DWITH_UNITY_BUILD=${WITH_UNITY_BUILD:-OFF}
-DWITH_XPU_BKCL=${WITH_XPU_BKCL:-OFF}
......@@ -275,6 +276,7 @@ EOF
-DWITH_GLOO=${gloo_flag} \
-DLITE_GIT_TAG=release/v2.10 \
-DWITH_XPU=${WITH_XPU:-OFF} \
-DWITH_MLU=${WITH_MLU:-OFF} \
-DXPU_SDK_ROOT=${XPU_SDK_ROOT:-""} \
-DWITH_LITE=${WITH_LITE:-OFF} \
-DWITH_XPU_BKCL=${WITH_XPU_BKCL:-OFF} \
......
FROM registry.baidubce.com/qili93/paddle-mlu:neuware-latest
RUN apt-get install pigz -y
RUN apt-get remove -y openjdk*
CMD ["/bin/bash"]
EXPOSE 22
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册