Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
asaiacai committed Dec 19, 2024
1 parent 279dc93 commit 3b093b0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
5 changes: 3 additions & 2 deletions sky/clouds/do.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json
import typing
from typing import Dict, Iterator, List, Optional, Tuple
from typing import Dict, Iterator, List, Optional, Tuple, Union

from sky import clouds
from sky.adaptors import do
Expand Down Expand Up @@ -158,7 +158,7 @@ def get_default_instance_type(

@classmethod
def get_accelerators_from_instance_type(
cls, instance_type: str) -> Optional[Dict[str, int]]:
cls, instance_type: str) -> Optional[Dict[str, Union[int, float]]]:
return service_catalog.get_accelerators_from_instance_type(
instance_type, clouds='DO')

Expand All @@ -172,6 +172,7 @@ def make_deploy_resources_variables(
cluster_name: resources_utils.ClusterName,
region: 'clouds.Region',
zones: Optional[List['clouds.Zone']],
num_nodes: int,
dryrun: bool = False) -> Dict[str, Optional[str]]:
del zones, dryrun, cluster_name

Expand Down
4 changes: 2 additions & 2 deletions sky/clouds/service_catalog/do_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import typing
from typing import Dict, List, Optional, Tuple
from typing import Dict, List, Optional, Tuple, Union

from sky.clouds.service_catalog import common
from sky.utils import ux_utils
Expand Down Expand Up @@ -60,7 +60,7 @@ def get_default_instance_type(


def get_accelerators_from_instance_type(
instance_type: str) -> Optional[Dict[str, int]]:
instance_type: str) -> Optional[Dict[str, Union[int, float]]]:
return common.get_accelerators_from_instance_type_impl(_df, instance_type)


Expand Down
10 changes: 5 additions & 5 deletions tests/smoke_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def test_load_dump_yaml_config_equivalent(self):
# ---------- Testing Multiple Accelerators ----------
@pytest.mark.no_fluidstack # Fluidstack does not support K80 gpus for now
@pytest.mark.no_paperspace # Paperspace does not support K80 gpus
@pytest.mark.no_do # DO does not support K80s
@pytest.mark.no_do # DO does not support K80s
def test_multiple_accelerators_ordered():
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand All @@ -439,7 +439,7 @@ def test_multiple_accelerators_ordered():

@pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs
@pytest.mark.no_paperspace # Paperspace does not support T4 GPUs
@pytest.mark.no_do # DO does not have multiple accelerators
@pytest.mark.no_do # DO does not have multiple accelerators
def test_multiple_accelerators_ordered_with_default():
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand All @@ -456,7 +456,7 @@ def test_multiple_accelerators_ordered_with_default():

@pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs
@pytest.mark.no_paperspace # Paperspace does not support T4 GPUs
@pytest.mark.no_do # DO does not have multiple accelerators
@pytest.mark.no_do # DO does not have multiple accelerators
def test_multiple_accelerators_unordered():
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand All @@ -472,7 +472,7 @@ def test_multiple_accelerators_unordered():

@pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs
@pytest.mark.no_paperspace # Paperspace does not support T4 GPUs
@pytest.mark.no_do # DO does not support multiple accelerators
@pytest.mark.no_do # DO does not support multiple accelerators
def test_multiple_accelerators_unordered_with_default():
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_multiple_resources():
@pytest.mark.no_paperspace # Requires other clouds to be enabled
@pytest.mark.no_kubernetes
@pytest.mark.aws # SkyBenchmark requires S3 access
@pytest.mark.no_do # requires other clouds to be enabled
@pytest.mark.no_do # requires other clouds to be enabled
def test_sky_bench(generic_cloud: str):
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand Down
9 changes: 5 additions & 4 deletions tests/smoke_tests/test_cluster_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@pytest.mark.no_scp # SCP does not have T4 gpus. Run test_scp_job_queue instead
@pytest.mark.no_paperspace # Paperspace does not have T4 gpus.
@pytest.mark.no_oci # OCI does not have T4 gpus
@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}])
@pytest.mark.parametrize('accelerator', [{'do': 'H100'}])
def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]):
accelerator = accelerator.get(generic_cloud, 'T4')
name = smoke_tests_utils.get_cluster_name()
Expand Down Expand Up @@ -79,7 +79,7 @@ def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]):
@pytest.mark.no_scp # Doesn't support SCP for now
@pytest.mark.no_oci # Doesn't support OCI for now
@pytest.mark.no_kubernetes # Doesn't support Kubernetes for now
@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}])
@pytest.mark.parametrize('accelerator', [{'do': 'H100'}])
@pytest.mark.parametrize(
'image_id',
[
Expand All @@ -96,7 +96,8 @@ def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]):
# 2. python>=3.12 works with SkyPilot runtime.
'docker:winglian/axolotl:main-latest'
])
def test_job_queue_with_docker(generic_cloud: str, image_id: str, accelerator: Dict[str, str]):
def test_job_queue_with_docker(generic_cloud: str, image_id: str,
accelerator: Dict[str, str]):
accelerator = accelerator.get(generic_cloud, 'T4')
name = smoke_tests_utils.get_cluster_name() + image_id[len('docker:'):][:4]
total_timeout_minutes = 40 if generic_cloud == 'azure' else 15
Expand Down Expand Up @@ -389,7 +390,7 @@ def test_docker_preinstalled_package(generic_cloud: str):
@pytest.mark.no_ibm # IBM Cloud does not have T4 gpus
@pytest.mark.no_scp # SCP does not support num_nodes > 1 yet
@pytest.mark.no_oci # OCI Cloud does not have T4 gpus
@pytest.mark.no_do # DO does not have T4 gpus
@pytest.mark.no_do # DO does not have T4 gpus
def test_multi_echo(generic_cloud: str):
name = smoke_tests_utils.get_cluster_name()
test = smoke_tests_utils.Test(
Expand Down
6 changes: 3 additions & 3 deletions tests/smoke_tests/test_managed_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_managed_jobs(generic_cloud: str):
@pytest.mark.no_scp # SCP does not support spot instances
@pytest.mark.no_paperspace # Paperspace does not support spot instances
@pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances
@pytest.mark.no_do # DO does not support spot instances
@pytest.mark.no_do # DO does not support spot instances
@pytest.mark.managed_jobs
def test_job_pipeline(generic_cloud: str):
"""Test a job pipeline."""
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_job_pipeline(generic_cloud: str):
@pytest.mark.no_scp # SCP does not support spot instances
@pytest.mark.no_paperspace # Paperspace does not support spot instances
@pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances
@pytest.mark.no_do # DO does not support spot instances
@pytest.mark.no_do # DO does not support spot instances
@pytest.mark.managed_jobs
def test_managed_jobs_failed_setup(generic_cloud: str):
"""Test managed job with failed setup."""
Expand Down Expand Up @@ -388,7 +388,7 @@ def test_managed_jobs_pipeline_recovery_gcp():
@pytest.mark.no_scp # SCP does not support spot instances
@pytest.mark.no_paperspace # Paperspace does not support spot instances
@pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances
@pytest.mark.no_do # DO does not have spot instances
@pytest.mark.no_do # DO does not have spot instances
@pytest.mark.managed_jobs
def test_managed_jobs_recovery_default_resources(generic_cloud: str):
"""Test managed job recovery for default resources."""
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke_tests/test_sky_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_skyserve_oci_http():


@pytest.mark.no_fluidstack # Fluidstack does not support T4 gpus for now
@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}])
@pytest.mark.parametrize('accelerator', [{'do': 'H100'}])
@pytest.mark.serve
def test_skyserve_llm(generic_cloud: str, accelerator: Dict[str, str]):
"""Test skyserve with real LLM usecase"""
Expand Down

0 comments on commit 3b093b0

Please sign in to comment.