{
  "id": 441286,
  "title": "LightGBM taking up too much memory!",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/441286",
  "author_name": "",
  "post_date": "2023-09-18T09:13:09.595848400Z",
  "votes": 5,
  "comment_count": 11,
  "views": 0,
  "content": "<p>LightGBM based notebooks are running out of memory during submissions. I think we need better garbage collection while using LightGBM.</p>",
  "messages": [
    {
      "id": "2444410",
      "postDate": "09/18/2023 09:13:09",
      "content": "<p>LightGBM based notebooks are running out of memory during submissions. I think we need better garbage collection while using LightGBM.</p>",
      "rawMarkdown": "LightGBM based notebooks are running out of memory during submissions. I think we need better garbage collection while using LightGBM.",
      "votes": null
    },
    {
      "id": "2444447",
      "postDate": "09/18/2023 09:20:18",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a> </p>\n<p>Can you elaborate more on the size of your training set, number of features, and any other information that causing an OOM error on your submission?</p>\n<p>Regarding why LGBM is faster but probably takes more memory, I think it is because a space-time trade-off nuance in the algorithm, CMIIW.</p>",
      "rawMarkdown": "Hi @siddhvr \n\nCan you elaborate more on the size of your training set, number of features, and any other information that causing an OOM error on your submission?\n\nRegarding why LGBM is faster but probably takes more memory, I think it is because a space-time trade-off nuance in the algorithm, CMIIW.",
      "votes": null
    },
    {
      "id": "2444667",
      "postDate": "09/18/2023 11:50:09",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a> : RAM management issues are critical for this contest indeed.</p>\n<p>Forcing the regular garbage collection with gc package at the certain points of your notebook can address the problem parcially.</p>\n<p>Apart from that, you can take a look at the techniques to optimize the RAM usage in your notebook, as per <a href=\"https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/discussion/441047\" target=\"_blank\">Best Practices of Tackling BigData-Scale Tasks</a></p>\n<p>Last but not least, there is a public kernel with lightgbm model submitting to the contest, per <a href=\"https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi\" target=\"_blank\">https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi</a> - you can fork your own 'branch' of this notebook to start with. Then you can add your tunings/tweaks on top of it to see where the out-of-memory crashes start to manifest.</p>\n<p>I hope it is helpful.</p>",
      "rawMarkdown": "Hey @siddhvr : RAM management issues are critical for this contest indeed.\n\nForcing the regular garbage collection with gc package at the certain points of your notebook can address the problem parcially.\n\nApart from that, you can take a look at the techniques to optimize the RAM usage in your notebook, as per [Best Practices of Tackling BigData-Scale Tasks](https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/discussion/441047)\n\nLast but not least, there is a public kernel with lightgbm model submitting to the contest, per https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi - you can fork your own 'branch' of this notebook to start with. Then you can add your tunings/tweaks on top of it to see where the out-of-memory crashes start to manifest.\n\nI hope it is helpful.",
      "votes": null
    },
    {
      "id": "2444672",
      "postDate": "09/18/2023 11:53:41",
      "content": "<p>Thanks for the tips Georgii.</p>",
      "rawMarkdown": "Thanks for the tips Georgii.",
      "votes": null
    },
    {
      "id": "2444677",
      "postDate": "09/18/2023 11:57:59",
      "content": "<p>Since, the competition is in its initial stages, I am keeping my work completely open. You can refer all of it <a href=\"https://www.kaggle.com/code/siddhvr/cmi-gradient-boost-update-params\" target=\"_blank\">here</a>. I agree with your premise over the space-time tradeoff, but I have also made submissions with HistGradient Boost which works completely fine. Gradient Boosting is way too slower to use for this competition.</p>",
      "rawMarkdown": "Since, the competition is in its initial stages, I am keeping my work completely open. You can refer all of it [here](https://www.kaggle.com/code/siddhvr/cmi-gradient-boost-update-params). I agree with your premise over the space-time tradeoff, but I have also made submissions with HistGradient Boost which works completely fine. Gradient Boosting is way too slower to use for this competition.",
      "votes": null
    },
    {
      "id": "2444678",
      "postDate": "09/18/2023 11:58:57",
      "content": "<p>I'll surely refer to the resources you provided.</p>",
      "rawMarkdown": "I'll surely refer to the resources you provided.",
      "votes": null
    },
    {
      "id": "2444950",
      "postDate": "09/18/2023 14:52:48",
      "content": "<p>Good tip Thanks.</p>",
      "rawMarkdown": "Good tip Thanks.",
      "votes": null
    },
    {
      "id": "2444967",
      "postDate": "09/18/2023 15:01:23",
      "content": "<p>Alternatively we can use XGBoost but with <code>tree_method='hist'</code> as well to \"mimic\" the HistGBDT. It can also utilizes GPU if I remembered correctly.</p>",
      "rawMarkdown": "Alternatively we can use XGBoost but with `tree_method='hist'` as well to \"mimic\" the HistGBDT. It can also utilizes GPU if I remembered correctly.",
      "votes": null
    },
    {
      "id": "2444969",
      "postDate": "09/18/2023 15:01:46",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a>. What can you present the results compared to another model?</p>",
      "rawMarkdown": "Thanks @siddhvr. What can you present the results compared to another model?",
      "votes": null
    },
    {
      "id": "2445075",
      "postDate": "09/18/2023 15:57:12",
      "content": "<p>Good to know. Thanks <a href=\"https://www.kaggle.com/Rimba\" target=\"_blank\">@Rimba</a> Erlangga</p>",
      "rawMarkdown": "Good to know. Thanks @Rimba Erlangga",
      "votes": null
    },
    {
      "id": "2445447",
      "postDate": "09/18/2023 20:44:35",
      "content": "<p>Yes. But XGBoost requires some amount of parameter tuning before giving good results.</p>",
      "rawMarkdown": "Yes. But XGBoost requires some amount of parameter tuning before giving good results.",
      "votes": null
    },
    {
      "id": "2550171",
      "postDate": "12/05/2023 20:54:02",
      "content": "<p>How to outcome the  notebook memory out of memory issue</p>",
      "rawMarkdown": "How to outcome the  notebook memory out of memory issue",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2444447,
      "author_name": "rimbax",
      "author_url": "",
      "post_date": "09/18/2023 09:20:18",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a> </p>\n<p>Can you elaborate more on the size of your training set, number of features, and any other information that causing an OOM error on your submission?</p>\n<p>Regarding why LGBM is faster but probably takes more memory, I think it is because a space-time trade-off nuance in the algorithm, CMIIW.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2444677,
          "author_name": "siddhvr",
          "author_url": "",
          "post_date": "09/18/2023 11:57:59",
          "content": "<p>Since, the competition is in its initial stages, I am keeping my work completely open. You can refer all of it <a href=\"https://www.kaggle.com/code/siddhvr/cmi-gradient-boost-update-params\" target=\"_blank\">here</a>. I agree with your premise over the space-time tradeoff, but I have also made submissions with HistGradient Boost which works completely fine. Gradient Boosting is way too slower to use for this competition.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2444950,
              "author_name": "aidlre001",
              "author_url": "",
              "post_date": "09/18/2023 14:52:48",
              "content": "<p>Good tip Thanks.</p>",
              "votes": null,
              "replies": []
            },
            {
              "id": 2444967,
              "author_name": "rimbax",
              "author_url": "",
              "post_date": "09/18/2023 15:01:23",
              "content": "<p>Alternatively we can use XGBoost but with <code>tree_method='hist'</code> as well to \"mimic\" the HistGBDT. It can also utilizes GPU if I remembered correctly.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2445075,
                  "author_name": "aidlre001",
                  "author_url": "",
                  "post_date": "09/18/2023 15:57:12",
                  "content": "<p>Good to know. Thanks <a href=\"https://www.kaggle.com/Rimba\" target=\"_blank\">@Rimba</a> Erlangga</p>",
                  "votes": null,
                  "replies": []
                },
                {
                  "id": 2445447,
                  "author_name": "siddhvr",
                  "author_url": "",
                  "post_date": "09/18/2023 20:44:35",
                  "content": "<p>Yes. But XGBoost requires some amount of parameter tuning before giving good results.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2444667,
      "author_name": "gvyshnya",
      "author_url": "",
      "post_date": "09/18/2023 11:50:09",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a> : RAM management issues are critical for this contest indeed.</p>\n<p>Forcing the regular garbage collection with gc package at the certain points of your notebook can address the problem parcially.</p>\n<p>Apart from that, you can take a look at the techniques to optimize the RAM usage in your notebook, as per <a href=\"https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/discussion/441047\" target=\"_blank\">Best Practices of Tackling BigData-Scale Tasks</a></p>\n<p>Last but not least, there is a public kernel with lightgbm model submitting to the contest, per <a href=\"https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi\" target=\"_blank\">https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi</a> - you can fork your own 'branch' of this notebook to start with. Then you can add your tunings/tweaks on top of it to see where the out-of-memory crashes start to manifest.</p>\n<p>I hope it is helpful.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2444672,
          "author_name": "siddhvr",
          "author_url": "",
          "post_date": "09/18/2023 11:53:41",
          "content": "<p>Thanks for the tips Georgii.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 2444678,
          "author_name": "siddhvr",
          "author_url": "",
          "post_date": "09/18/2023 11:58:57",
          "content": "<p>I'll surely refer to the resources you provided.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2444969,
      "author_name": "mitsuyasuhoshino",
      "author_url": "",
      "post_date": "09/18/2023 15:01:46",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/siddhvr\" target=\"_blank\">@siddhvr</a>. What can you present the results compared to another model?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2550171,
      "author_name": "kokulraj",
      "author_url": "",
      "post_date": "12/05/2023 20:54:02",
      "content": "<p>How to outcome the  notebook memory out of memory issue</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2444410": "LightGBM based notebooks are running out of memory during submissions. I think we need better garbage collection while using LightGBM.",
    "2444447": "Hi @siddhvr \n\nCan you elaborate more on the size of your training set, number of features, and any other information that causing an OOM error on your submission?\n\nRegarding why LGBM is faster but probably takes more memory, I think it is because a space-time trade-off nuance in the algorithm, CMIIW.",
    "2444667": "Hey @siddhvr : RAM management issues are critical for this contest indeed.\n\nForcing the regular garbage collection with gc package at the certain points of your notebook can address the problem parcially.\n\nApart from that, you can take a look at the techniques to optimize the RAM usage in your notebook, as per [Best Practices of Tackling BigData-Scale Tasks](https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/discussion/441047)\n\nLast but not least, there is a public kernel with lightgbm model submitting to the contest, per https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi - you can fork your own 'branch' of this notebook to start with. Then you can add your tunings/tweaks on top of it to see where the out-of-memory crashes start to manifest.\n\nI hope it is helpful.",
    "2444672": "Thanks for the tips Georgii.",
    "2444677": "Since, the competition is in its initial stages, I am keeping my work completely open. You can refer all of it [here](https://www.kaggle.com/code/siddhvr/cmi-gradient-boost-update-params). I agree with your premise over the space-time tradeoff, but I have also made submissions with HistGradient Boost which works completely fine. Gradient Boosting is way too slower to use for this competition.",
    "2444678": "I'll surely refer to the resources you provided.",
    "2444950": "Good tip Thanks.",
    "2444967": "Alternatively we can use XGBoost but with `tree_method='hist'` as well to \"mimic\" the HistGBDT. It can also utilizes GPU if I remembered correctly.",
    "2444969": "Thanks @siddhvr. What can you present the results compared to another model?",
    "2445075": "Good to know. Thanks @Rimba Erlangga",
    "2445447": "Yes. But XGBoost requires some amount of parameter tuning before giving good results.",
    "2550171": "How to outcome the  notebook memory out of memory issue"
  },
  "source": "meta"
}