如何在Python中选择XGBoost的GPU设备

发布于 2025-02-05 18:13:34 字数 134 浏览 1 评论 0原文

我正在共享Linux服务器上的Python中运行XGBoost(极端梯度提升),该服务器配备了多个GPU。当我在GPU上运行XGBoost时,XGBOOST会自动选择GPU设备0。是否有人知道如何使XGBoost选择另一个GPU? (GPU0通常太忙了)

I'm running XGBoost (eXtreme Gradient Boosting) in Python on a shared linux server, which is equipped with multiple GPUs. When I run XGBoost on a GPU, XGBoost automatically selects GPU device 0. Does anybody know how I can make XGBoost to select another GPU? (gpu0 is normally too busy )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雄赳赳气昂昂 2025-02-12 18:13:34

调查源代码,事实证明,可以通过将GPU设备编号分配给 gpu_id 来选择在类的构造函数中。例如,

xgb.XGBClassifier(tree_method='gpu_hist',predictor='gpu_predictor',gpu_id=1)

Looking into the source code, it turned out that it can be chosen in the constructor of the class by assigning the gpu device number to gpu_id. E.g.,

xgb.XGBClassifier(tree_method='gpu_hist',predictor='gpu_predictor',gpu_id=1)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文