2021-05-24 15:33:31 -07:00
|
|
|
import argparse
|
|
|
|
import time
|
|
|
|
import os
|
|
|
|
import json
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument(
|
2022-01-29 18:41:57 -08:00
|
|
|
"--num-partitions", help="number of partitions", default=50, type=str
|
|
|
|
)
|
2021-05-24 15:33:31 -07:00
|
|
|
parser.add_argument(
|
|
|
|
"--partition-size",
|
|
|
|
help="number of reducer actors used",
|
|
|
|
default="200e6",
|
2022-01-29 18:41:57 -08:00
|
|
|
type=str,
|
|
|
|
)
|
2021-05-31 15:28:02 -07:00
|
|
|
parser.add_argument(
|
2022-01-29 18:41:57 -08:00
|
|
|
"--no-streaming", help="Non streaming shuffle", action="store_true"
|
|
|
|
)
|
2021-05-24 15:33:31 -07:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
start = time.time()
|
2021-06-09 22:38:53 -07:00
|
|
|
|
2021-05-31 15:28:02 -07:00
|
|
|
commands = [
|
2022-01-29 18:41:57 -08:00
|
|
|
"python",
|
|
|
|
"-m",
|
|
|
|
"ray.experimental.shuffle",
|
|
|
|
"--ray-address={}".format(os.environ["RAY_ADDRESS"]),
|
2021-05-31 15:28:02 -07:00
|
|
|
f"--num-partitions={args.num_partitions}",
|
2022-01-29 18:41:57 -08:00
|
|
|
f"--partition-size={args.partition_size}",
|
2021-05-31 15:28:02 -07:00
|
|
|
]
|
|
|
|
if args.no_streaming:
|
|
|
|
commands.append("--no-streaming")
|
|
|
|
|
2021-07-09 12:20:42 -07:00
|
|
|
subprocess.check_call(commands)
|
2021-05-24 15:33:31 -07:00
|
|
|
delta = time.time() - start
|
2021-05-27 00:33:21 -07:00
|
|
|
|
2021-05-24 15:33:31 -07:00
|
|
|
with open(os.environ["TEST_OUTPUT_JSON"], "w") as f:
|
2021-07-09 12:20:42 -07:00
|
|
|
f.write(json.dumps({"shuffle_time": delta, "success": 1}))
|