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

Add up_if_not to clusters in examples #999

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/llama2-13b-ec2/llama2_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def predict(self, prompt_text, **inf_kwargs):
# the script code will run when Runhouse attempts to run code remotely.
# :::
if __name__ == "__main__":
gpu = rh.cluster(name="rh-a10x", instance_type="A10G:1", provider="aws")
gpu = rh.cluster(name="rh-a10x", instance_type="A10G:1", provider="aws").up_if_not()

# Next, we define the environment for our module. This includes the required dependencies that need
# to be installed on the remote machine, as well as any secrets that need to be synced up from local to remote.
Expand Down
5 changes: 3 additions & 2 deletions examples/llama2-fine-tuning-with-lora/llama2_fine_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ def generate(self, query: str, max_length: int = DEFAULT_MAX_LENGTH):
# the script code will run when Runhouse attempts to run code remotely.
# :::
if __name__ == "__main__":
cluster = rh.cluster(name="rh-a10x", instance_type="A10G:1", provider="aws")

cluster = rh.cluster(
name="rh-a10x", instance_type="A10G:1", provider="aws"
).up_if_not()
# Next, we define the environment for our module. This includes the required dependencies that need
# to be installed on the remote machine, as well as any secrets that need to be synced up from local to remote.
# Passing `huggingface` to the `secrets` parameter will load the Hugging Face token we set up earlier.
Expand Down
2 changes: 1 addition & 1 deletion examples/llama3-8b-ec2/llama3_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def predict(self, prompt_text, **inf_kwargs):
if __name__ == "__main__":
gpu = rh.cluster(
name="rh-a10x", instance_type="A10G:1", memory="32+", provider="aws"
)
).up_if_not()

# Next, we define the environment for our module. This includes the required dependencies that need
# to be installed on the remote machine, as well as any secrets that need to be synced up from local to remote.
Expand Down
2 changes: 1 addition & 1 deletion examples/llama3-fine-tuning-lora/llama3_fine_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def generate(self, query: str, max_length: int = DEFAULT_MAX_LENGTH):
instance_type="A10G:1",
memory="32+",
provider="aws",
)
).up_if_not()

# Next, we define the environment for our module. This includes the required dependencies that need
# to be installed on the remote machine, as well as any secrets that need to be synced up from local to remote.
Expand Down
2 changes: 1 addition & 1 deletion examples/llama3-vllm-gcp/llama3_vllm_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def main():
# open_ports=[443], # Expose HTTPS port to public
# server_connection_type="tls", # Specify how runhouse communicates with this cluster
# den_auth=False, # No authentication required to hit this cluster (NOT recommended)
)
).up_if_not()

# We'll set an `autostop_mins` of 30 for this example. If you'd like your cluster to run indefinitely, set `autostop_mins=-1`.
# You can use SkyPilot in the terminal to manage your active clusters with `sky status` and `sky down <cluster_id>`.
Expand Down
Loading