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

Preliminary Vast AI support #4365

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

kristopolous
Copy link

@kristopolous kristopolous commented Nov 15, 2024

This is preliminary support for Vast. It currently works on an unreleased version of the SDK which we will soon get up to PyPy

The document https://docs.google.com/document/d/1oWox3qb3Kz3wXXSGg9ZJWwijoa99a3PIQUHBR8UgEGs/edit?pli=1&tab=t.0 was followed and all the testing passed

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

I'm pretty sure there will need to be edits, I'm fine with that. This is attempt 1. The outstanding work:

We need to

  • tidy up our dockerhub and will get a better image to launch.
  • release the updates to the sdk and come up with a pip name for it.
  • get our catalog to update in the git hook flow as described (my goal is every 6 hours)

@Michaelvll Michaelvll requested a review from cblmemo November 16, 2024 02:46
Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to this @kristopolous ! This is really exciting. Left some discussions. One main confusion I have is that, does vast ai like runpod, a cloud providing pods to users as their "VM"s? Asking because I'm seeing a lot of docker related code, and just want to confirm :)

sky/adaptors/vast.py Show resolved Hide resolved
sky/clouds/vast.py Show resolved Hide resolved
Comment on lines 34 to 37
clouds.CloudImplementationFeatures.STORAGE_MOUNTING:
('Mounting object stores is not supported on Vast. To read data '
'from object stores on Vast, use `mode: COPY` to copy the data '
'to local disk.'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, is this not supported as well? This seems only not enabled in runpod for now, which I suppose is due to its pod nature for provisioned "VM"s. Is vast ai also provide pods to the user?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a copy/paste. We're actually working on releasing storage by the end of the calendar year. Right now, purchasing additional storage through us is not supported. I will change this to be more reflective of the current state of things.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see 98e3db5

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make sure, it sounds like you are referring to cloud storage from VastAI? IIUC this feature actually means can you mount storages from any cloud (e.g. S3, GCS) in the VastAI clusters, and it should be supported as long as some mounting utils is supported. Though if VastAI using the same container fashion provisioning, it might not work as well. cc @romilbhardwaj - what is the reason runpod not support this feature?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

users are succeeding in this through our container model but we don't have any "official" support. We just announced/released VM support today and with it users will be able to do more conventional mounting of remote stores. If this is really a deal breaker I can work on making it officially supported everywhere somehow but that's a larger project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. If that is the case then LGTM!

'from object stores on Vast, use `mode: COPY` to copy the data '
'to local disk.'),
}
_MAX_CLUSTER_NAME_LEN_LIMIT = 120
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to search this but does not seems yielding an answer for me. Is it possible to add some doc reference for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that was just sloppiness on my part. I'll update it. Thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was some additional cleanup required: kristopolous@3eb8823

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump for this - not seeing the reference now?

sky/clouds/vast.py Outdated Show resolved Hide resolved
sky/provision/vast/utils.py Show resolved Hide resolved
sky/provision/vast/utils.py Show resolved Hide resolved
sky/provision/vast/instance.py Outdated Show resolved Hide resolved
sky/provision/vast/instance.py Show resolved Hide resolved
sky/provision/vast/instance.py Show resolved Hide resolved
@kristopolous
Copy link
Author

Thanks for contributing to this @kristopolous ! This is really exciting. Left some discussions. One main confusion I have is that, does vast ai like runpod, a cloud providing pods to users as their "VM"s? Asking because I'm seeing a lot of docker related code, and just want to confirm :)

historically, runpod was a clone of vast. We currently offer docker-style containers and will be providing vms soonish (probably before end of year)

@kristopolous kristopolous force-pushed the vast.ai-support branch 3 times, most recently from e9e922a to 4c9aff9 Compare November 21, 2024 22:28
@kristopolous
Copy link
Author

these test passing is blocked by https://github.com/skypilot-org/skypilot-catalog/pull/100/commits

Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kristopolous for the amazing speed! Just finished a pass and left some discussion :))

@@ -0,0 +1,67 @@
"""A script that generates the Vast Cloud catalog. """

# pylint: disable=assignment-from-no-return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

import re
import sys

from vastai_sdk import VastAI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use adaptors? Reference

Comment on lines +41 to +39
gpu_name = instance_type.split('-')[1].replace('_', ' ')
num_gpus = int(instance_type.split('-')[0].replace('x', ''))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image I mean this part

from vastai_sdk import VastAI


def create_instance_type(obj):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def create_instance_type(obj):
def create_instance_type(obj: Dict[str, Any]) -> str:

obj['cpu_cores'])


def dot_get(d, key):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def dot_get(d, key):
def dot_get(d: dict, key: str) -> Any:

head_instance_id = _get_head_instance_id(running_instances)
stopped_instances = status_filter(instances, ['EXITED', 'STOPPED'])

if config.resume_stopped_nodes and len(stopped_instances):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if config.resume_stopped_nodes and len(stopped_instances):
if config.resume_stopped_nodes and stopped_instances:

nit

del cluster_name_on_cloud, ports, provider_config # Unused.


def query_ports(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but it seems like the open_ports function is missing..? while the OPEN_PORTS is not in the cloud unimplemented features? Should we implement this?

instance_id=instance_id,
internal_ip=instance_info['local_ipaddrs'].strip(),
external_ip=instance_info['public_ipaddr'],
ssh_port=instance_info['ports']['22/tcp'][0]['HostPort'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the insatnce['ssh_ports'] field instead of hard code a 22?

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls double check this file - correct me if im wrong, but seems like some merge conflict is not handled..? why are we adding so much code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, pls check the merge conflict for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants