Skip to content

Commit

Permalink
[train v2+tune] Propagate Train v2 feature flag from Tune driver to T…
Browse files Browse the repository at this point in the history
…rain driver (ray-project#49519)

To use the new revamped Ray Train proposed in
ray-project/enhancements#57, users should set
the `RAY_TRAIN_V2_ENABLED=1` feature flag environment variable on their
job driver. However, if using Ray Tune to launch Ray Train jobs, this
environment variable does not get propagated from the driver process to
the Ray actor that is now acting as the Ray Train driver process. This
PR propagates this environment variable automatically.

Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Roshan Kathawate <roshankathawate@gmail.com>
  • Loading branch information
justinvyu authored and roshankathawate committed Jan 9, 2025
1 parent 444bf29 commit 4f9e412
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ray/tune/execution/class_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
ENABLE_V2_MIGRATION_WARNINGS_ENV_VAR,
RAY_CHDIR_TO_TRIAL_DIR,
)
from ray.train.v2._internal.constants import V2_ENABLED_ENV_VAR

DEFAULT_ENV_VARS = {
# https://github.com/ray-project/ray/issues/28197
"PL_DISABLE_FORK": "1"
}
ENV_VARS_TO_PROPAGATE = {
# Propagate the Ray Train V2 feature flag from the driver process
# to the trainable process so that Tune + Train v2 can be used together.
V2_ENABLED_ENV_VAR,
COPY_DIRECTORY_CHECKPOINTS_INSTEAD_OF_MOVING_ENV,
RAY_CHDIR_TO_TRIAL_DIR,
ENABLE_V2_MIGRATION_WARNINGS_ENV_VAR,
Expand Down

0 comments on commit 4f9e412

Please # to comment.