From 03cc5674c221ae0d07d33557c40e58e3d03b71db Mon Sep 17 00:00:00 2001 From: peterschmidt85 Date: Wed, 22 Oct 2025 00:45:55 -0700 Subject: [PATCH 1/2] [GCP] Support G4 instance type GA #3212 --- src/dstack/_internal/core/backends/base/offers.py | 1 - src/dstack/_internal/core/backends/gcp/compute.py | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/dstack/_internal/core/backends/base/offers.py b/src/dstack/_internal/core/backends/base/offers.py index 00269217c5..46c9f8ec34 100644 --- a/src/dstack/_internal/core/backends/base/offers.py +++ b/src/dstack/_internal/core/backends/base/offers.py @@ -23,7 +23,6 @@ "oci-spot", "lambda-arm", "gcp-a4", - "gcp-g4-preview", "gcp-dws-calendar-mode", ] diff --git a/src/dstack/_internal/core/backends/gcp/compute.py b/src/dstack/_internal/core/backends/gcp/compute.py index 3fb4fb7b3c..23aab379dd 100644 --- a/src/dstack/_internal/core/backends/gcp/compute.py +++ b/src/dstack/_internal/core/backends/gcp/compute.py @@ -146,19 +146,13 @@ 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 preview or _has_gpu_quota(quotas[region], offer.instance.resources): + if _has_gpu_quota(quotas[region], offer.instance.resources): availability = InstanceAvailability.UNKNOWN # todo quotas: cpu, memory, global gpu, tpu offer_with_availability = InstanceOfferWithAvailability( @@ -1027,8 +1021,8 @@ def _has_gpu_quota(quotas: Dict[str, float], resources: Resources) -> bool: gpu = resources.gpus[0] if _is_tpu(gpu.name): return True - if gpu.name in ["B200", "H100"]: - # B200, H100 and H100_MEGA quotas are not returned by `regions_client.list` + if gpu.name in ["B200", "H100", "RTXPRO6000"]: + # B200, H100, H100_MEGA, and RTXPRO6000 quotas are not returned by `regions_client.list` return True quota_name = f"NVIDIA_{gpu.name}_GPUS" if gpu.name == "A100" and gpu.memory_mib == 80 * 1024: From 053fe29744bb98197b859fa586e2ffd02578e359 Mon Sep 17 00:00:00 2001 From: Jvst Me Date: Thu, 23 Oct 2025 09:38:16 +0200 Subject: [PATCH 2/2] Review fix - Add `gcp-g4` gpuhunt flag - Update `preview_features` description --- src/dstack/_internal/core/backends/base/offers.py | 1 + src/dstack/_internal/core/backends/gcp/models.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dstack/_internal/core/backends/base/offers.py b/src/dstack/_internal/core/backends/base/offers.py index 46c9f8ec34..ea20055b71 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", "gcp-dws-calendar-mode", ] diff --git a/src/dstack/_internal/core/backends/gcp/models.py b/src/dstack/_internal/core/backends/gcp/models.py index 647b49d486..4d06144ee8 100644 --- a/src/dstack/_internal/core/backends/gcp/models.py +++ b/src/dstack/_internal/core/backends/gcp/models.py @@ -92,7 +92,10 @@ class GCPBackendConfig(CoreModel): preview_features: Annotated[ Optional[List[Literal["g4"]]], Field( - description=("The list of preview GCP features to enable. Supported values: `g4`"), + description=( + "The list of preview GCP features to enable." + " There are currently no preview features" + ), max_items=1, ), ] = None