From 9386f0872bb3928421211aff9d4973236d1b858f Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 6 Jul 2026 19:04:00 +0800 Subject: [PATCH] fix(gpu-service): pick sliced candidate for slice-only instance types --- src/pages/gpu-service/instances/config/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/gpu-service/instances/config/index.ts b/src/pages/gpu-service/instances/config/index.ts index d459c1cf..d11d930c 100644 --- a/src/pages/gpu-service/instances/config/index.ts +++ b/src/pages/gpu-service/instances/config/index.ts @@ -275,7 +275,7 @@ export const pickCandidateForAccelerator = < >( tiers: | { - onceMaxRequest: { accelerator?: string }; + onceMaxRequest: { accelerator?: string; acceleratorSliced?: string }; candidates?: C[] | null; }[] | undefined @@ -305,9 +305,14 @@ export const pickCandidateForAccelerator = < // count === 0 ? parseQuantity(tier.onceMaxRequest.accelerator) > count; this is CPU-only case. for (const tier of sorted) { const acceleratorCount = parseQuantity(tier.onceMaxRequest?.accelerator); - const fits = acceleratable - ? acceleratorCount >= count - : acceleratorCount === 0; + // Sliced mode requests a fraction of a single card, so the tier's + // whole-card accelerator count (0 for a slice-only type) can't gate it; + // fit on the tier's sliced capacity instead. + const fits = sliced + ? parseQuantity(tier.onceMaxRequest?.acceleratorSliced) > 0 + : acceleratable + ? acceleratorCount >= count + : acceleratorCount === 0; if (!fits) continue; const candidate = tier.candidates?.find(hasResources); if (candidate) return candidate;