From a47121476f60a5a2282273c65eac1c7f92b81870 Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Thu, 30 Jul 2020 21:47:27 -0700 Subject: [PATCH] [tune] Remove accidentally added files (#9835) --- python/ray/.anyscale.yaml | 1 - python/ray/session-default.yaml | 77 --------- python/ray/tune/.anyscale.yaml | 1 - python/ray/tune/_test.py | 43 ----- python/ray/tune/_test2.py | 207 ----------------------- python/ray/tune/_test3.py | 42 ----- python/ray/tune/examples/cluster-p3.yaml | 71 -------- python/ray/tune/session-default.yaml | 73 -------- python/ray/tune/test.th | Bin 137 -> 0 bytes python/ray/tune/tests/test_serial.py | 28 --- python/ray/tune/trialv2.py | 1 - 11 files changed, 544 deletions(-) delete mode 100644 python/ray/.anyscale.yaml delete mode 100644 python/ray/session-default.yaml delete mode 100644 python/ray/tune/.anyscale.yaml delete mode 100644 python/ray/tune/_test.py delete mode 100644 python/ray/tune/_test2.py delete mode 100644 python/ray/tune/_test3.py delete mode 100644 python/ray/tune/examples/cluster-p3.yaml delete mode 100644 python/ray/tune/session-default.yaml delete mode 100644 python/ray/tune/test.th delete mode 100644 python/ray/tune/tests/test_serial.py delete mode 100644 python/ray/tune/trialv2.py diff --git a/python/ray/.anyscale.yaml b/python/ray/.anyscale.yaml deleted file mode 100644 index 34ad7154c..000000000 --- a/python/ray/.anyscale.yaml +++ /dev/null @@ -1 +0,0 @@ -project_id: 643 diff --git a/python/ray/session-default.yaml b/python/ray/session-default.yaml deleted file mode 100644 index fe5aa4c74..000000000 --- a/python/ray/session-default.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# An unique identifier for the head node and workers of this cluster. -cluster_name: sgd-pytorch - -# The maximum number of workers nodes to launch in addition to the head -# node. This takes precedence over min_workers. min_workers default to 0. -min_workers: 2 -initial_workers: 2 -max_workers: 2 - -target_utilization_fraction: 0.9 - -# If a node is idle for this many minutes, it will be removed. -idle_timeout_minutes: 20 -# docker: -# image: tensorflow/tensorflow:1.5.0-py3 -# container_name: ray_docker - -# Cloud-provider specific configuration. -provider: - type: aws - region: us-west-2 - -# How Ray will authenticate with newly launched nodes. -auth: - ssh_user: ubuntu - -head_node: - InstanceType: p3.8xlarge - ImageId: latest_dlami - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - - -worker_nodes: - InstanceType: p3.8xlarge - ImageId: latest_dlami - # Run workers on spot by default. Comment this out to use on-demand. - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - -setup_commands: - - ray || pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl - - pip install -U ipdb ray[rllib] torch torchvision - - cp -r ~/tune ~/anaconda3/lib/python3.6/site-packages/ray - - cp -r ~/torch_ ~/anaconda3/lib/python3.6/site-packages/ray/util/sgd - - cp -r ~/autoscaler ~/anaconda3/lib/python3.6/site-packages/ray/ - # Install apex. - # - rm -rf apex || true - # - git clone https://github.com/NVIDIA/apex && cd apex && pip install -v --no-cache-dir ./ || true - - -file_mounts: { - ~/tune: ./tune/, - ~/torch_: ./util/sgd/torch/, - ~/autoscaler: ./autoscaler/ -} - -# Custom commands that will be run on the head node after common setup. -head_setup_commands: [] - -# Custom commands that will be run on worker nodes after common setup. -worker_setup_commands: [] - -# # Command to start ray on the head node. You don't need to change this. -head_start_ray_commands: - - ray stop - - ray start --head --port=6379 --object-manager-port=8076 --autoscaling-config=~/ray_bootstrap_config.yaml --object-store-memory=1000000000 - -# Command to start ray on worker nodes. You don't need to change this. -worker_start_ray_commands: - - ray stop - - ray start --address=$RAY_HEAD_IP:6379 --object-manager-port=8076 --object-store-memory=1000000000 - diff --git a/python/ray/tune/.anyscale.yaml b/python/ray/tune/.anyscale.yaml deleted file mode 100644 index 7a93e4030..000000000 --- a/python/ray/tune/.anyscale.yaml +++ /dev/null @@ -1 +0,0 @@ -project_id: 578 diff --git a/python/ray/tune/_test.py b/python/ray/tune/_test.py deleted file mode 100644 index 34b22f621..000000000 --- a/python/ray/tune/_test.py +++ /dev/null @@ -1,43 +0,0 @@ -class Trial: - hypers: dict = {} # static - config: dict = {} # static - status: str = None - trace: List[Dict] = [] - checkpoints: List[str] = [] - -space = {} -trials = [] - -trial_checkpoints = {} - -while not Optimizer.is_finished(): - while Optimizer.has_next(space, trials, state): - trials += [Optimizer.next(space, trials, state)] - trial = Optimizer.choose(trials, state) - if Optimizer.should_stop(trial, trials, state): - Executor.stop(trial) - elif Optimizer.should_pause(trial, state): - Executor.pause(trial) - elif Optimizer.should_restore(trial, state): - restore(trial, trial.checkpoints[-1]) - elif Optimizer.should_save(trial, state): - checkpoint = save(trial) - elif Optimizer.should_continue(trial, state): - step(trial) - - -exp = Experiment(logdir, name, restore=True) -failed_trials = exp.get_failed_trials() -run(failed_trials) - -exp = Experiment(logdir, name, restore=True) -trials = exp.trials_finished() -trials.reset_status() -run(trials) - - -optimizer = Optimizer(sweep, metric, *parameters) -sweep.configure_server() -sweep.add_logger(Logging) -sweep.set_executor(executor) -sweep.run(func, verbose=verbose) \ No newline at end of file diff --git a/python/ray/tune/_test2.py b/python/ray/tune/_test2.py deleted file mode 100644 index a55db1fd1..000000000 --- a/python/ray/tune/_test2.py +++ /dev/null @@ -1,207 +0,0 @@ -storage = TrialStorage(location) -trials = storage.get_trials() -failed_trials = trials.filter(status=Failed) -parameters = [t.hypers for t in failed_trials] - - -# Builder Pattern - -factory = TrialFactory() -factory.queue(grid) -run(func, factory) - -factory = TrialFactory() -factory.queue(distribution, num_samples=3, repeat=5) -run(func, factory) - -factory = TrialFactory(optimizer) -factory.queue(distribution, delay_feedback=3, num_samples=20, max_concurrent=3) -run(func, factory) - -optimizer.restore(storage) - -factory = TrialFactory(optimizer) -factory.queue(parameter_list) -factory.queue(distribution, num_samples=3) - -# single process - -trials = [] - -while factory.has_next(): - x = factory.next() - trial = build(func, x) - trials.put(trial) - storage.save(factory, trials) - - while not trial.done(): - result = get_next_result(trial) - log(result) - storage.update_checkpoint(trial) - factory.update(result) - storage.save(factory, trials) - - -# concurrent - -trials = [] - -class Actor: - def __init__(self): - pass - - def configure(): - pass - - def step(): - pass - - def save(): - pass - - def restore(): - pass - -factory, trials = storage.recover() -optimizer = factory.optimizer -result_streams = [] - -while factory.has_next() or not trials.not_done(): - while factory.has_next(): - x = factory.next() - trial = build(func, x) - trials.put(trial) - storage.save(factory, trials) - - while Cluster.has_space(trials.live()) and trials.has_pending(): - trial = trials.pop_pending() - handle = Actor.configure(trial) - result_streams.add(handle) - - trial, handle, payload = process_next(result_streams) - - if payload.type == "SAVE": - trial.update(payload.checkpoint) - storage.save(trials) - elif payload.type == "STEP": - trial.track(payload.result) - log(payload.result) - else: - pass - - if should_checkpoint(trial): - Executor.save(handle) - elif not is_finished(trial): - action = Scheduler(trial, trials) - Executor.execute_action(action, trial) - elif is_finished(trial): - factory.update(trial, result) - storage.save(factory, trials) - - - -# concurrent with checkpointing - - - -# concurrent with pbt - -while factory.has_next() or not trials.not_done(): - # ... - - trial, handle, payload = process_next(result_streams) - elif not is_finished(trial): - action = pbt(trial, trials) - factory.queue(new_hps, trial3.checkpoint) - - Executor.execute_action(action, trial) - - - -# Restore last experiment -exp = Experiment.restore(storage=X) -trials = exp.get_trial(filter=failed) - -run(func, manual_list) -run(func, space, searcher) -run(func, grid) -run(func, manual_list, checkpoints) -run(func, manual_list) - - - - -run(func, exp) - - -# Core concepts: -# Result: Dict[str, value] -# t_state: Any -# Trial: hps[Dict], static_config[Dict] -# TrialTrace: List[Result], t_state, Trial - -# Trainable: t_state, Trial -> t_state, Result - -# Optimizer: o_state, List[TrialTrace], Trainable -> ( -# o_state, List[TrialTrace]) - -# SearchAlg: state, Dict[hps, Result] -> state, hps - - -# Execution concepts - -# Checkpoint -# LiveTrial: TrialTrace, location, status, is_idle -# Status: PENDING, SAVING, RESTORING, TRAINING, SETUP, STOP, ERROR -# Trainer: Trainable, location, t_state, Trial -> t_state, Result -step(o_state, LiveTrial, List[LiveTrial]) -> LiveTrial, *args - Server(List[LiveTrial]) -> List[LiveTrial] - checkpointer(LiveTrial, manager_state) -> TrialTrace - Logger(TrialTrace) - Optimizer(o_trace, ...) - Syncer() - - - - -TrialExecutor(reuse_actors, queue_trials) -ServerConfig(server_port) -Optimizer(stop, search_alg, scheduler) -Experiment(resume, local_dir) -CheckpointManager( - sync_on_checkpoint, - keep_checkpoints_num, - global_checkpoint_period, - export_formats, - checkpoint_score_attr -) -### Tune commands -tune.set_log_config( - upload_dir, - sync_to_cloud, - trial_name_creator, - sync_to_driver, - progress_reporter, - loggers, - verbose -) -tune.set_server(ServerConfig) -tune.run( - experiment, - trainable_fn, - raise_on_failed_trial, # where can this go? - max_failures: int or "fail-fast", - trial_executor, - restore_from, # checkpoint path to restore from - resources_per_trial, - num_samples, - search_space, # I'm not a big fan of this because Search Algs have their own search_space too - Optimizer, - CheckpointManager) - - - - - - - diff --git a/python/ray/tune/_test3.py b/python/ray/tune/_test3.py deleted file mode 100644 index 934fc1381..000000000 --- a/python/ray/tune/_test3.py +++ /dev/null @@ -1,42 +0,0 @@ -checkpoint_manager = State(location) -checkpoint_manager.optimizer_state -checkpoint_manager.generator_state -checkpoint_manager.trial_state - -# How much have we learned -optimizer = Optimizer.from_checkpoint(checkpoint_manager) - -optimizer = Optimizer(space, checkpoint=checkpoint_manager) -for x, y in warm_start: - optimizer.report(x, y) - -samples = [optimizer.sample(random=True) for i in range(50)] - -spec = TrialSpec(func, local_dir, checkpoint) - -generator = TrialGenerator.from_checkpoint(checkpoint, optimizer) - -generator = TrialGenerator.from_trials(trials) - -generator = TrialGenerator.from_spec(spec, optimizer) -generator.configure(checkpoint_callback) -generator.queue(samples) -generator.queue(num_samples=50, repeat=3, max_concurrent=4) -generator.next() - -generator = TrialGenerator.from_multi_spec(spec) - -run(generator) -################################################### - -# Exploration process -trial_list = get_trials(checkpoint_manager) -failed_trials = [t.reset() for t in trial_list if t.status == "FAILED"] - -generator = TrialGenerator.from_trials(failed_trials) -tune.run(generator) - -builder = Builder() - -for params in samples: - yield builder.build(params) \ No newline at end of file diff --git a/python/ray/tune/examples/cluster-p3.yaml b/python/ray/tune/examples/cluster-p3.yaml deleted file mode 100644 index 85a02fde1..000000000 --- a/python/ray/tune/examples/cluster-p3.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# An unique identifier for the head node and workers of this cluster. -cluster_name: sgd-pytorch - -# The maximum number of workers nodes to launch in addition to the head -# node. This takes precedence over min_workers. min_workers default to 0. -min_workers: 0 -initial_workers: 0 -max_workers: 0 - -target_utilization_fraction: 0.9 - -# If a node is idle for this many minutes, it will be removed. -idle_timeout_minutes: 20 -# docker: -# image: tensorflow/tensorflow:1.5.0-py3 -# container_name: ray_docker - -# Cloud-provider specific configuration. -provider: - type: aws - region: us-west-2 - -# How Ray will authenticate with newly launched nodes. -auth: - ssh_user: ubuntu - -head_node: - InstanceType: p3.8xlarge - ImageId: latest_dlami - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - - -worker_nodes: - InstanceType: p3.8xlarge - ImageId: latest_dlami - # Run workers on spot by default. Comment this out to use on-demand. - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - -setup_commands: - - ray || pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl - - pip install -U ipdb ray[rllib] torch torchvision - # Install apex. - # - rm -rf apex || true - # - git clone https://github.com/NVIDIA/apex && cd apex && pip install -v --no-cache-dir ./ || true - - -file_mounts: { -} - -# Custom commands that will be run on the head node after common setup. -head_setup_commands: [] - -# Custom commands that will be run on worker nodes after common setup. -worker_setup_commands: [] - -# # Command to start ray on the head node. You don't need to change this. -head_start_ray_commands: - - ray stop - - ray start --head --redis-port=6379 --object-manager-port=8076 --autoscaling-config=~/ray_bootstrap_config.yaml --object-store-memory=1000000000 - -# Command to start ray on worker nodes. You don't need to change this. -worker_start_ray_commands: - - ray stop - - ray start --address=$RAY_HEAD_IP:6379 --object-manager-port=8076 --object-store-memory=1000000000 - diff --git a/python/ray/tune/session-default.yaml b/python/ray/tune/session-default.yaml deleted file mode 100644 index da8a1159d..000000000 --- a/python/ray/tune/session-default.yaml +++ /dev/null @@ -1,73 +0,0 @@ -# An unique identifier for the head node and workers of this cluster. -cluster_name: sgd-pytorch - -# The maximum number of workers nodes to launch in addition to the head -# node. This takes precedence over min_workers. min_workers default to 0. -min_workers: 0 -initial_workers: 0 -max_workers: 0 - -target_utilization_fraction: 0.9 - -# If a node is idle for this many minutes, it will be removed. -idle_timeout_minutes: 20 -# docker: -# image: tensorflow/tensorflow:1.5.0-py3 -# container_name: ray_docker - -# Cloud-provider specific configuration. -provider: - type: aws - region: us-west-2 - -# How Ray will authenticate with newly launched nodes. -auth: - ssh_user: ubuntu - -head_node: - InstanceType: g3.8xlarge - ImageId: latest_dlami - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - - -worker_nodes: - InstanceType: g3.8xlarge - ImageId: latest_dlami - # Run workers on spot by default. Comment this out to use on-demand. - InstanceMarketOptions: - MarketType: spot - # SpotOptions: - # MaxPrice: "9.0" - -setup_commands: - - ray || pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl - - pip install -U ipdb ray[rllib] torch torchvision - # Install apex. - # - rm -rf apex || true - # - git clone https://github.com/NVIDIA/apex && cd apex && pip install -v --no-cache-dir ./ || true - - -file_mounts: { - ~/anaconda3/lib/python3.6/site-packages/ray/tune: ./tune/, - ~/anaconda3/lib/python3.6/site-packages/ray/util/sgd/torch: ./util/sgd/torch/ -} - -# Custom commands that will be run on the head node after common setup. -head_setup_commands: [] - -# Custom commands that will be run on worker nodes after common setup. -worker_setup_commands: [] - -# # Command to start ray on the head node. You don't need to change this. -head_start_ray_commands: - - ray stop - - ray start --head --redis-port=6379 --object-manager-port=8076 --autoscaling-config=~/ray_bootstrap_config.yaml --object-store-memory=1000000000 - -# Command to start ray on worker nodes. You don't need to change this. -worker_start_ray_commands: - - ray stop - - ray start --address=$RAY_HEAD_IP:6379 --object-manager-port=8076 --object-store-memory=1000000000 - diff --git a/python/ray/tune/test.th b/python/ray/tune/test.th deleted file mode 100644 index 7dbfb6790dfdf91be66d27abac1aca4d8f581158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmZo*>f*}zGso?xLe`1^NxcRp-ED