File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,31 +12,17 @@ import {
1212export { GPU_KEYS } ;
1313
1414/**
15- * Strip known hw suffixes (-trt, -multinode-slurm, -amds, etc.) from a raw
16- * hardware identifier and return the canonical lowercase GPU key.
15+ * Strip everything from the first `-` onwards (and any trailing `_<digits>`
16+ * runner-index suffix) from a raw hardware identifier and return the canonical
17+ * lowercase GPU key. All keys in `GPU_KEYS` are single-segment, so this is
18+ * sufficient; unknown bases return `null`.
1719 *
1820 * @param hw - Raw hardware string from the benchmark artifact (e.g. `"h200-nv"`, `"mi355x-amds"`).
1921 * @returns The canonical GPU key (e.g. `"h200"`, `"mi355x"`), or `null` if the
2022 * stripped base is not in `GPU_KEYS`.
2123 */
2224export function hwToGpuKey ( hw : string ) : string | null {
23- const base = hw
24- . toLowerCase ( )
25- . replace ( / _ \d + $ / , '' ) // strip runner index suffix (e.g. mi355x-amd_0 → mi355x-amd)
26- . replace ( / - t r t $ / , '' )
27- . replace ( / - m u l t i n o d e - s l u r m $ / , '' )
28- . replace ( / - m u l t i n o d e $ / , '' )
29- . replace ( / - n v s $ / , '' )
30- . replace ( / - d i s a g g $ / , '' )
31- . replace ( / - a m d s $ / , '' )
32- . replace ( / - a m d $ / , '' )
33- . replace ( / - n v d $ / , '' )
34- . replace ( / - d g x c - s l u r m $ / , '' )
35- . replace ( / - d g x c $ / , '' )
36- . replace ( / - n b $ / , '' )
37- . replace ( / - d s v 4 $ / , '' )
38- . replace ( / - c w $ / , '' )
39- . replace ( / - n v $ / , '' ) ;
25+ const base = hw . toLowerCase ( ) . split ( '-' ) [ 0 ] ;
4026 return GPU_KEYS . has ( base ) ? base : null ;
4127}
4228
You can’t perform that action at this time.
0 commit comments