Disable HT for DMatrix creation (#6386)
Co-authored-by: SHVETS, KIRILL <kirill.shvets@intel.com>
This commit is contained in:
parent
fcd6fad822
commit
512b464cfa
@ -160,6 +160,16 @@ inline int32_t OmpSetNumThreads(int32_t* p_threads) {
|
||||
omp_set_num_threads(threads);
|
||||
return nthread_original;
|
||||
}
|
||||
inline int32_t OmpSetNumThreadsWithoutHT(int32_t* p_threads) {
|
||||
auto& threads = *p_threads;
|
||||
int32_t nthread_original = omp_get_max_threads();
|
||||
if (threads <= 0) {
|
||||
threads = nthread_original;
|
||||
}
|
||||
omp_set_num_threads(threads);
|
||||
return nthread_original;
|
||||
}
|
||||
|
||||
} // namespace common
|
||||
} // namespace xgboost
|
||||
|
||||
|
||||
@ -844,7 +844,7 @@ void SparsePage::Push(const SparsePage &batch) {
|
||||
template <typename AdapterBatchT>
|
||||
uint64_t SparsePage::Push(const AdapterBatchT& batch, float missing, int nthread) {
|
||||
// Set number of threads but keep old value so we can reset it after
|
||||
int nthread_original = common::OmpSetNumThreads(&nthread);
|
||||
int nthread_original = common::OmpSetNumThreadsWithoutHT(&nthread);
|
||||
auto& offset_vec = offset.HostVector();
|
||||
auto& data_vec = data.HostVector();
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ BatchSet<EllpackPage> SimpleDMatrix::GetEllpackBatches(const BatchParam& param)
|
||||
template <typename AdapterT>
|
||||
SimpleDMatrix::SimpleDMatrix(AdapterT* adapter, float missing, int nthread) {
|
||||
// Set number of threads but keep old value so we can reset it after
|
||||
int nthread_original = common::OmpSetNumThreads(&nthread);
|
||||
int nthread_original = common::OmpSetNumThreadsWithoutHT(&nthread);
|
||||
|
||||
std::vector<uint64_t> qids;
|
||||
uint64_t default_max = std::numeric_limits<uint64_t>::max();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user