Skip to content

Commit 47374ef

Browse files
authored
update: gpu order
update: gpu order
2 parents 4f3aba7 + 771e78a commit 47374ef

File tree

5 files changed

+235
-85
lines changed

5 files changed

+235
-85
lines changed

src/components/pricing-page/gpus/desktop-table-gpu.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ const DesktopTableGpu = ({
3131
{!isLoading && (
3232
<>
3333
<GpuTableRow
34-
model="B200"
34+
model="B300"
3535
ram="180GB"
3636
interface="HBM3e"
37-
minPrice={5}
38-
maxPrice={5}
39-
avgPrice={5}
37+
minPrice={6}
38+
maxPrice={6}
39+
avgPrice={6}
4040
providerCount={1}
4141
isB200={true}
42-
id="b200-(gpu-rent)"
42+
id="b300-(gpu-rent)"
4343
href="/gpus-on-demand"
4444
/>
4545
<GpuTableRow
46-
model="B300"
46+
model="B200"
4747
ram="180GB"
4848
interface="HBM3e"
49-
minPrice={6}
50-
maxPrice={6}
51-
avgPrice={6}
49+
minPrice={5}
50+
maxPrice={5}
51+
avgPrice={5}
5252
providerCount={1}
5353
isB200={true}
54-
id="b300-(gpu-rent)"
54+
id="b200-(gpu-rent)"
5555
href="/gpus-on-demand"
5656
/>
5757
</>

src/components/pricing-page/gpus/filter.tsx

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from "@/components/ui/select";
77
import { Check, X } from "lucide-react";
88
import React from "react";
9+
import { GPU_PRIORITY_MODELS } from "./gpu-priority";
910
import { modifyModel, type Gpus } from "./gpu-table";
1011
import { onTop } from "./sort";
1112

@@ -97,6 +98,42 @@ export default function Filter({
9798
]);
9899
}, [res]);
99100

101+
// Priority models after B300/B200 (imported from gpu-priority.ts)
102+
const priorityModels = GPU_PRIORITY_MODELS;
103+
104+
// Helper to sort models with priority (H200, H100, A100 at top, rest by availability)
105+
const sortWithPriority = (models: Gpus["models"]) => {
106+
const priorityGpus: Gpus["models"] = [];
107+
const otherGpus: Gpus["models"] = [];
108+
109+
models.forEach((model) => {
110+
const modelLower = model?.model?.toLowerCase();
111+
if (priorityModels.includes(modelLower)) {
112+
priorityGpus.push(model);
113+
} else {
114+
otherGpus.push(model);
115+
}
116+
});
117+
118+
// Sort priority GPUs by their defined order, then by RAM (80Gi preferred for A100)
119+
priorityGpus.sort((a, b) => {
120+
const aIndex = priorityModels.indexOf(a?.model?.toLowerCase());
121+
const bIndex = priorityModels.indexOf(b?.model?.toLowerCase());
122+
if (aIndex !== bIndex) return aIndex - bIndex;
123+
// For same model (like multiple A100 variants), prefer 80Gi RAM
124+
if (a?.ram === "80Gi" && b?.ram !== "80Gi") return -1;
125+
if (b?.ram === "80Gi" && a?.ram !== "80Gi") return 1;
126+
return b?.availability?.available - a?.availability?.available;
127+
});
128+
129+
// Sort other GPUs by availability
130+
otherGpus.sort(
131+
(a, b) => b?.availability?.available - a?.availability?.available,
132+
);
133+
134+
return [...priorityGpus, ...otherGpus];
135+
};
136+
100137
React.useEffect(() => {
101138
if (
102139
filters.modal.length > 0 ||
@@ -115,32 +152,34 @@ export default function Filter({
115152
.sort(
116153
(a, b) => b?.availability?.available - a?.availability?.available,
117154
);
118-
// Keep B200 and B300 at the top
119-
const b200Models = (filtered || []).filter(
120-
(model) => model?.model?.toLowerCase() === "b200",
121-
);
155+
// Keep B300 and B200 at the top
122156
const b300Models = (filtered || []).filter(
123157
(model) => model?.model?.toLowerCase() === "b300",
124158
);
159+
const b200Models = (filtered || []).filter(
160+
(model) => model?.model?.toLowerCase() === "b200",
161+
);
125162
const otherModels = (filtered || []).filter((model) => {
126163
const modelLower = model?.model?.toLowerCase();
127164
return modelLower !== "b200" && modelLower !== "b300";
128165
});
129-
setFilteredData([...b200Models, ...b300Models, ...otherModels]);
166+
// Apply priority sorting to other models (H200, H100, A100 at top)
167+
setFilteredData([...b300Models, ...b200Models, ...sortWithPriority(otherModels)]);
130168
} else {
131-
// Keep B200 and B300 at the top even when no filters
169+
// Keep B300 and B200 at the top even when no filters
132170
const allModels = res?.models || [];
133-
const b200Models = allModels.filter(
134-
(model) => model?.model?.toLowerCase() === "b200",
135-
);
136171
const b300Models = allModels.filter(
137172
(model) => model?.model?.toLowerCase() === "b300",
138173
);
174+
const b200Models = allModels.filter(
175+
(model) => model?.model?.toLowerCase() === "b200",
176+
);
139177
const otherModels = allModels.filter((model) => {
140178
const modelLower = model?.model?.toLowerCase();
141179
return modelLower !== "b200" && modelLower !== "b300";
142180
});
143-
setFilteredData([...b200Models, ...b300Models, ...otherModels]);
181+
// Apply priority sorting to other models (H200, H100, A100 at top)
182+
setFilteredData([...b300Models, ...b200Models, ...sortWithPriority(otherModels)]);
144183
}
145184
}, [filters, res]);
146185

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Priority order for GPU models (after B300/B200 which are always first)
2+
// Change this list to update the order across all GPU tables and filters
3+
export const GPU_PRIORITY_MODELS: string[] = [
4+
"h200",
5+
"h100",
6+
"a100",
7+
"pro6000se",
8+
"rtx5090",
9+
"rtx4090",
10+
"rtx3090",
11+
];
12+
13+
export type ModelPriority = {
14+
model: string;
15+
ramPreference?: string[];
16+
interfacePreference?: string[];
17+
};
18+
19+
// Model-specific configurations for the onTop sort function
20+
export const GPU_MODEL_PRIORITIES: ModelPriority[] = [
21+
{
22+
model: "h200",
23+
},
24+
{
25+
model: "h100",
26+
},
27+
{
28+
model: "a100",
29+
ramPreference: ["80Gi"],
30+
interfacePreference: ["SXM4"],
31+
},
32+
{
33+
model: "pro6000se",
34+
},
35+
{
36+
model: "rtx5090",
37+
},
38+
{
39+
model: "rtx4090",
40+
},
41+
{
42+
model: "rtx3090",
43+
},
44+
];

src/components/pricing-page/gpus/gpu-table.tsx

Lines changed: 80 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import React from "react";
1212
import DesktopTableGpu from "./desktop-table-gpu";
1313
import { DUMMY_GPU_DATA } from "./dummy-gpu-data";
1414
import Filter, { defaultFilters, type Filters } from "./filter";
15+
import { GPU_PRIORITY_MODELS } from "./gpu-priority";
1516
import GpuTableRow from "./gpu-table-row";
1617
import GpuTableRowSkeleton from "./gpu-table-row-skeleton";
1718
export interface Gpus {
@@ -128,7 +129,7 @@ const formatText = (model: string) => {
128129
};
129130
export const modifyModel = (model: string) => {
130131
if (model === "rtxa6000") return "A6000";
131-
if (model === "pro6000we") return "RTX PRO 6000";
132+
if (model === "pro6000se") return "Pro 6000 SE";
132133
return formatText(model);
133134
};
134135

@@ -181,26 +182,53 @@ export const Tables = ({
181182
const [filteredData, setFilteredData] = React.useState<Gpus["models"]>([]);
182183
const [filters, setFilters] = React.useState<Filters>(defaultFilters);
183184

184-
// Wrapper to always keep B200 and B300 at top
185+
// Priority models after B300/B200 (imported from gpu-priority.ts)
186+
const priorityModels = GPU_PRIORITY_MODELS;
187+
188+
// Wrapper to always keep B300, B200 at top, then H200, H100, A100
185189
const setFilteredDataWithB200First = React.useCallback(
186190
(newData: Gpus["models"] | ((prev: Gpus["models"]) => Gpus["models"])) => {
187191
setFilteredData((prev) => {
188192
const dataToProcess =
189193
typeof newData === "function" ? newData(prev) : newData;
190-
const b200Models = dataToProcess.filter(
191-
(model) => model?.model?.toLowerCase() === "b200",
192-
);
193194
const b300Models = dataToProcess.filter(
194195
(model) => model?.model?.toLowerCase() === "b300",
195196
);
197+
const b200Models = dataToProcess.filter(
198+
(model) => model?.model?.toLowerCase() === "b200",
199+
);
200+
const priorityGpus = dataToProcess.filter((model) => {
201+
const modelLower = model?.model?.toLowerCase();
202+
return (
203+
priorityModels.includes(modelLower) &&
204+
modelLower !== "b200" &&
205+
modelLower !== "b300"
206+
);
207+
});
196208
const otherModels = dataToProcess.filter((model) => {
197209
const modelLower = model?.model?.toLowerCase();
198-
return modelLower !== "b200" && modelLower !== "b300";
210+
return (
211+
modelLower !== "b200" &&
212+
modelLower !== "b300" &&
213+
!priorityModels.includes(modelLower)
214+
);
215+
});
216+
217+
// Sort priority GPUs by their defined order
218+
priorityGpus.sort((a, b) => {
219+
const aIndex = priorityModels.indexOf(a?.model?.toLowerCase());
220+
const bIndex = priorityModels.indexOf(b?.model?.toLowerCase());
221+
if (aIndex !== bIndex) return aIndex - bIndex;
222+
// For same model, prefer 80Gi RAM
223+
if (a?.ram === "80Gi" && b?.ram !== "80Gi") return -1;
224+
if (b?.ram === "80Gi" && a?.ram !== "80Gi") return 1;
225+
return 0;
199226
});
200-
return [...b200Models, ...b300Models, ...otherModels];
227+
228+
return [...b300Models, ...b200Models, ...priorityGpus, ...otherModels];
201229
});
202230
},
203-
[],
231+
[priorityModels],
204232
);
205233
const totalGpus =
206234
filteredData?.length > 0
@@ -221,20 +249,45 @@ export const Tables = ({
221249
const normalizedData = React.useMemo(() => {
222250
const normalized =
223251
filteredData?.map((model) => normalizeGpuModel(model)) ?? [];
224-
// Hardcode B200 and B300 at the top - separate from others
225-
const b200Models = normalized.filter(
226-
(model) => model?.model?.toLowerCase() === "b200",
227-
);
252+
// Hardcode B300 and B200 at the top - separate from others
228253
const b300Models = normalized.filter(
229254
(model) => model?.model?.toLowerCase() === "b300",
230255
);
256+
const b200Models = normalized.filter(
257+
(model) => model?.model?.toLowerCase() === "b200",
258+
);
259+
// Priority GPUs: H200, H100, A100
260+
const priorityGpus = normalized.filter((model) => {
261+
const modelLower = model?.model?.toLowerCase();
262+
return (
263+
priorityModels.includes(modelLower) &&
264+
modelLower !== "b200" &&
265+
modelLower !== "b300"
266+
);
267+
});
231268
const otherModels = normalized.filter((model) => {
232269
const modelLower = model?.model?.toLowerCase();
233-
return modelLower !== "b200" && modelLower !== "b300";
270+
return (
271+
modelLower !== "b200" &&
272+
modelLower !== "b300" &&
273+
!priorityModels.includes(modelLower)
274+
);
275+
});
276+
277+
// Sort priority GPUs by their defined order
278+
priorityGpus.sort((a, b) => {
279+
const aIndex = priorityModels.indexOf(a?.model?.toLowerCase());
280+
const bIndex = priorityModels.indexOf(b?.model?.toLowerCase());
281+
if (aIndex !== bIndex) return aIndex - bIndex;
282+
// For same model, prefer 80Gi RAM
283+
if (a?.ram === "80Gi" && b?.ram !== "80Gi") return -1;
284+
if (b?.ram === "80Gi" && a?.ram !== "80Gi") return 1;
285+
return 0;
234286
});
235-
// Always return B200 first, then B300, then others
236-
return [...b200Models, ...b300Models, ...otherModels];
237-
}, [filteredData]);
287+
288+
// Always return B300 first, then B200, then priority GPUs, then others
289+
return [...b300Models, ...b200Models, ...priorityGpus, ...otherModels];
290+
}, [filteredData, priorityModels]);
238291

239292
const HeaderSection = () => (
240293
<div className="flex flex-col gap-2 xl:gap-[18px]">
@@ -251,7 +304,7 @@ export const Tables = ({
251304
const CtaSection = ({ className }: { className?: string }) => (
252305
<div className={clsx("flex flex-col gap-4 xl:gap-5", className)}>
253306
<h2 className="text-lg font-semibold leading-snug text-foreground xl:leading-[28px]">
254-
Looking for NVIDIA B200s, Bulk Orders, or Custom Configurations?
307+
Looking for Bulk Orders, or Custom Configurations?
255308
</h2>
256309
<TryAkashForm
257310
type="customButton"
@@ -338,28 +391,28 @@ export const Tables = ({
338391
<>
339392

340393
<GpuTableRow
341-
model="B200"
394+
model="B300"
342395
ram="180GB"
343396
interface="HBM3e"
344-
minPrice={5}
345-
maxPrice={5}
346-
avgPrice={5}
397+
minPrice={6}
398+
maxPrice={6}
399+
avgPrice={6}
347400
providerCount={1}
348401
isB200={true}
349-
id="b200-(gpu-rent)-mobile"
402+
id="b300-(gpu-rent)-mobile"
350403
href="/gpus-on-demand"
351404
/>
352405

353406
<GpuTableRow
354-
model="B300"
407+
model="B200"
355408
ram="180GB"
356409
interface="HBM3e"
357-
minPrice={6}
358-
maxPrice={6}
359-
avgPrice={6}
410+
minPrice={5}
411+
maxPrice={5}
412+
avgPrice={5}
360413
providerCount={1}
361414
isB200={true}
362-
id="b300-(gpu-rent)-mobile"
415+
id="b200-(gpu-rent)-mobile"
363416
href="/gpus-on-demand"
364417
/>
365418

0 commit comments

Comments
 (0)