{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/3803","repository_url":"https://api.github.com/repos/dmlc/xgboost","labels_url":"https://api.github.com/repos/dmlc/xgboost/issues/3803/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/xgboost/issues/3803/comments","events_url":"https://api.github.com/repos/dmlc/xgboost/issues/3803/events","html_url":"https://github.com/dmlc/xgboost/pull/3803","id":371017730,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNTU5Mzk3","number":3803,"title":"Fix #3579: Fix memory leak when learing rate callback is registered","user":{"login":"hcho3","id":2532981,"node_id":"MDQ6VXNlcjI1MzI5ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/2532981?v=4","gravatar_id":"","url":"https://api.github.com/users/hcho3","html_url":"https://github.com/hcho3","followers_url":"https://api.github.com/users/hcho3/followers","following_url":"https://api.github.com/users/hcho3/following{/other_user}","gists_url":"https://api.github.com/users/hcho3/gists{/gist_id}","starred_url":"https://api.github.com/users/hcho3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcho3/subscriptions","organizations_url":"https://api.github.com/users/hcho3/orgs","repos_url":"https://api.github.com/users/hcho3/repos","events_url":"https://api.github.com/users/hcho3/events{/privacy}","received_events_url":"https://api.github.com/users/hcho3/received_events","type":"User","site_admin":false},"labels":[{"id":984017984,"node_id":"MDU6TGFiZWw5ODQwMTc5ODQ=","url":"https://api.github.com/repos/dmlc/xgboost/labels/status:%20need%20review","name":"status: need review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-17T11:04:08Z","updated_at":"2018-10-20T03:08:09Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/dmlc/xgboost/pulls/3803","html_url":"https://github.com/dmlc/xgboost/pull/3803","diff_url":"https://github.com/dmlc/xgboost/pull/3803.diff","patch_url":"https://github.com/dmlc/xgboost/pull/3803.patch"},"body":"**Diagnosis** The learning rate callback function calls `XGBoosterSetParam()` to update the learning rate. The `XGBoosterSetParam()` function in turn calls `Learner::Configure()`, which resets and re-initializes each tree updater, calling `FastHistMaker::Init()`. The `FastHistMaker::Init()` function in turn\r\nre-allocates internal objects that were meant to be recycled across iterations. Thus memory usage increases over time.\r\n\r\n**Fix** The learning rate callback should call a new function `XGBoosterUpdateParamInPlace()`. The new function is designed so that no object is re-allocated.\r\n\r\nCloses #3579."},"comment":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/comments/431543710","html_url":"https://github.com/dmlc/xgboost/pull/3803#issuecomment-431543710","issue_url":"https://api.github.com/repos/dmlc/xgboost/issues/3803","id":431543710,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTU0MzcxMA==","user":{"login":"hcho3","id":2532981,"node_id":"MDQ6VXNlcjI1MzI5ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/2532981?v=4","gravatar_id":"","url":"https://api.github.com/users/hcho3","html_url":"https://github.com/hcho3","followers_url":"https://api.github.com/users/hcho3/followers","following_url":"https://api.github.com/users/hcho3/following{/other_user}","gists_url":"https://api.github.com/users/hcho3/gists{/gist_id}","starred_url":"https://api.github.com/users/hcho3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcho3/subscriptions","organizations_url":"https://api.github.com/users/hcho3/orgs","repos_url":"https://api.github.com/users/hcho3/repos","events_url":"https://api.github.com/users/hcho3/events{/privacy}","received_events_url":"https://api.github.com/users/hcho3/received_events","type":"User","site_admin":false},"created_at":"2018-10-20T03:08:09Z","updated_at":"2018-10-20T03:08:09Z","author_association":"COLLABORATOR","body":"Not really, since Init() is supposed to be called once in the first iteration only, and the C++ code isn't aware of the Python callback functions that potentially change training parameters in the middle of the training.\r\n\r\nRight now, callbacks call SetParam(), which calls Init() and cause memory leak. The new approach will have callbacks call UpdateParamInPlace() instead."}}
{"actor":{"display_login":"hcho3"}}