Skip to content
Open
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: 2 additions & 2 deletions plugin/sycl/predictor/predictor.cc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright by Contributors 2017-2025
* Copyright by Contributors 2017-2026
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtautological-constant-compare"
Expand All @@ -17,7 +17,7 @@
#include "dmlc/registry.h"

#include "xgboost/tree_model.h"
#include "xgboost/predictor.h"
#include "../../../src/predictor/predictor.h"
#include "xgboost/tree_updater.h"
#include "../../../src/common/timer.h"

Expand Down
5 changes: 2 additions & 3 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2014-2025, XGBoost Contributors
* Copyright 2014-2026, XGBoost Contributors
*/
#include "xgboost/c_api.h"

Expand Down Expand Up @@ -29,6 +29,7 @@
#include "../data/proxy_dmatrix.h" // for DMatrixProxy
#include "../data/simple_dmatrix.h" // for SimpleDMatrix
#include "../encoder/types.h" // for Overloaded
#include "../learner.h" // for Learner, PredictionType
#include "c_api_error.h" // for xgboost_CHECK_C_ARG_PTR, API_END, API_BEGIN
#include "c_api_utils.h" // for RequiredArg, OptionalArg, GetMissing, CastDM...
#include "dmlc/base.h" // for BeginPtr
Expand All @@ -42,9 +43,7 @@
#include "xgboost/global_config.h" // for GlobalConfiguration, GlobalConfigThreadLocal...
#include "xgboost/host_device_vector.h" // for HostDeviceVector
#include "xgboost/json.h" // for Json, get, Integer, IsA, Boolean, String
#include "xgboost/learner.h" // for Learner, PredictionType
#include "xgboost/logging.h" // for LOG_FATAL, LogMessageFatal, CHECK, LogCheck_EQ
#include "xgboost/predictor.h" // for PredictionCacheEntry
#include "xgboost/span.h" // for Span
#include "xgboost/string_view.h" // for StringView, operator<<
#include "xgboost/version_config.h" // for XGBOOST_VER_MAJOR, XGBOOST_VER_MINOR, XGBOOS...
Expand Down
4 changes: 2 additions & 2 deletions src/c_api/c_api.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019-2025, XGBoost Contributors
* Copyright 2019-2026, XGBoost Contributors
*/
#include <thrust/transform.h> // for transform

Expand All @@ -13,7 +13,7 @@
#include "xgboost/c_api.h"
#include "xgboost/data.h"
#include "xgboost/json.h"
#include "xgboost/learner.h"
#include "../learner.h" // for Learner
#if defined(XGBOOST_USE_NCCL)
#include <nccl.h>
#endif // defined(XGBOOST_USE_NCCL)
Expand Down
4 changes: 2 additions & 2 deletions src/c_api/c_api_utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021-2024, XGBoost Contributors
* Copyright 2021-2026, XGBoost Contributors
*/
#ifndef XGBOOST_C_API_C_API_UTILS_H_
#define XGBOOST_C_API_C_API_UTILS_H_
Expand All @@ -19,7 +19,7 @@
#include "xgboost/data.h" // DMatrix
#include "xgboost/feature_map.h" // for FeatureMap
#include "xgboost/json.h"
#include "xgboost/learner.h"
#include "../learner.h" // for Learner
#include "xgboost/linalg.h" // ArrayInterfaceHandler, MakeTensorView, ArrayInterfaceStr
#include "xgboost/logging.h"
#include "xgboost/string_view.h" // StringView
Expand Down
13 changes: 7 additions & 6 deletions src/common/api_entry.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/**
* Copyright 2016-2023 by XGBoost contributors
* Copyright 2016-2026, XGBoost contributors
*/
#ifndef XGBOOST_COMMON_API_ENTRY_H_
#define XGBOOST_COMMON_API_ENTRY_H_
#include <string> // std::string
#include <vector> // std::vector

#include "xgboost/base.h" // GradientPair,bst_ulong
#include "xgboost/predictor.h" // PredictionCacheEntry
#include <string> // for string
#include <vector> // for vector

#include "../predictor/predictor.h" // PredictionCacheEntry
#include "xgboost/base.h" // GradientPair,bst_ulong

