From 417c732cc05978276d533c43070d24dfd6c892b7 Mon Sep 17 00:00:00 2001 From: shiyu1994 Date: Wed, 30 Mar 2022 16:51:51 +0800 Subject: [PATCH] [CUDA] Fix row-wise histogram construction with dense data matrix (#5103) * fix cuda exp with dense row wise * disable usage of multi val group in cuda exp --- src/io/dataset.cpp | 2 +- src/treelearner/cuda/cuda_histogram_constructor.cu | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/io/dataset.cpp b/src/io/dataset.cpp index de89bc531..a407f8af3 100644 --- a/src/io/dataset.cpp +++ b/src/io/dataset.cpp @@ -342,7 +342,7 @@ void Dataset::Construct(std::vector>* bin_mappers, auto is_sparse = io_config.is_enable_sparse; if (io_config.device_type == std::string("cuda") || io_config.device_type == std::string("cuda_exp")) { LGBM_config_::current_device = lgbm_device_cuda; - if (io_config.device_type == std::string("cuda") && is_sparse) { + if ((io_config.device_type == std::string("cuda") || io_config.device_type == std::string("cuda_exp")) && is_sparse) { Log::Warning("Using sparse features with CUDA is currently not supported."); is_sparse = false; } diff --git a/src/treelearner/cuda/cuda_histogram_constructor.cu b/src/treelearner/cuda/cuda_histogram_constructor.cu index 3bee9a749..bb9b96ddf 100644 --- a/src/treelearner/cuda/cuda_histogram_constructor.cu +++ b/src/treelearner/cuda/cuda_histogram_constructor.cu @@ -284,7 +284,11 @@ void CUDAHistogramConstructor::LaunchConstructHistogramKernelInner0( } else if (cuda_row_data_->row_ptr_bit_type() == 64) { LaunchConstructHistogramKernelInner1(cuda_smaller_leaf_splits, num_data_in_smaller_leaf); } else { - Log::Fatal("Unknown row_ptr_bit_type = %d", cuda_row_data_->row_ptr_bit_type()); + if (!cuda_row_data_->is_sparse()) { + LaunchConstructHistogramKernelInner1(cuda_smaller_leaf_splits, num_data_in_smaller_leaf); + } else { + Log::Fatal("Unknown row_ptr_bit_type = %d", cuda_row_data_->row_ptr_bit_type()); + } } }