Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

29
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GoogleColabratory + GradientBoosting + GPU

Last updated at Posted at 2019-06-27

GoogleColabratoryのGPUを使ってGradientBoostingライブラリ(LightGBMやXGBoost)の訓練時間を短縮したい!
というわけでGradientBoostingラでGPUを取り扱うためのセットアップ方法をまとめたいと思います。

TL;DR

  • XGBoostはGoogleColabratoryにGPUが使えるようにコンパイル済みのものがインストールされているので特に何かする必要はありません

  • LightGBMはXGBoostとは異なり下記作業が必要になります

  • ランタイム > ランタイムタイプの変更 > GPU へ変更後
    以下コマンドをコピペしてGoogleColabratoryのセルへ貼り付け、実行

!git clone --recursive https://github.com/Microsoft/LightGBM
%cd /content/LightGBM/
!mkdir build
!cmake -DUSE_GPU=1 #avoid ..
!make -j$(nproc)
!sudo apt-get -y install python-pip
!sudo -H pip install setuptools pandas numpy scipy scikit-learn -U
%cd /content/LightGBM/python-package
!sudo python setup.py install --precompile

終わり

参考

29
23
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?