namespace xgboost {
/**
* \brief entry to to easily hold returning information
* @brief entry to to easily hold returning information
*/
struct XGBAPIThreadLocalEntry {
/*! \brief result holder for returning string */
Expand Down
7 changes: 2 additions & 5 deletions include/xgboost/cache.h → src/common/cache.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/**
* Copyright 2023 by XGBoost contributors
* Copyright 2023-2026, XGBoost contributors
*/
#ifndef XGBOOST_CACHE_H_
#define XGBOOST_CACHE_H_

#pragma once
#include <xgboost/logging.h> // for CHECK_EQ, CHECK

#include <cstddef> // for size_t
Expand Down Expand Up @@ -201,4 +199,3 @@ class DMatrixCache {
}
};
} // namespace xgboost
#endif // XGBOOST_CACHE_H_
4 changes: 2 additions & 2 deletions src/data/data.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2025, XGBoost Contributors
* Copyright 2015-2026, XGBoost Contributors
* \file data.cc
*/
#include "xgboost/data.h"
Expand Down Expand Up @@ -52,7 +52,7 @@
#include "xgboost/base.h" // for bst_group_t, bst_idx_t, bst_float, bst_ulong
#include "xgboost/context.h" // for Context
#include "xgboost/host_device_vector.h" // for HostDeviceVector
#include "xgboost/learner.h" // for HostDeviceVector
#include "../learner.h" // for Learner
#include "xgboost/linalg.h" // for Tensor, Stack, TensorView, Vector, ArrayInte...
#include "xgboost/logging.h" // for Error, LogCheck_EQ, CHECK, CHECK_EQ, LOG
#include "xgboost/span.h" // for Span, operator!=, SpanIterator
Expand Down
8 changes: 4 additions & 4 deletions src/gbm/gblinear.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2014-2025, XGBoost Contributors
* Copyright 2014-2026, XGBoost Contributors
* \file gblinear.cc
* \brief Implementation of Linear booster, with L1/L2 regularization: Elastic Net
* the update rule is parallel coordinate descent (shotgun)
Expand All @@ -17,13 +17,13 @@
#include "../common/threading_utils.h"
#include "../common/timer.h"
#include "gblinear_model.h"
#include "xgboost/gbm.h"
#include "gbm.h" // for GradientContainer
#include "xgboost/json.h"
#include "xgboost/learner.h"
#include "../learner.h" // for LearnerModelParam
#include "xgboost/linalg.h"
#include "xgboost/linear_updater.h"
#include "xgboost/logging.h"
#include "xgboost/predictor.h"
#include "../predictor/predictor.h" // for Predictor

