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

Minor update to sort by price in show-gpus #2933

Merged

Conversation

Vaibhav2001
Copy link
Contributor

@Vaibhav2001 Vaibhav2001 commented Jan 2, 2024

This pertains to #2863, and updates previous PR #2892

Minor update to fix the sorting issue mentioned by @concretevitamin #2892 (comment)

sky show-gpus V100 --all-regions                                                                                             ─╯
*NOTE*: for most GCP accelerators, INSTANCE_TYPE == (attachable) means the host VM's cost is not included.

GPU   QTY  CLOUD   INSTANCE_TYPE       DEVICE_MEM  vCPUs  HOST_MEM  HOURLY_PRICE  HOURLY_SPOT_PRICE  REGION
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.060       $ 1.024            us-west-2
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.060       $ 1.139            us-east-2
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.060       $ 1.467            us-east-1
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.305       $ 1.229            eu-west-1
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.366       $ 0.726            ca-central-1
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.589       $ 0.687            eu-west-2
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 3.823       $ 0.971            eu-central-1
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 4.194       $ 1.043            ap-northeast-1
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 4.234       $ 0.469            ap-northeast-2
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 4.234       $ 1.209            ap-southeast-2
V100  1    AWS     p3.2xlarge          16GB        8      61GB      $ 4.234       $ 1.255            ap-southeast-1
V100  4    AWS     p3.8xlarge          16GB        32     244GB     $ 12.240      $ 3.544            us-west-2
V100  4    AWS     p3.8xlarge          16GB        32     244GB     $ 12.240      $ 4.008            us-east-2
V100  4    AWS     p3.8xlarge          16GB        32     244GB     $ 12.240      $ 4.221            us-east-1
V100  4    AWS     p3.8xlarge          16GB        32     244GB     $ 13.220      $ 4.781            eu-west-1

Copy link
Collaborator

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Thanks @Vaibhav2001. GCP requires some care; the following doesn't sort properly:

sky show-gpus --all-regions A100 --cloud gcp
sky show-gpus T4 --all-regions --cloud gcp

sky/clouds/service_catalog/common.py Outdated Show resolved Hide resolved
@concretevitamin
Copy link
Collaborator

Examples mentioned so far seem correct, but adding @Michaelvll to take a look at the dataframe wrangling. I'd have thought the groupby() is easier to understand than drop_duplicates(); also, seems like by removing groupby() we now have some interleaving

» sky show-gpus A100:1 --all-regions
...
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-south-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-south-1
...

whereas on master

...
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-south-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  australia-southeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  europe-central-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  europe-south-1
...

@Vaibhav2001
Copy link
Contributor Author

Vaibhav2001 commented Jan 3, 2024

Examples mentioned so far seem correct, but adding @Michaelvll to take a look at the dataframe wrangling. I'd have thought the groupby() is easier to understand than drop_duplicates(); also, seems like by removing groupby() we now have some interleaving

» sky show-gpus A100:1 --all-regions
...
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100_sxm4  40GB        30     200GB     $ 1.100       -                  asia-south-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-south-1
...

whereas on master

...
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-northeast-2
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  asia-south-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  australia-southeast-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  europe-central-1
A100  1    Lambda  gpu_1x_a100       40GB        30     200GB     $ 1.100       -                  europe-south-1
...

Fixed now! I am adding the sorting by intsance_type as well, because the sorting results in a reshuffling. Also I simplified the logic so we can sort regardless of --all-regions value.

Copy link
Collaborator

@Michaelvll Michaelvll 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 submitting the PR @Vaibhav2001! The sort_values and drop_duplicates implementation looks good to me. Just a minor nit.

sky/clouds/service_catalog/common.py Outdated Show resolved Hide resolved
@Vaibhav2001
Copy link
Contributor Author

@Michaelvll Hi made those changes, should be good to merge.

@Michaelvll Michaelvll merged commit 6c75bf6 into skypilot-org:master Feb 4, 2024
19 checks passed
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.

None yet

3 participants