Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cmake/cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ elseif(${CMAKE_CUDA_COMPILER_VERSION} LESS 13.0) # CUDA 12.0+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Wno-deprecated-gpu-targets")
endif()

if(NOT ${CMAKE_CUDA_COMPILER_VERSION} LESS 10.0)
add_definitions("-DTRT_PLUGIN_FP16_AVAILABLE")
endif()

add_definitions("-DCUDA_VERSION_MAJOR=\"${CUDA_VERSION_MAJOR}\"")
add_definitions("-DCUDA_VERSION_MINOR=\"${CUDA_VERSION_MINOR}\"")
add_definitions("-DCUDA_TOOLKIT_ROOT_DIR=\"${CUDA_TOOLKIT_ROOT_DIR}\"")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@ bool MultiheadMatmulRoformerPlugin::supportsFormatCombination(
const nvinfer1::PluginTensorDesc &in = in_out[pos];
if (pos == 0) {
if (with_fp16_) {
#ifdef TRT_PLUGIN_FP16_AVAILABLE
return (in.type == nvinfer1::DataType::kFLOAT ||
in.type == nvinfer1::DataType::kHALF) &&
(in.format == nvinfer1::TensorFormat::kLINEAR);
#else
return (in.type == nvinfer1::DataType::kFLOAT) &&
(in.format == nvinfer1::TensorFormat::kLINEAR);
#endif
} else {
return (in.type == nvinfer1::DataType::kFLOAT) &&
(in.format == nvinfer1::TensorFormat::kLINEAR);
Expand Down Expand Up @@ -270,7 +265,6 @@ int MultiheadMatmulRoformerPlugin::enqueue(
tptr, output, batch, seq_len, head_number_, head_size_);

} else if (input_type == nvinfer1::DataType::kHALF) {
#ifdef TRT_PLUGIN_FP16_AVAILABLE
VLOG(1) << "TRT Plugin DataType selected. QkvToContext-->fp16";
auto *multihead_temp_data =
multihead_temp_tensor.mutable_data<int16_t>( // NOLINT
Expand Down Expand Up @@ -353,14 +347,6 @@ int MultiheadMatmulRoformerPlugin::enqueue(
half *output = static_cast<half *>(outputs[0]);
transpose<half><<<grid, block, 0, stream>>>(
tptr, output, batch, seq_len, head_number_, head_size_);
#else
PADDLE_THROW(common::errors::Fatal(
"The Ernie(Bert) TensorRT Plugin should be "
"complied with CUDA version >= 10.0 when running with fp16. "
"Please recompile it or try to use fp32 by set "
"config.SetTRTDynamicShapeInfo(min_input_shape, "
"max_input_shape, opt_input_shape, true"));
#endif
} else {
PADDLE_THROW(common::errors::Fatal(
"The QKV TRT Plugin's input type should be float or half."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ inline int getSMVersion() {
return prop.major * 10 + prop.minor;
}

#ifdef TRT_PLUGIN_FP16_AVAILABLE
#define FINAL_MASK 0xffffffff

template <int UNROLL_FACTOR>
Expand Down Expand Up @@ -105,8 +104,6 @@ __global__ void GeneralResidualLayerNormOpt2(half2 *normed_output,
half_n, \
eps);

#endif

int TransLayerNormPluginDynamic::initialize() TRT_NOEXCEPT {
if (!with_fp16_) {
cudaMalloc(&bias_gpu_, sizeof(float) * bias_.size());
Expand Down
Loading