{
  "id": 342023,
  "title": "CatBoost + GPU + custom_metric = ERROR",
  "url": "/competitions/amex-default-prediction/discussion/342023",
  "author_name": "",
  "post_date": "2022-08-05T09:00:50.078189Z",
  "votes": 4,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Greetings!</p>\n<p>I tried to run CatBoost with \"task_type = GPU\" and \"eval_metric = AmexCatboostMetric()\"<br>\n<a href=\"https://www.kaggle.com/code/thedevastator/the-fine-art-of-hyperparameter-tuning\" target=\"_blank\">This notebook</a> was taken for a base</p>\n<p>But I received an error:<br>\n<strong>CatBoostError: User defined loss functions, metrics and callbacks are not supported for GPU</strong></p>\n<p>How can I use CatBoost with GPU and custom metric?</p>",
  "messages": [
    {
      "id": "1885570",
      "postDate": "08/05/2022 09:00:50",
      "content": "<p>Greetings!</p>\n<p>I tried to run CatBoost with \"task_type = GPU\" and \"eval_metric = AmexCatboostMetric()\"<br>\n<a href=\"https://www.kaggle.com/code/thedevastator/the-fine-art-of-hyperparameter-tuning\" target=\"_blank\">This notebook</a> was taken for a base</p>\n<p>But I received an error:<br>\n<strong>CatBoostError: User defined loss functions, metrics and callbacks are not supported for GPU</strong></p>\n<p>How can I use CatBoost with GPU and custom metric?</p>",
      "rawMarkdown": "Greetings!\n\nI tried to run CatBoost with \"task_type = GPU\" and \"eval_metric = AmexCatboostMetric()\"\n[This notebook](https://www.kaggle.com/code/thedevastator/the-fine-art-of-hyperparameter-tuning) was taken for a base\n\nBut I received an error:\n**CatBoostError: User defined loss functions, metrics and callbacks are not supported for GPU**\n\nHow can I use CatBoost with GPU and custom metric?",
      "votes": null
    },
    {
      "id": "1885640",
      "postDate": "08/05/2022 10:00:13",
      "content": "<p>I mean, it literally says it is not supported. what do you want more?</p>",
      "rawMarkdown": "I mean, it literally says it is not supported. what do you want more?",
      "votes": null
    },
    {
      "id": "1885745",
      "postDate": "08/05/2022 10:59:52",
      "content": "<p>Noob's question )<br>\nBut sometimes it can be some tricks<br>\nFor example, RAPIDS does not support some functions 'out from the box', but numba.cuda.jit can be used</p>",
      "rawMarkdown": "Noob's question )\nBut sometimes it can be some tricks\nFor example, RAPIDS does not support some functions 'out from the box', but numba.cuda.jit can be used",
      "votes": null
    },
    {
      "id": "1887920",
      "postDate": "08/07/2022 07:18:12",
      "content": "<p>it does not support custom_metric with GPU, seems happen on LGBM and XGboost also</p>",
      "rawMarkdown": "it does not support custom_metric with GPU, seems happen on LGBM and XGboost also",
      "votes": null
    },
    {
      "id": "1888457",
      "postDate": "08/07/2022 15:22:59",
      "content": "<p>It is not officially supported. </p>\n<p>I guess (can be wrong) that the built-in metrics are implemented to support t GPU on low level (C/C++ probably) so that catboost can spare the communication of computing the metrics on CPU in the middle of the computation.</p>\n<p>You can try and check the implementation of catboost internals and maybe implement it to support the metric yourself but it can easily become extremely complex and might involve compiling the package yourself and so on. </p>",
      "rawMarkdown": "It is not officially supported. \n\nI guess (can be wrong) that the built-in metrics are implemented to support t GPU on low level (C/C++ probably) so that catboost can spare the communication of computing the metrics on CPU in the middle of the computation.\n\nYou can try and check the implementation of catboost internals and maybe implement it to support the metric yourself but it can easily become extremely complex and might involve compiling the package yourself and so on.",
      "votes": null
    },
    {
      "id": "1889310",
      "postDate": "08/08/2022 06:02:22",
      "content": "<p>Thanks, but it sounds too difficult for me</p>",
      "rawMarkdown": "Thanks, but it sounds too difficult for me",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1885640,
      "author_name": "raddar",
      "author_url": "",
      "post_date": "08/05/2022 10:00:13",
      "content": "<p>I mean, it literally says it is not supported. what do you want more?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1885745,
          "author_name": "kaggledummie007",
          "author_url": "",
          "post_date": "08/05/2022 10:59:52",
          "content": "<p>Noob's question )<br>\nBut sometimes it can be some tricks<br>\nFor example, RAPIDS does not support some functions 'out from the box', but numba.cuda.jit can be used</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1887920,
      "author_name": "taylor1224",
      "author_url": "",
      "post_date": "08/07/2022 07:18:12",
      "content": "<p>it does not support custom_metric with GPU, seems happen on LGBM and XGboost also</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1888457,
      "author_name": "thedevastator",
      "author_url": "",
      "post_date": "08/07/2022 15:22:59",
      "content": "<p>It is not officially supported. </p>\n<p>I guess (can be wrong) that the built-in metrics are implemented to support t GPU on low level (C/C++ probably) so that catboost can spare the communication of computing the metrics on CPU in the middle of the computation.</p>\n<p>You can try and check the implementation of catboost internals and maybe implement it to support the metric yourself but it can easily become extremely complex and might involve compiling the package yourself and so on. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1889310,
          "author_name": "kaggledummie007",
          "author_url": "",
          "post_date": "08/08/2022 06:02:22",
          "content": "<p>Thanks, but it sounds too difficult for me</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1885570": "Greetings!\n\nI tried to run CatBoost with \"task_type = GPU\" and \"eval_metric = AmexCatboostMetric()\"\n[This notebook](https://www.kaggle.com/code/thedevastator/the-fine-art-of-hyperparameter-tuning) was taken for a base\n\nBut I received an error:\n**CatBoostError: User defined loss functions, metrics and callbacks are not supported for GPU**\n\nHow can I use CatBoost with GPU and custom metric?",
    "1885640": "I mean, it literally says it is not supported. what do you want more?",
    "1885745": "Noob's question )\nBut sometimes it can be some tricks\nFor example, RAPIDS does not support some functions 'out from the box', but numba.cuda.jit can be used",
    "1887920": "it does not support custom_metric with GPU, seems happen on LGBM and XGboost also",
    "1888457": "It is not officially supported. \n\nI guess (can be wrong) that the built-in metrics are implemented to support t GPU on low level (C/C++ probably) so that catboost can spare the communication of computing the metrics on CPU in the middle of the computation.\n\nYou can try and check the implementation of catboost internals and maybe implement it to support the metric yourself but it can easily become extremely complex and might involve compiling the package yourself and so on.",
    "1889310": "Thanks, but it sounds too difficult for me"
  },
  "source": "meta"
}