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

Updates to running ray for bulk experiments #333

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions notebooks/RunExperiments/cluster_config.yaml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ cluster_name: default

# The maximum number of workers nodes to launch in addition to the head
# node.
max_workers: 2
max_workers: 20

# The autoscaler will scale up the cluster faster with higher upscaling speed.
# E.g., if the task requires adding more nodes then autoscaler will gradually
@@ -41,7 +41,7 @@ idle_timeout_minutes: 5
provider:
type: gcp
region: us-west1
availability_zone: us-west1-a
availability_zone: us-west1-b
project_id: motleys # Globally unique project id

# How Ray will authenticate with newly launched nodes.
@@ -60,7 +60,7 @@ auth:
available_node_types:
ray_head_default:
# The resources provided by this node type.
resources: {"CPU": 2}
resources: {"CPU": 0}
# Provider-specific config for the head node, e.g. instance type. By default
# Ray will auto-configure unspecified fields such as subnets and ssh-keys.
# For more documentation on available fields, see:
@@ -93,15 +93,15 @@ available_node_types:
min_workers: 1
# The maximum number of worker nodes of this type to launch.
# This takes precedence over min_workers.
max_workers: 5
max_workers: 20
# The resources provided by this node type.
resources: {"CPU": 2}
# Provider-specific config for the head node, e.g. instance type. By default
# Ray will auto-configure unspecified fields such as subnets and ssh-keys.
# For more documentation on available fields, see:
# https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert
node_config:
machineType: n1-standard-2
machineType: n2-highmem-2
disks:
- boot: true
autoDelete: true
487 changes: 275 additions & 212 deletions notebooks/RunExperiments/runners/experiment_runner.py

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion notebooks/RunExperiments/runners/iv.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import os
import ray

from experiment_runner import run_batch, generate_plots

identifier = "Egor_test"
kind = "IV"
metrics = ["energy_distance", "frobenius_norm", "codec"]
use_ray = False
remote_function = ray.remote(run_batch)
calls = []

out_dir = run_batch(identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"))
out_dir = run_batch(
identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"), use_ray=use_ray
)
# plot results
# upper_bounds = {"MSE": 1e2, "policy_risk": 0.2}
# lower_bounds = {"erupt": 0.06, "bite": 0.75}
6 changes: 4 additions & 2 deletions notebooks/RunExperiments/runners/kc.py
Original file line number Diff line number Diff line change
@@ -15,8 +15,10 @@
"codec", # NEW
"bite", # NEW
]

out_dir = run_batch(identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"))
use_ray = True
out_dir = run_batch(
identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"), use_ray=use_ray
)
# plot results
# upper_bounds = {"MSE": 1e2, "policy_risk": 0.2}
# lower_bounds = {"erupt": 0.06, "bite": 0.75}
6 changes: 4 additions & 2 deletions notebooks/RunExperiments/runners/kckp.py
Original file line number Diff line number Diff line change
@@ -15,8 +15,10 @@
"codec", # NEW
"bite", # NEW
]

out_dir = run_batch(identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"))
use_ray = True
out_dir = run_batch(
identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"), use_ray=use_ray
)
# plot results
# upper_bounds = {"MSE": 1e2, "policy_risk": 0.2}
# lower_bounds = {"erupt": 0.06, "bite": 0.75}
6 changes: 4 additions & 2 deletions notebooks/RunExperiments/runners/rct.py
Original file line number Diff line number Diff line change
@@ -15,8 +15,10 @@
"codec", # NEW
"bite", # NEW
]

out_dir = run_batch(identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"))
use_ray = True
out_dir = run_batch(
identifier, kind, metrics, dataset_path=os.path.realpath("../RunDatasets"), use_ray=use_ray
)
# plot results
# upper_bounds = {"MSE": 1e2, "policy_risk": 0.2}
# lower_bounds = {"erupt": 0.06, "bite": 0.75}