diff --git a/src/dstack/_internal/core/backends/base/offers.py b/src/dstack/_internal/core/backends/base/offers.py index c081b4271..16ed0aae2 100644 --- a/src/dstack/_internal/core/backends/base/offers.py +++ b/src/dstack/_internal/core/backends/base/offers.py @@ -23,6 +23,7 @@ "oci-spot", "lambda-arm", "gcp-a4", + "gcp-g4-preview", ] diff --git a/src/dstack/_internal/core/backends/gcp/compute.py b/src/dstack/_internal/core/backends/gcp/compute.py index 3d2af719b..66fb09bd4 100644 --- a/src/dstack/_internal/core/backends/gcp/compute.py +++ b/src/dstack/_internal/core/backends/gcp/compute.py @@ -130,13 +130,19 @@ def get_all_offers_with_availability(self) -> List[InstanceOfferWithAvailability offer_keys_to_offers = {} offers_with_availability = [] for offer in offers: + preview = False + if offer.instance.name.startswith("g4-standard-"): + if self.config.preview_features and "g4" in self.config.preview_features: + preview = True + else: + continue region = offer.region[:-2] # strip zone key = (_unique_instance_name(offer.instance), region) if key in offer_keys_to_offers: offer_keys_to_offers[key].availability_zones.append(offer.region) continue availability = InstanceAvailability.NO_QUOTA - if _has_gpu_quota(quotas[region], offer.instance.resources): + if preview or _has_gpu_quota(quotas[region], offer.instance.resources): availability = InstanceAvailability.UNKNOWN # todo quotas: cpu, memory, global gpu, tpu offer_with_availability = InstanceOfferWithAvailability( diff --git a/src/dstack/_internal/core/backends/gcp/models.py b/src/dstack/_internal/core/backends/gcp/models.py index 00c9492be..647b49d48 100644 --- a/src/dstack/_internal/core/backends/gcp/models.py +++ b/src/dstack/_internal/core/backends/gcp/models.py @@ -89,6 +89,13 @@ class GCPBackendConfig(CoreModel): description="The tags (labels) that will be assigned to resources created by `dstack`" ), ] = None + preview_features: Annotated[ + Optional[List[Literal["g4"]]], + Field( + description=("The list of preview GCP features to enable. Supported values: `g4`"), + max_items=1, + ), + ] = None class GCPBackendConfigWithCreds(GCPBackendConfig): diff --git a/src/dstack/_internal/core/backends/gcp/resources.py b/src/dstack/_internal/core/backends/gcp/resources.py index 57f2f8548..a28343cb3 100644 --- a/src/dstack/_internal/core/backends/gcp/resources.py +++ b/src/dstack/_internal/core/backends/gcp/resources.py @@ -26,6 +26,7 @@ {"accelerator_name": "nvidia-tesla-t4", "gpu_name": "T4", "memory_mb": 1024 * 16}, {"accelerator_name": "nvidia-tesla-v100", "gpu_name": "V100", "memory_mb": 1024 * 16}, {"accelerator_name": "nvidia-tesla-p100", "gpu_name": "P100", "memory_mb": 1024 * 16}, + {"accelerator_name": "nvidia-rtx-pro-6000", "gpu_name": "RTXPRO6000", "memory_mb": 1024 * 96}, ] @@ -499,5 +500,6 @@ def instance_type_supports_persistent_disk(instance_type_name: str) -> bool: "h3-", "v6e", "a4-", + "g4-", ] )