-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[train] Fold v2.XGBoostTrainer
API into the public trainer class as an alternate constructor
#50045
Conversation
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very elegant!
# TODO(justinvyu): [Deprecated] Legacy XGBoostTrainer API | ||
label_column: Optional[str] = None, | ||
params: Optional[Dict[str, Any]] = None, | ||
num_boost_round: Optional[int] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these needed for the V2 API? These are not passed in from the V1 API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is train/v2/xgboost
, not train/xgboost/v2
, so people who use RAY_TRAIN_V2_ENABLED
would possibly be passing in the xgboost V1 API. 😂 😭 💀 🪦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
# TODO(justinvyu): [Deprecated] Legacy XGBoostTrainer API | ||
label_column: Optional[str] = None, | ||
params: Optional[Dict[str, Any]] = None, | ||
num_boost_round: Optional[int] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is train/v2/xgboost
, not train/xgboost/v2
, so people who use RAY_TRAIN_V2_ENABLED
would possibly be passing in the xgboost V1 API. 😂 😭 💀 🪦
train_loop_per_worker: Optional[ | ||
Union[Callable[[], None], Callable[[Dict], None]] | ||
] = None, | ||
train_loop_config: Optional[Dict] = None, | ||
xgboost_config: Optional[XGBoostConfig] = None, | ||
scaling_config: Optional[ray.train.ScalingConfig] = None, | ||
run_config: Optional[ray.train.RunConfig] = None, | ||
datasets: Optional[Dict[str, GenDataset]] = None, | ||
dataset_config: Optional[ray.train.DataConfig] = None, | ||
resume_from_checkpoint: Optional[Checkpoint] = None, | ||
metadata: Optional[Dict[str, Any]] = None, | ||
# TODO(justinvyu): [Deprecated] Legacy XGBoostTrainer API | ||
label_column: Optional[str] = None, | ||
params: Optional[Dict[str, Any]] = None, | ||
num_boost_round: Optional[int] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: it's fine to change the ordering of these params because they were already forced to be kwargs.
…ost/merge_v2 Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
Signed-off-by: Justin Yu <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]> Signed-off-by: Jay Chia <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]> Signed-off-by: Jay Chia <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]>
… an alternate constructor (ray-project#50045) Currently, the new `XGBoostTrainer` API is only accessible with a separate import `ray.train.xgboost.v2.XGBoostTrainer`. To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments `(train_loop_per_worker, train_loop_config, xgboost_config)`, into the public `ray.train.xgboost.XGBoostTrainer` class. This also makes some changes in the Ray Train v2 `XGBoostTrainer` class to improve the migration UX, since it does not support the legacy `XGBoostTrainer` API at all. --------- Signed-off-by: Justin Yu <[email protected]> Signed-off-by: Dhakshin Suriakannu <[email protected]>
…s as an alternate constructor (#51265) This PR is a follow-up of #50045, which folds the new LightGBM API into `ray.train.lightgbm.LightGBMTrainer` so that users don't need to change their imports to use the new custom train function API. --------- Signed-off-by: Hongpeng Guo <[email protected]> Signed-off-by: Justin Yu <[email protected]> Co-authored-by: Justin Yu <[email protected]>
…s as an alternate constructor (ray-project#51265) This PR is a follow-up of ray-project#50045, which folds the new LightGBM API into `ray.train.lightgbm.LightGBMTrainer` so that users don't need to change their imports to use the new custom train function API. --------- Signed-off-by: Hongpeng Guo <[email protected]> Signed-off-by: Justin Yu <[email protected]> Co-authored-by: Justin Yu <[email protected]> Signed-off-by: Steve Han <[email protected]>
Summary
Currently, the new
XGBoostTrainer
API is only accessible with a separate importray.train.xgboost.v2.XGBoostTrainer
.To avoid unnecessary import changes, this PR folds the new API, which accepts new arguments
(train_loop_per_worker, train_loop_config, xgboost_config)
, into the publicray.train.xgboost.XGBoostTrainer
class.This also makes some changes in the Ray Train v2
XGBoostTrainer
class to improve the migration UX, since it does not support the legacyXGBoostTrainer
API at all.TODO
XGBoostTrainer
andLightGBMTrainer
API revamps #50042