mirror of
https://github.com/vale981/ray
synced 2025-03-10 21:36:39 -04:00

* wip * add directory * wip * try again * Revert "try again" This reverts commit 82d33ccea6f92848df025e019b87df73cea49e5d. * finish * formatting * fix merge * fix path * chmod * check * sudo * wip * update * fix horovod * try * typo * reduce num workers
29 lines
788 B
Python
29 lines
788 B
Python
import json
|
|
import os
|
|
import time
|
|
|
|
import ray
|
|
from ray.util.ray_lightning.simple_example import main
|
|
|
|
if __name__ == "__main__":
|
|
start = time.time()
|
|
|
|
addr = os.environ.get("RAY_ADDRESS")
|
|
job_name = os.environ.get("RAY_JOB_NAME", "horovod_user_test")
|
|
if addr is not None and addr.startswith("anyscale://"):
|
|
ray.init(address=addr, job_name=job_name)
|
|
else:
|
|
ray.init(address="auto")
|
|
|
|
main(num_workers=6, use_gpu=True, max_steps=50)
|
|
|
|
taken = time.time() - start
|
|
result = {
|
|
"time_taken": taken,
|
|
}
|
|
test_output_json = os.environ.get("TEST_OUTPUT_JSON",
|
|
"/tmp/ray_lightning_user_test.json")
|
|
with open(test_output_json, "wt") as f:
|
|
json.dump(result, f)
|
|
|
|
print("Test Successful!")
|