Skip to content
Merged
Changes from 1 commit
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
32 changes: 18 additions & 14 deletions python/ray/train/v2/tests/test_jax_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ def ray_tpu_single_host(monkeypatch):
resources={"TPU": 8},
)

ray.init(address=cluster.address)
runtime_env = {
"pip": ["jax"],
"env_vars": {
"JAX_PLATFORMS": "cpu",
},
}

ray.init(address=cluster.address, runtime_env=runtime_env)

yield cluster
ray.shutdown()
Expand All @@ -44,7 +51,16 @@ def ray_tpu_multi_host(monkeypatch):
resources={"TPU": 4},
)

ray.init(address=cluster.address)
runtime_env = (
{
"pip": ["jax"],
"env_vars": {
"JAX_PLATFORMS": "cpu",
},
},
)

ray.init(address=cluster.address, runtime_env=runtime_env)

yield cluster
ray.shutdown()
Expand Down Expand Up @@ -78,12 +94,6 @@ def test_minimal_singlehost(ray_tpu_single_host, tmp_path):
),
run_config=RunConfig(
storage_path=str(tmp_path),
worker_runtime_env={
"pip": ["jax"],
"env_vars": {
"JAX_PLATFORMS": "cpu",
},
},
),
)
result = trainer.fit()
Expand All @@ -109,12 +119,6 @@ def test_minimal_multihost(ray_tpu_multi_host, tmp_path):
),
run_config=RunConfig(
storage_path=str(tmp_path),
worker_runtime_env={
"pip": ["jax"],
"env_vars": {
"JAX_PLATFORMS": "cpu",
},
},
),
)
result = trainer.fit()
Expand Down