未验证 提交 1885d55a 编写于 作者: Z zlsh80826 提交者: GitHub

CUDA12.0 integration (#49539)

* Update warpctc for cuda-12

* Deprecate cudaProfilerInitialize for CUDA > 11

* Deprecate CUSPARSE_MV_ALG_DEFAULT for CUDA_VERSION >= 11040

* Add the missing thrust header
上级 ea2e2495
......@@ -23,7 +23,7 @@ set(WARPCTC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/warpctc)
# in case of low internet speed
#set(WARPCTC_REPOSITORY https://gitee.com/tianjianhe/warp-ctc.git)
set(WARPCTC_REPOSITORY ${GIT_URL}/baidu-research/warp-ctc.git)
set(WARPCTC_TAG 37ece0e1bbe8a0019a63ac7e6462c36591c66a5b)
set(WARPCTC_TAG bdc2b4550453e0ef2d3b5190f9c6103a84eff184)
set(WARPCTC_INCLUDE_DIR
"${WARPCTC_INSTALL_DIR}/include"
......
......@@ -20,6 +20,7 @@ namespace platform {
void CudaProfilerInit(const std::string& output_file,
const std::string& output_mode,
const std::string& config_file) {
#if CUDA_VERSION < 11000
PADDLE_ENFORCE(output_mode == "kvp" || output_mode == "csv",
platform::errors::InvalidArgument(
"Unsupported cuda profiler output mode, expect `kvp` or "
......@@ -28,6 +29,7 @@ void CudaProfilerInit(const std::string& output_file,
cudaOutputMode_t mode = output_mode == "csv" ? cudaCSV : cudaKeyValuePair;
PADDLE_ENFORCE_GPU_SUCCESS(
cudaProfilerInitialize(config_file.c_str(), output_file.c_str(), mode));
#endif
}
void CudaProfilerStart() { PADDLE_ENFORCE_GPU_SUCCESS(cudaProfilerStart()); }
......
......@@ -381,7 +381,11 @@ void SparseBlas<phi::GPUContext>::SPMV(bool transa,
&beta,
out_descriptor.descriptor(),
gpu_type,
#if CUDA_VERSION >= 11040
CUSPARSE_SPMV_ALG_DEFAULT,
#else
CUSPARSE_MV_ALG_DEFAULT,
#endif
&buffer_size);
});
......@@ -399,7 +403,11 @@ void SparseBlas<phi::GPUContext>::SPMV(bool transa,
&beta,
out_descriptor.descriptor(),
gpu_type,
#if CUDA_VERSION >= 11040
CUSPARSE_SPMV_ALG_DEFAULT,
#else
CUSPARSE_MV_ALG_DEFAULT,
#endif
tmp_buffer_ptr);
});
}
......
......@@ -15,6 +15,7 @@
#include "paddle/phi/kernels/send_u_recv_kernel.h"
#include <thrust/device_vector.h>
#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <algorithm>
......
......@@ -15,6 +15,7 @@
#include "paddle/phi/kernels/send_ue_recv_kernel.h"
#include <thrust/device_vector.h>
#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <algorithm>
#include <vector>
......
......@@ -20,6 +20,7 @@
#include <thrust/functional.h>
#include <thrust/scatter.h>
#include <thrust/sequence.h>
#include <thrust/sort.h>
#include <thrust/unique.h>
#include <iostream>
......
......@@ -14,6 +14,9 @@ limitations under the License. */
#include "paddle/phi/kernels/sparse/coalesce_kernel.h"
#include <thrust/sort.h>
#include <thrust/unique.h>
#include "paddle/phi/backends/gpu/gpu_info.h"
#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/core/kernel_registry.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册