diff --git a/onnxruntime/core/framework/kernel_registry.cc b/onnxruntime/core/framework/kernel_registry.cc index cb6e8bc83f..2b73bd6d19 100644 --- a/onnxruntime/core/framework/kernel_registry.cc +++ b/onnxruntime/core/framework/kernel_registry.cc @@ -255,7 +255,7 @@ const KernelCreateInfo* KernelRegistry::TryFindKernel(const onnxruntime::Node& n const auto& expected_provider = (node_provider.empty() ? exec_provider : node_provider); auto range = kernel_creator_fn_map_.equal_range(GetMapKey(node.OpType(), node.Domain(), expected_provider)); - std::vector error_strs; + std::vector verify_kernel_def_error_strs; for (auto i = range.first; i != range.second; ++i) { if (!i->second.status.IsOK()) { LOGS_DEFAULT(ERROR) << "Failed to create kernel for op: " << node.OpType() @@ -266,10 +266,13 @@ const KernelCreateInfo* KernelRegistry::TryFindKernel(const onnxruntime::Node& n if (VerifyKernelDef(node, *i->second.kernel_def, error_str)) { return &i->second; } - error_strs.push_back(error_str); + verify_kernel_def_error_strs.push_back(error_str); + } + + if (!verify_kernel_def_error_strs.empty()) { + LOGS_DEFAULT(INFO) << node.OpType() << " kernel is not supported in " << expected_provider + << " Encountered following errors: (" << ToString(verify_kernel_def_error_strs) << ")"; } - LOGS_DEFAULT(INFO) << node.OpType() << " kernel is not supported in " << expected_provider - << " Encountered following errors: " << ToString(error_strs); return nullptr; } diff --git a/onnxruntime/core/providers/cuda/cuda_execution_provider.cc b/onnxruntime/core/providers/cuda/cuda_execution_provider.cc index b22304fd1f..f4edd3b787 100644 --- a/onnxruntime/core/providers/cuda/cuda_execution_provider.cc +++ b/onnxruntime/core/providers/cuda/cuda_execution_provider.cc @@ -76,10 +76,15 @@ CUDAExecutionProvider::CUDAExecutionProvider(const CUDAExecutionProviderInfo& in // TODO: this is actually used for the cuda kernels which explicitly ask for inputs from CPU. // This will be refactored/removed when allocator and execution provider are decoupled. - DeviceAllocatorRegistrationInfo cpu_memory_info({ - OrtMemTypeCPUInput, - [](int device_id) { return onnxruntime::make_unique(onnxruntime::make_unique("CUDA_CPU", OrtAllocatorType::OrtDeviceAllocator, OrtDevice(), device_id, OrtMemTypeCPUInput)); }, - std::numeric_limits::max()}); + DeviceAllocatorRegistrationInfo cpu_memory_info({OrtMemTypeCPUInput, + [](int device_id) { return onnxruntime::make_unique( + onnxruntime::make_unique( + "CUDA_CPU", + OrtAllocatorType::OrtDeviceAllocator, + OrtDevice(), + device_id, + OrtMemTypeCPUInput)); }, + std::numeric_limits::max()}); InsertAllocator(CreateAllocator(cpu_memory_info, CPU_ALLOCATOR_DEVICE_ID)); } @@ -499,8 +504,10 @@ class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 7, MLFloat16, LSTM); class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 1, 9, int32_t, Slice); class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 1, 9, int64_t, Slice); +class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 1, 9, float, Slice); class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 10, int32_t, Slice); class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 10, int64_t, Slice); +class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 10, float, Slice); class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 9, Compress); class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 9, Flatten); class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(kCudaExecutionProvider, kOnnxDomain, 7, 9, float, Upsample); @@ -850,8 +857,10 @@ static void RegisterCudaKernels(KernelRegistry& kernel_registry) { BuildKernelCreateInfo, BuildKernelCreateInfo, BuildKernelCreateInfo, + BuildKernelCreateInfo, BuildKernelCreateInfo, BuildKernelCreateInfo, + BuildKernelCreateInfo, BuildKernelCreateInfo, BuildKernelCreateInfo, BuildKernelCreateInfo, diff --git a/onnxruntime/core/providers/cuda/tensor/slice.cc b/onnxruntime/core/providers/cuda/tensor/slice.cc index 30a4152405..d7a8f632c2 100644 --- a/onnxruntime/core/providers/cuda/tensor/slice.cc +++ b/onnxruntime/core/providers/cuda/tensor/slice.cc @@ -20,6 +20,7 @@ namespace cuda { REGISTER_VERSIONED_TYPED_SLICE(int32_t) REGISTER_VERSIONED_TYPED_SLICE(int64_t) +REGISTER_VERSIONED_TYPED_SLICE(float) #define REGISTER_V10_TYPED_SLICE(TIND) \ ONNX_OPERATOR_TYPED_KERNEL_EX( \ @@ -38,6 +39,7 @@ REGISTER_VERSIONED_TYPED_SLICE(int64_t) REGISTER_V10_TYPED_SLICE(int32_t) REGISTER_V10_TYPED_SLICE(int64_t) +REGISTER_V10_TYPED_SLICE(float) template Status Slice::ComputeInternal(OpKernelContext* ctx) const {