Skip to content
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] enable train + tune tests and examples #39021

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions .buildkite/pipeline.ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@
--test_tag_filters=-gpu_only,-gpu,-minimal,-tune,-doctest
python/ray/train/...


# Currently empty test suite
#- label: ":steam_locomotive: :octopus: Train + Tune tests and examples"
# conditions: ["NO_WHEELS_REQUIRED", "RAY_CI_TRAIN_AFFECTED"]
# instance_size: medium
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=tune,-gpu_only,-ray_air,-gpu,-doctest,-new_storage python/ray/train/...
- label: ":steam_locomotive: :octopus: Train + Tune tests and examples"
conditions: ["NO_WHEELS_REQUIRED", "RAY_CI_TRAIN_AFFECTED"]
instance_size: medium
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- ./ci/env/env_info.sh
- bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=tune,-gpu_only,-ray_air,-gpu,-doctest python/ray/train/...


- label: ":brain: RLlib: Benchmarks (Torch 2.x)"
Expand Down Expand Up @@ -361,19 +359,6 @@

##### STORAGE REFACTOR

# TODO(krfricke): Add new test for this suite
# - label: ":steam_locomotive: :octopus: :floppy_disk: New persistence mode: Train + Tune tests and examples"
# conditions: ["NO_WHEELS_REQUIRED", "RAY_CI_TRAIN_AFFECTED"]
# instance_size: medium
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only
# --test_tag_filters=tune,-gpu_only,-ray_air,-gpu,-doctest,-no_new_storage
# --test_env=RAY_AIR_NEW_PERSISTENCE_MODE=1
# python/ray/train/...


- label: ":octopus: :floppy_disk: New persistence mode: Tune tests and examples (small)"
conditions: ["NO_WHEELS_REQUIRED", "RAY_CI_TUNE_AFFECTED"]
Expand Down
1 change: 1 addition & 0 deletions python/ray/train/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

usage_lib.record_library_usage("train")


__all__ = [
"get_checkpoint",
"get_context",
Expand Down
9 changes: 7 additions & 2 deletions python/ray/train/tests/test_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,20 @@ def train_func():
assert len(df[TRAINING_ITERATION]) == 4


def test_restore_with_new_trainer(ray_start_4_cpus, tmpdir, propagate_logs, caplog):
def test_restore_with_new_trainer(
ray_start_4_cpus, tmpdir, propagate_logs, caplog, monkeypatch
):

monkeypatch.setenv("RAY_AIR_LOCAL_CACHE_DIR", str(tmpdir))

def train_func(config):
raise RuntimeError("failing!")

trainer = DataParallelTrainer(
train_func,
backend_config=TestConfig(),
scaling_config=ScalingConfig(num_workers=1),
run_config=RunConfig(local_dir=str(tmpdir), name="restore_new_trainer"),
run_config=RunConfig(name="restore_new_trainer"),
datasets={"train": ray.data.from_items([{"a": i} for i in range(10)])},
)
results = Tuner(trainer).fit()
Expand Down