{
  "id": 103037,
  "title": "LGBM using GPU fits slower than using  CPU",
  "url": "/competitions/champs-scalar-coupling/discussion/103037",
  "author_name": "",
  "post_date": "2019-08-06T17:17:30.062954600Z",
  "votes": null,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Currently i'm trying to do some experiments with this kernel: <a href=\"https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features\">https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features</a></p>\n\n<p>It uses LGBM that supports GPU. I tried to use my GTX 960 to speed up the calculations. Unfortunately, my attempt was unsuccessful. GPU worload during learning proccess is about 20%, although CPU workload is 100%, just as with the LGBM configuration without using GPU.</p>\n\n<p>Finally, the fit process using only CPU is 2x times faster than using GPU.</p>\n\n<p>My computer configuration:\nCPU: AMD Ryzen 7 3700x\nRAM: DDR4 Corsair Vengeance LPX Schwarz 64GB 3000 MHz\nMotherboard: MSI X570-A PRO\nGPU: MSI GTX 960 2GB\nOS: Windows 10</p>\n\n<p>I have 2 questions:\n1) Is it normal that LGBM uses only 20% of GPU?\n2) Why CPU version of LGBM fits faster, although GPU version uses more resources?</p>",
  "messages": [
    {
      "id": "593499",
      "postDate": "08/06/2019 17:17:30",
      "content": "<p>Currently i'm trying to do some experiments with this kernel: <a href=\"https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features\">https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features</a></p>\n\n<p>It uses LGBM that supports GPU. I tried to use my GTX 960 to speed up the calculations. Unfortunately, my attempt was unsuccessful. GPU worload during learning proccess is about 20%, although CPU workload is 100%, just as with the LGBM configuration without using GPU.</p>\n\n<p>Finally, the fit process using only CPU is 2x times faster than using GPU.</p>\n\n<p>My computer configuration:\nCPU: AMD Ryzen 7 3700x\nRAM: DDR4 Corsair Vengeance LPX Schwarz 64GB 3000 MHz\nMotherboard: MSI X570-A PRO\nGPU: MSI GTX 960 2GB\nOS: Windows 10</p>\n\n<p>I have 2 questions:\n1) Is it normal that LGBM uses only 20% of GPU?\n2) Why CPU version of LGBM fits faster, although GPU version uses more resources?</p>",
      "rawMarkdown": "Currently i'm trying to do some experiments with this kernel: https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features\n\nIt uses LGBM that supports GPU. I tried to use my GTX 960 to speed up the calculations. Unfortunately, my attempt was unsuccessful. GPU worload during learning proccess is about 20%, although CPU workload is 100%, just as with the LGBM configuration without using GPU.\n\nFinally, the fit process using only CPU is 2x times faster than using GPU.\n\nMy computer configuration:\nCPU: AMD Ryzen 7 3700x\nRAM: DDR4 Corsair Vengeance LPX Schwarz 64GB 3000 MHz\nMotherboard: MSI X570-A PRO\nGPU: MSI GTX 960 2GB\nOS: Windows 10\n\nI have 2 questions:\n1) Is it normal that LGBM uses only 20% of GPU?\n2) Why CPU version of LGBM fits faster, although GPU version uses more resources?",
      "votes": null
    },
    {
      "id": "593518",
      "postDate": "08/06/2019 17:59:04",
      "content": "<p>It depends on many factors but generally 960 is not a GPU type to consider for any machine learning. </p>",
      "rawMarkdown": "It depends on many factors but generally 960 is not a GPU type to consider for any machine learning.",
      "votes": null
    },
    {
      "id": "593533",
      "postDate": "08/06/2019 18:29:14",
      "content": "<p>I didn't update my GPU yet, i know it's not powerful enough, but i tried to use CatBoost with GPU in some synthetic problem and it loaded the GPU 100% and significantly accelerated calculations.</p>",
      "rawMarkdown": "I didn't update my GPU yet, i know it's not powerful enough, but i tried to use CatBoost with GPU in some synthetic problem and it loaded the GPU 100% and significantly accelerated calculations.",
      "votes": null
    },
    {
      "id": "593654",
      "postDate": "08/06/2019 23:53:59",
      "content": "<p>Same question as you,my OS is Windows 10 too.And my Tensorflow and XGBoost work well on GPU.Maybe it's OS.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2513130%2Fa57ea31dc4a33763ab05d7bfe3a7f7d9%2FRCY(1W86\" alt=\"\">GNC41BWI7.png?generation=1565135634639843&amp;alt=media)</p>",
      "rawMarkdown": "Same question as you,my OS is Windows 10 too.And my Tensorflow and XGBoost work well on GPU.Maybe it's OS.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2513130%2Fa57ea31dc4a33763ab05d7bfe3a7f7d9%2FRCY(1W86)GNC41BWI7.png?generation=1565135634639843&amp;alt=media)",
      "votes": null
    },
    {
      "id": "595277",
      "postDate": "08/09/2019 03:35:44",
      "content": "<p>Here are the params I used on Windows:</p>\n\n<pre><code>'gpu_platform_id' : 0,\n'gpu_device_id' : 0,\n'num_threads' : 6, #number-of-cores, not number-of-threads\n'gpu_use_dp': False,\n'max_bin' : 15,\n'sparse_threshold' : 1.0,\n'tree_learner' : 'serial',\n'device': 'gpu'\n</code></pre>\n\n<p>I found the bottle neck is caused by maxing out number of threads. It ends up splitting more data to be copied to GPU thus more time to run.</p>\n\n<p>Check out the other kernel for reduce_memory_usage() in Python for your data frame.</p>",
      "rawMarkdown": "Here are the params I used on Windows:\n\n    'gpu_platform_id' : 0,\n    'gpu_device_id' : 0,\n    'num_threads' : 6, #number-of-cores, not number-of-threads\n    'gpu_use_dp': False,\n    'max_bin' : 15,\n    'sparse_threshold' : 1.0,\n    'tree_learner' : 'serial',\n    'device': 'gpu'\n\nI found the bottle neck is caused by maxing out number of threads. It ends up splitting more data to be copied to GPU thus more time to run.\n\nCheck out the other kernel for reduce_memory_usage() in Python for your data frame.",
      "votes": null
    },
    {
      "id": "595331",
      "postDate": "08/09/2019 05:33:31",
      "content": "<p>Hi, does it speed up the training activities of LGBM model when using the above parameters?</p>",
      "rawMarkdown": "Hi, does it speed up the training activities of LGBM model when using the above parameters?",
      "votes": null
    },
    {
      "id": "595456",
      "postDate": "08/09/2019 08:46:22",
      "content": "<p>Your parameters seems make no difference to my LGB and I have used different num_threads.The highest utilization of GPU is about 10% during learning proccess.😩 </p>",
      "rawMarkdown": "Your parameters seems make no difference to my LGB and I have used different num_threads.The highest utilization of GPU is about 10% during learning proccess.😩",
      "votes": null
    },
    {
      "id": "596661",
      "postDate": "08/11/2019 04:12:03",
      "content": "<p>Same problem here, lgb do poor optimization on gpu.</p>",
      "rawMarkdown": "Same problem here, lgb do poor optimization on gpu.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 593518,
      "author_name": "snovik1975",
      "author_url": "",
      "post_date": "08/06/2019 17:59:04",
      "content": "<p>It depends on many factors but generally 960 is not a GPU type to consider for any machine learning. </p>",
      "votes": null,
      "replies": [
        {
          "id": 593533,
          "author_name": "sorrow321",
          "author_url": "",
          "post_date": "08/06/2019 18:29:14",
          "content": "<p>I didn't update my GPU yet, i know it's not powerful enough, but i tried to use CatBoost with GPU in some synthetic problem and it loaded the GPU 100% and significantly accelerated calculations.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 593654,
      "author_name": "fangwenjun",
      "author_url": "",
      "post_date": "08/06/2019 23:53:59",
      "content": "<p>Same question as you,my OS is Windows 10 too.And my Tensorflow and XGBoost work well on GPU.Maybe it's OS.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2513130%2Fa57ea31dc4a33763ab05d7bfe3a7f7d9%2FRCY(1W86\" alt=\"\">GNC41BWI7.png?generation=1565135634639843&amp;alt=media)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 595277,
      "author_name": "lpachuong",
      "author_url": "",
      "post_date": "08/09/2019 03:35:44",
      "content": "<p>Here are the params I used on Windows:</p>\n\n<pre><code>'gpu_platform_id' : 0,\n'gpu_device_id' : 0,\n'num_threads' : 6, #number-of-cores, not number-of-threads\n'gpu_use_dp': False,\n'max_bin' : 15,\n'sparse_threshold' : 1.0,\n'tree_learner' : 'serial',\n'device': 'gpu'\n</code></pre>\n\n<p>I found the bottle neck is caused by maxing out number of threads. It ends up splitting more data to be copied to GPU thus more time to run.</p>\n\n<p>Check out the other kernel for reduce_memory_usage() in Python for your data frame.</p>",
      "votes": null,
      "replies": [
        {
          "id": 595331,
          "author_name": "projdev",
          "author_url": "",
          "post_date": "08/09/2019 05:33:31",
          "content": "<p>Hi, does it speed up the training activities of LGBM model when using the above parameters?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 595456,
          "author_name": "fangwenjun",
          "author_url": "",
          "post_date": "08/09/2019 08:46:22",
          "content": "<p>Your parameters seems make no difference to my LGB and I have used different num_threads.The highest utilization of GPU is about 10% during learning proccess.😩 </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 596661,
      "author_name": "littlebeandog",
      "author_url": "",
      "post_date": "08/11/2019 04:12:03",
      "content": "<p>Same problem here, lgb do poor optimization on gpu.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "593499": "Currently i'm trying to do some experiments with this kernel: https://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features\n\nIt uses LGBM that supports GPU. I tried to use my GTX 960 to speed up the calculations. Unfortunately, my attempt was unsuccessful. GPU worload during learning proccess is about 20%, although CPU workload is 100%, just as with the LGBM configuration without using GPU.\n\nFinally, the fit process using only CPU is 2x times faster than using GPU.\n\nMy computer configuration:\nCPU: AMD Ryzen 7 3700x\nRAM: DDR4 Corsair Vengeance LPX Schwarz 64GB 3000 MHz\nMotherboard: MSI X570-A PRO\nGPU: MSI GTX 960 2GB\nOS: Windows 10\n\nI have 2 questions:\n1) Is it normal that LGBM uses only 20% of GPU?\n2) Why CPU version of LGBM fits faster, although GPU version uses more resources?",
    "593518": "It depends on many factors but generally 960 is not a GPU type to consider for any machine learning.",
    "593533": "I didn't update my GPU yet, i know it's not powerful enough, but i tried to use CatBoost with GPU in some synthetic problem and it loaded the GPU 100% and significantly accelerated calculations.",
    "593654": "Same question as you,my OS is Windows 10 too.And my Tensorflow and XGBoost work well on GPU.Maybe it's OS.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2513130%2Fa57ea31dc4a33763ab05d7bfe3a7f7d9%2FRCY(1W86)GNC41BWI7.png?generation=1565135634639843&amp;alt=media)",
    "595277": "Here are the params I used on Windows:\n\n    'gpu_platform_id' : 0,\n    'gpu_device_id' : 0,\n    'num_threads' : 6, #number-of-cores, not number-of-threads\n    'gpu_use_dp': False,\n    'max_bin' : 15,\n    'sparse_threshold' : 1.0,\n    'tree_learner' : 'serial',\n    'device': 'gpu'\n\nI found the bottle neck is caused by maxing out number of threads. It ends up splitting more data to be copied to GPU thus more time to run.\n\nCheck out the other kernel for reduce_memory_usage() in Python for your data frame.",
    "595331": "Hi, does it speed up the training activities of LGBM model when using the above parameters?",
    "595456": "Your parameters seems make no difference to my LGB and I have used different num_threads.The highest utilization of GPU is about 10% during learning proccess.😩",
    "596661": "Same problem here, lgb do poor optimization on gpu."
  },
  "source": "meta"
}