namespace xgboost::gbm {
DMLC_REGISTRY_FILE_TAG(gblinear);
Expand Down
4 changes: 2 additions & 2 deletions src/gbm/gblinear_model.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright 2018-2025, XGBoost Contributors
* Copyright 2018-2026, XGBoost Contributors
*/
#pragma once
#include <dmlc/io.h>
#include <dmlc/parameter.h>
#include <xgboost/learner.h>
#include "../learner.h" // for LearnerModelParam

#include <vector>
#include <string>
Expand Down
6 changes: 3 additions & 3 deletions src/gbm/gbm.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Copyright 2015-2025, XGBoost Contributors
* Copyright 2015-2026, XGBoost Contributors
* \file gbm.cc
* \brief Registry of gradient boosters.
*/
#include "xgboost/gbm.h"
#include "gbm.h"

#include <dmlc/registry.h>

#include <string>

#include "xgboost/context.h"
#include "xgboost/learner.h"
#include "../learner.h" // for LearnerModelParam

namespace dmlc {
DMLC_REGISTRY_ENABLE(::xgboost::GradientBoosterReg);
Expand Down
6 changes: 2 additions & 4 deletions include/xgboost/gbm.h → src/gbm/gbm.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* Copyright 2014-2025, XGBoost Contributors
* Copyright 2014-2026, XGBoost Contributors
* \file gbm.h
* \brief Interface of gradient booster,
* that learns through gradient statistics.
* \author Tianqi Chen
*/
#ifndef XGBOOST_GBM_H_
#define XGBOOST_GBM_H_
#pragma once

#include <dmlc/registry.h>
#include <xgboost/base.h>
Expand Down Expand Up @@ -196,4 +195,3 @@ struct GradientBoosterReg
::dmlc::Registry< ::xgboost::GradientBoosterReg>::Get()->__REGISTER__(Name)

} // namespace xgboost
#endif // XGBOOST_GBM_H_
4 changes: 2 additions & 2 deletions src/gbm/gbtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
#include "../common/threading_utils.h"
#include "../common/timer.h"
#include "../data/proxy_dmatrix.h" // for DMatrixProxy, HostAdapterDispatch
#include "gbm.h"
#include "gbtree_model.h"
#include "xgboost/base.h"
#include "xgboost/data.h"
#include "xgboost/gbm.h"
#include "xgboost/host_device_vector.h"
#include "xgboost/json.h"
#include "xgboost/logging.h"
#include "xgboost/model.h"
#include "xgboost/objective.h"
#include "xgboost/predictor.h"
#include "../predictor/predictor.h" // for Predictor
#include "xgboost/string_view.h" // for StringView
#include "xgboost/tree_model.h" // for RegTree
#include "xgboost/tree_updater.h"
Expand Down
6 changes: 3 additions & 3 deletions src/gbm/gbtree.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2014-2025, XGBoost Contributors
* Copyright 2014-2026, XGBoost Contributors
* \file gbtree.cc
* \brief gradient boosted tree implementation.
* \author Tianqi Chen
Expand All @@ -20,15 +20,15 @@
#include "../common/timer.h"
#include "../tree/param.h" // TrainParam
#include "../tree/tree_view.h" // for WalkTree
#include "gbm.h" // for GradientBooster
#include "gbtree_model.h"
#include "xgboost/base.h"
#include "xgboost/data.h"
#include "xgboost/gbm.h"
#include "xgboost/host_device_vector.h"
#include "xgboost/json.h"
#include "xgboost/logging.h"
#include "xgboost/parameter.h"
#include "xgboost/predictor.h"
#include "../predictor/predictor.h" // for Predictor
#include "xgboost/tree_updater.h"

namespace xgboost {
Expand Down
4 changes: 2 additions & 2 deletions src/gbm/gbtree_model.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019-2025, XGBoost Contributors
* Copyright 2019-2026, XGBoost Contributors
*/
#include "gbtree_model.h"

Expand All @@ -11,7 +11,7 @@
#include "../common/threading_utils.h" // for ParallelFor
#include "xgboost/context.h" // for Context
#include "xgboost/json.h" // for Json, get, Integer, Array, FromJson, ToJson, Json...
#include "xgboost/learner.h" // for LearnerModelParam
#include "../learner.h" // for LearnerModelParam
#include "xgboost/logging.h" // for LogCheck_EQ, CHECK_EQ, CHECK
#include "xgboost/tree_model.h" // for RegTree

Expand Down
4 changes: 2 additions & 2 deletions src/gbm/gbtree_model.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017-2025, XGBoost Contributors
* Copyright 2017-2026, XGBoost Contributors
*
* @file gbtree_model.h
*/
Expand All @@ -15,7 +15,7 @@
#include "../common/threading_utils.h"
#include "../data/cat_container.h" // for CatContainer
#include "xgboost/context.h"
#include "xgboost/learner.h"
#include "../learner.h" // for LearnerModelParam
#include "xgboost/model.h"
#include "xgboost/tree_model.h"

Expand Down
56 changes: 28 additions & 28 deletions src/learner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
* \brief Implementation of learning algorithm.
* \author Tianqi Chen
*/
#include "xgboost/learner.h"

#include <dmlc/io.h> // for Stream
#include <dmlc/parameter.h> // for FieldEntry, DMLC_DECLARE_FIELD, Parameter, DMLC...
#include <dmlc/thread_local.h> // for ThreadLocalStore

#include <algorithm> // for equal, max, transform, sort, find_if, all_of
#include <atomic> // for atomic
#include <cctype> // for isalpha, isspace
#include <cmath> // for isnan, isinf
#include <cstdint> // for int32_t, uint32_t, int64_t, uint64_t
#include <cstdlib> // for atoi
#include <cstring> // for memcpy, size_t, memset
#include <iomanip> // for operator<<, setiosflags
#include <iterator> // for back_insert_iterator, distance, back_inserter
#include <limits> // for numeric_limits
#include <memory> // for allocator, unique_ptr, shared_ptr, operator==
#include <mutex> // for mutex, lock_guard
#include <sstream> // for operator<<, basic_ostream, basic_ostream::opera...
#include <stack> // for stack
#include <string> // for basic_string, char_traits, operator<, string
#include <system_error> // for errc
#include <unordered_map> // for operator!=, unordered_map
#include <utility> // for pair, as_const, move, swap
#include <vector> // for vector
#include "learner.h"

#include <dmlc/io.h> // for Stream
#include <dmlc/parameter.h> // for FieldEntry, DMLC_DECLARE_FIELD, Parameter, DMLC...
#include <dmlc/thread_local.h> // for ThreadLocalStore

#include <algorithm> // for equal, max, transform, sort, find_if, all_of
#include <atomic> // for atomic
#include <cctype> // for isalpha, isspace
#include <cmath> // for isnan, isinf
#include <cstdint> // for int32_t, uint32_t, int64_t, uint64_t
#include <cstdlib> // for atoi
#include <cstring> // for memcpy, size_t, memset
#include <iomanip> // for operator<<, setiosflags
#include <iterator> // for back_insert_iterator, distance, back_inserter
#include <limits> // for numeric_limits
#include <memory> // for allocator, unique_ptr, shared_ptr, operator==
#include <mutex> // for mutex, lock_guard
#include <sstream> // for operator<<, basic_ostream, basic_ostream::opera...
#include <stack> // for stack
#include <string> // for basic_string, char_traits, operator<, string
#include <system_error> // for errc
#include <unordered_map> // for operator!=, unordered_map
#include <utility> // for pair, as_const, move, swap
#include <vector> // for vector

#include "collective/aggregator.h" // for ApplyWithLabels
#include "collective/communicator-inl.h" // for Allreduce, Broadcast, GetRank, IsDistributed
#include "common/api_entry.h" // for XGBAPIThreadLocalEntry
#include "common/param_array.h" // for ParamArray
#include "common/charconv.h" // for to_chars, to_chars_result, NumericLimits, from_...
#include "common/error_msg.h" // for MaxFeatureSize, WarnOldSerialization, ...
#include "common/io.h" // for PeekableInStream, ReadAll, FixedSizeStream, Mem...
#include "common/observer.h" // for TrainingObserver
#include "common/param_array.h" // for ParamArray
#include "common/random.h" // for GlobalRandom
#include "common/timer.h" // for Monitor
#include "common/version.h" // for Version
#include "gbm/gbm.h" // for GradientBooster
#include "xgboost/base.h" // for Args, GradientPair, bst_feature_t
#include "xgboost/context.h" // for Context
#include "xgboost/data.h" // for DMatrix, MetaInfo
#include "xgboost/gbm.h" // for GradientBooster
#include "xgboost/global_config.h" // for GlobalConfiguration, GlobalConfigThreadLocalStore
#include "xgboost/host_device_vector.h" // for HostDeviceVector
#include "xgboost/json.h" // for Json, get, Object, String, IsA, Array, ToJson
Expand All @@ -53,7 +53,7 @@
#include "xgboost/metric.h" // for Metric
#include "xgboost/objective.h" // for ObjFunction
#include "xgboost/parameter.h" // for DECLARE_FIELD_ENUM_CLASS, XGBoostParameter
#include "xgboost/predictor.h" // for PredictionContainer, PredictionCacheEntry
#include "predictor/predictor.h" // for PredictionContainer, PredictionCacheEntry
#include "xgboost/string_view.h" // for operator<<, StringView
#include "xgboost/task.h" // for ObjInfo

Expand Down
7 changes: 2 additions & 5 deletions include/xgboost/learner.h → src/learner.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* Copyright 2015-2025, XGBoost Contributors
* Copyright 2015-2026, XGBoost Contributors
*
* \brief Learner interface that integrates objective, gbm and evaluation together.
* This is the user facing XGBoost training module.
* \author Tianqi Chen
*/
#ifndef XGBOOST_LEARNER_H_
#define XGBOOST_LEARNER_H_
#pragma once

#include <dmlc/io.h> // for Serializable
#include <xgboost/base.h> // for bst_feature_t, bst_target_t, bst_float, Args, GradientPair, ..
Expand Down Expand Up @@ -352,6 +351,4 @@ struct LearnerModelParam {
/* \brief Whether this parameter is initialized with LearnerModelParamLegacy. */
[[nodiscard]] bool Initialized() const { return num_feature != 0 && num_output_group != 0; }
};

} // namespace xgboost
#endif // XGBOOST_LEARNER_H_
Loading
Loading