dmlc / dmlc/xgboost

XGBoost is much slower on Ryzen 7 3700X than on Core i5-1135G7 (with the same performance rating)

Open
#9,689 3 comments 0 reactions 0 assignees View on GitHub
status: need update
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

I have XGBoost 2.0.0 installed on two machines:
* one with 4-core processor [Intel Core i5-1135G7](https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i5-1135G7+%40+2.40GHz&id=3830)
* another - with 8-core processor [AMD Ryzen 7 3700X](https://www.cpubenchmark.net/cpu.php?cpu=AMD+Ryzen+7+3700X&id=3485)
Both CPUs have almost the same single thread rating (based on passmark website - see the links above), while multiple thread rating is more than twice better for Ryzen 7.

I am running the same code on the same data on both PCs. The code does hyperparameter search using Optuna, and it trains XGBoost model. Optuna measures the time for each single iteration, so that I could build a histogram of the time for model training, and this is what I see:

![ksnip_20231018-144230](https://github.com/dmlc/xgboost/assets/8807043/c564d7e4-e2f2-422e-9820-7de363c24ead)

![ksnip_20231018-144228](https://github.com/dmlc/xgboost/assets/8807043/1f1adc8f-6d9a-4b24-9c7f-59852a4ffca9)

I was not a surprise for me that on both PCs Optuna could perform about 1500 operations: while there are twice more cores for Ryzen than for core i5, the speed of XGBoost training is twice slower, and as a result, we are getting the same number of iterations.

I tried to recompile XGBoost with different optimization flags under ryzen:
* march=native, march=znver2
* O3
* flto
* mavx2
* mfma

But this all just doesn't help.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.