Commit 548cec82 authored by Jeff Daily's avatar Jeff Daily
Browse files

Merge branch 'master' into rocm3

parents 2f7bd8ef 5dbfcdc4
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_ #define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#ifdef USE_CUDA #ifdef USE_CUDA
...@@ -115,4 +115,4 @@ class CUDAGradientDiscretizer: public GradientDiscretizer { ...@@ -115,4 +115,4 @@ class CUDAGradientDiscretizer: public GradientDiscretizer {
} // namespace LightGBM } // namespace LightGBM
#endif // USE_CUDA #endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "cuda_histogram_constructor.hpp" #include "cuda_histogram_constructor.hpp"
#include <algorithm> #include <algorithm>
#include <vector>
namespace LightGBM { namespace LightGBM {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_ #define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#ifdef USE_CUDA #ifdef USE_CUDA
...@@ -193,4 +193,4 @@ class CUDAHistogramConstructor { ...@@ -193,4 +193,4 @@ class CUDAHistogramConstructor {
} // namespace LightGBM } // namespace LightGBM
#endif // USE_CUDA #endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_ #define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#ifdef USE_CUDA #ifdef USE_CUDA
...@@ -176,4 +176,4 @@ class CUDALeafSplits { ...@@ -176,4 +176,4 @@ class CUDALeafSplits {
} // namespace LightGBM } // namespace LightGBM
#endif // USE_CUDA #endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include <vector>
namespace LightGBM { namespace LightGBM {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_ #define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -162,4 +162,4 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner { ...@@ -162,4 +162,4 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
} // namespace LightGBM } // namespace LightGBM
#endif // USE_CUDA #endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#include <algorithm>
#include <cstring> #include <cstring>
#include <tuple> #include <tuple>
#include <vector> #include <vector>
...@@ -11,8 +12,7 @@ ...@@ -11,8 +12,7 @@
namespace LightGBM { namespace LightGBM {
template <typename TREELEARNER_T> template <typename TREELEARNER_T>
DataParallelTreeLearner<TREELEARNER_T>::DataParallelTreeLearner(const Config* config) DataParallelTreeLearner<TREELEARNER_T>::DataParallelTreeLearner(const Config* config):TREELEARNER_T(config) {
:TREELEARNER_T(config) {
} }
template <typename TREELEARNER_T> template <typename TREELEARNER_T>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_DATA_PARTITION_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
#define LIGHTGBM_TREELEARNER_DATA_PARTITION_HPP_ #define LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
#include <LightGBM/dataset.h> #include <LightGBM/dataset.h>
#include <LightGBM/meta.h> #include <LightGBM/meta.h>
...@@ -167,4 +167,4 @@ class DataPartition { ...@@ -167,4 +167,4 @@ class DataPartition {
}; };
} // namespace LightGBM } // namespace LightGBM
#endif // LightGBM_TREELEARNER_DATA_PARTITION_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
#include "feature_histogram.hpp" #include "feature_histogram.hpp"
#include <algorithm>
#include <vector>
namespace LightGBM { namespace LightGBM {
void FeatureHistogram::FuncForCategorical() { void FeatureHistogram::FuncForCategorical() {
...@@ -381,8 +384,11 @@ void FeatureHistogram::FindBestThresholdCategoricalInner(double sum_gradient, ...@@ -381,8 +384,11 @@ void FeatureHistogram::FindBestThresholdCategoricalInner(double sum_gradient,
} }
} }
template <bool USE_RAND, bool USE_MC, bool USE_L1, bool USE_MAX_OUTPUT, bool USE_SMOOTHING, typename PACKED_HIST_BIN_T, typename PACKED_HIST_ACC_T, template <
typename HIST_BIN_T, typename HIST_ACC_T, int HIST_BITS_BIN, int HIST_BITS_ACC> bool USE_RAND, bool USE_MC, bool USE_L1, bool USE_MAX_OUTPUT, bool USE_SMOOTHING,
typename PACKED_HIST_BIN_T, typename PACKED_HIST_ACC_T, typename HIST_BIN_T, typename HIST_ACC_T,
int HIST_BITS_BIN, int HIST_BITS_ACC
>
void FeatureHistogram::FindBestThresholdCategoricalIntInner(int64_t int_sum_gradient_and_hessian, void FeatureHistogram::FindBestThresholdCategoricalIntInner(int64_t int_sum_gradient_and_hessian,
const double grad_scale, const double hess_scale, const double grad_scale, const double hess_scale,
data_size_t num_data, data_size_t num_data,
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#define LIGHTGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_ #define LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#include <LightGBM/bin.h> #include <LightGBM/bin.h>
#include <LightGBM/dataset.h> #include <LightGBM/dataset.h>
...@@ -1594,4 +1594,4 @@ class HistogramPool { ...@@ -1594,4 +1594,4 @@ class HistogramPool {
}; };
} // namespace LightGBM } // namespace LightGBM
#endif // LightGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
...@@ -11,8 +11,7 @@ namespace LightGBM { ...@@ -11,8 +11,7 @@ namespace LightGBM {
template <typename TREELEARNER_T> template <typename TREELEARNER_T>
FeatureParallelTreeLearner<TREELEARNER_T>::FeatureParallelTreeLearner(const Config* config) FeatureParallelTreeLearner<TREELEARNER_T>::FeatureParallelTreeLearner(const Config* config):TREELEARNER_T(config) {
:TREELEARNER_T(config) {
} }
template <typename TREELEARNER_T> template <typename TREELEARNER_T>
......
...@@ -11,6 +11,11 @@ ...@@ -11,6 +11,11 @@
#include <LightGBM/utils/array_args.h> #include <LightGBM/utils/array_args.h>
#include <algorithm> #include <algorithm>
#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include "../io/dense_bin.hpp" #include "../io/dense_bin.hpp"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2017 Microsoft Corporation. All rights reserved. * Copyright (c) 2017 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_GPU_TREE_LEARNER_H_ #ifndef LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_GPU_TREE_LEARNER_H_ #define LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
#include <LightGBM/dataset.h> #include <LightGBM/dataset.h>
#include <LightGBM/feature_group.h> #include <LightGBM/feature_group.h>
...@@ -284,4 +284,4 @@ class GPUTreeLearner: public SerialTreeLearner { ...@@ -284,4 +284,4 @@ class GPUTreeLearner: public SerialTreeLearner {
#endif // USE_GPU #endif // USE_GPU
#endif // LightGBM_TREELEARNER_GPU_TREE_LEARNER_H_ #endif // LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_ #define LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
#include <LightGBM/bin.h> #include <LightGBM/bin.h>
#include <LightGBM/meta.h> #include <LightGBM/meta.h>
...@@ -125,4 +125,4 @@ class GradientDiscretizer { ...@@ -125,4 +125,4 @@ class GradientDiscretizer {
} // namespace LightGBM } // namespace LightGBM
#endif // LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_LEAF_SPLITS_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
#define LIGHTGBM_TREELEARNER_LEAF_SPLITS_HPP_ #define LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
#include <LightGBM/config.h> #include <LightGBM/config.h>
#include <LightGBM/meta.h> #include <LightGBM/meta.h>
...@@ -272,4 +272,4 @@ class LeafSplits { ...@@ -272,4 +272,4 @@ class LeafSplits {
}; };
} // namespace LightGBM } // namespace LightGBM
#endif // LightGBM_TREELEARNER_LEAF_SPLITS_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <Eigen/Dense> #include <Eigen/Dense>
#include <algorithm> #include <algorithm>
#include <memory>
#include <vector>
namespace LightGBM { namespace LightGBM {
...@@ -188,7 +190,7 @@ void LinearTreeLearner<TREE_LEARNER_TYPE>::CalculateLinear(Tree* tree, bool is_r ...@@ -188,7 +190,7 @@ void LinearTreeLearner<TREE_LEARNER_TYPE>::CalculateLinear(Tree* tree, bool is_r
return; return;
} }
// calculate coefficients using the method described in Eq 3 of https://arxiv.org/pdf/1802.05640.pdf // calculate coefficients using the method described in Eq 3 of https://arxiv.org/abs/1802.05640
// the coefficients vector is given by // the coefficients vector is given by
// - (X_T * H * X + lambda) ^ (-1) * (X_T * g) // - (X_T * H * X + lambda) ^ (-1) * (X_T * g)
// where: // where:
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2020 Microsoft Corporation. All rights reserved. * Copyright (c) 2020 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_ #ifndef LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_ #define LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
...@@ -126,4 +126,4 @@ class LinearTreeLearner: public TREE_LEARNER_TYPE { ...@@ -126,4 +126,4 @@ class LinearTreeLearner: public TREE_LEARNER_TYPE {
}; };
} // namespace LightGBM } // namespace LightGBM
#endif // LightGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_ #endif // LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for * Licensed under the MIT License. See LICENSE file in the project root for
* license information. * license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_ #ifndef LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#define LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_ #define LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#include <LightGBM/tree.h> #include <LightGBM/tree.h>
...@@ -1183,4 +1183,4 @@ LeafConstraintsBase* LeafConstraintsBase::Create(const Config* config, ...@@ -1183,4 +1183,4 @@ LeafConstraintsBase* LeafConstraintsBase::Create(const Config* config,
} }
} // namespace LightGBM } // namespace LightGBM
#endif // LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_ #endif // LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#ifndef LIGHTGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_ #ifndef LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_ #define LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#include <LightGBM/network.h> #include <LightGBM/network.h>
#include <LightGBM/utils/array_args.h> #include <LightGBM/utils/array_args.h>
...@@ -232,4 +232,4 @@ inline void SyncUpGlobalBestSplit(char* input_buffer_, char* output_buffer_, Spl ...@@ -232,4 +232,4 @@ inline void SyncUpGlobalBestSplit(char* input_buffer_, char* output_buffer_, Spl
} }
} // namespace LightGBM } // namespace LightGBM
#endif // LightGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_ #endif // LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
...@@ -10,10 +10,13 @@ ...@@ -10,10 +10,13 @@
#include <LightGBM/utils/common.h> #include <LightGBM/utils/common.h>
#include <algorithm> #include <algorithm>
#include <memory>
#include <queue> #include <queue>
#include <set> #include <set>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
#include <vector>
#include "cost_effective_gradient_boosting.hpp" #include "cost_effective_gradient_boosting.hpp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment