fix: include model number and ADA suffix in GPU article token
RTX 6000 ADA and A6000 are distinct cards — RTX_4000_ADA_SFF now produces RTX4000ADA instead of RTX, avoiding visual ambiguity with the segment separator (10xRTX4000ADA vs 10xRTX-1x…). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -329,33 +329,57 @@ func parseGPUModel(lotName string) string {
|
|||||||
}
|
}
|
||||||
parts := strings.Split(upper, "_")
|
parts := strings.Split(upper, "_")
|
||||||
model := ""
|
model := ""
|
||||||
|
numSuffix := ""
|
||||||
mem := ""
|
mem := ""
|
||||||
for i, p := range parts {
|
for i, p := range parts {
|
||||||
if p == "" {
|
if p == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch p {
|
switch p {
|
||||||
case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX":
|
case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX", "SFF", "LOVELACE", "AMPERE", "HOPPER":
|
||||||
|
continue
|
||||||
|
case "ADA":
|
||||||
|
if model != "" {
|
||||||
|
numSuffix += "ADA"
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
default:
|
default:
|
||||||
if strings.Contains(p, "GB") {
|
if strings.Contains(p, "GB") {
|
||||||
mem = p
|
mem = p
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if model == "" && (i > 0) {
|
if model == "" && i > 0 {
|
||||||
model = p
|
model = p
|
||||||
|
} else if model != "" && numSuffix == "" && isNumeric(p) {
|
||||||
|
numSuffix = p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if model != "" && mem != "" {
|
full := model
|
||||||
return model + "_" + mem
|
if numSuffix != "" {
|
||||||
|
full = model + numSuffix
|
||||||
}
|
}
|
||||||
if model != "" {
|
if full != "" && mem != "" {
|
||||||
return model
|
return full + "_" + mem
|
||||||
|
}
|
||||||
|
if full != "" {
|
||||||
|
return full
|
||||||
}
|
}
|
||||||
return normalizeModelToken(lotName)
|
return normalizeModelToken(lotName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isNumeric(s string) bool {
|
||||||
|
if s == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, r := range s {
|
||||||
|
if r < '0' || r > '9' {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func parseMemGiB(lotName string) int {
|
func parseMemGiB(lotName string) int {
|
||||||
if m := reMemTiB.FindStringSubmatch(lotName); len(m) == 3 {
|
if m := reMemTiB.FindStringSubmatch(lotName); len(m) == 3 {
|
||||||
return atoi(m[1]) * 1024
|
return atoi(m[1]) * 1024
|
||||||
|
|||||||
Reference in New Issue
Block a user