Skip to content

Commit

Permalink
Shorten GPU names by dropping h. Fix intel Gen 12.7. (#786)
Browse files Browse the repository at this point in the history
* Shorten GPU names by dropping h. Fix intel Gen 12.7.
   Plus some typos.
* Implement 'shorten' method for each name part
* fix typo, thanks unit tests
* bugfix: parameter got shifted
* Output shortened name in interactive CLI generator.

Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Matthias Büchse <[email protected]>
Co-authored-by: Matthias Büchse <[email protected]>
  • Loading branch information
garloff and mbuechse authored Oct 19, 2024
1 parent 1e24ed4 commit 52fd69c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Standards/scs-0100-w1-flavor-naming-implementation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ of a GPU) result in what GPU part of the flavor name.

#### Nvidia (`N`)

We show the most popular recent generations here. older one are of course possible as well.
We show the most popular recent generations here. Older one are of course possible as well.

##### Ampere (`a`)

One Streaming Multiprocessor on Ampere has 64 (A30, A100) or 128 Cuda Cores (A10, A40).

GPUs without MIG (one SM has 128 Cude Cores and 4 Tensor Cores):
GPUs without MIG (one SM has 128 Cuda Cores and 4 Tensor Cores):

| Nvidia GPU | Tensor C | Cuda Cores | SMs | VRAM | SCS name piece |
|------------|----------|------------|-----|-----------|----------------|
Expand Down Expand Up @@ -138,14 +138,14 @@ Cores and 64 Stream Processors per CU.

#### intel Xe (`I`)

##### Xe-HPC (Ponte Vecchio) (`12.7`)
##### Xe-HPC (Ponte Vecchio) (`3`)

1 EU corresponds to one Tensor Core and contains 128 Shading Units.

| intel DC GPU | Tensor C | Shading U | EUs | VRAM | SCS name piece |
|--------------|----------|-----------|-----|------------|-------------------|
| Max 1100 | 56 | 7168 | 56 | 48G HBM2e | `GI12.7-56-48h` |
| Max 1550 | 128 | 16384 | 128 | 128G HBM2e | `GI12.7-128-128h` |
| intel DC GPU | Tensor C | Shading U | EUs | VRAM | SCS name part |
|--------------|----------|-----------|-----|------------|----------------|
| Max 1100 | 56 | 7168 | 56 | 48G HBM2e | `GI3-56-48h` |
| Max 1550 | 128 | 16384 | 128 | 128G HBM2e | `GI3-128-128h` |

## Automated tests

Expand Down
3 changes: 3 additions & 0 deletions Tests/iaas/flavor-naming/flavor-name-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def main(argv):
nm2 = _fnmck.outname(ret2)
if nm1 != nm2:
print(f"WARNING: {nm1} != {nm2}")
snm = _fnmck.outname(ret.shorten())
if snm != nm1:
print(f"Shortened name: {snm}")
argv = argv[1:]
scs = 1

Expand Down
51 changes: 43 additions & 8 deletions Tests/iaas/flavor-naming/flavor_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ class Main:
raminsecure = BoolAttr("?no ECC", letter="u")
ramoversubscribed = BoolAttr("?RAM Over", letter="o")

def shorten(self):
return self


class Disk:
"""Class representing the disk part"""
Expand All @@ -171,20 +174,29 @@ class Disk:
disksize = OptIntAttr("#.GB Disk")
disktype = TblAttr("Disk type", {'': '(unspecified)', "n": "Networked", "h": "Local HDD", "s": "SSD", "p": "HiPerf NVMe"})

def shorten(self):
return self


class Hype:
"""Class repesenting Hypervisor"""
type = "Hypervisor"
component_name = "hype"
hype = TblAttr(".Hypervisor", {"kvm": "KVM", "xen": "Xen", "hyv": "Hyper-V", "vmw": "VMware", "bms": "Bare Metal System"})

def shorten(self):
return None


class HWVirt:
"""Class repesenting support for hardware virtualization"""
type = "Hardware/NestedVirtualization"
component_name = "hwvirt"
hwvirt = BoolAttr("?HardwareVirt", letter="hwv")

def shorten(self):
return None


class CPUBrand:
"""Class repesenting CPU brand"""
Expand All @@ -206,6 +218,12 @@ def __init__(self, cpuvendor="i", cpugen=0, perf=""):
self.cpugen = cpugen
self.perf = perf

def shorten(self):
# For non-x86-64, don't strip out CPU brand for short name, as it contains the architecture
if self.cpuvendor in ('i', 'z'):
return None
return CPUBrand(self.cpuvendor)


class GPU:
"""Class repesenting GPU support"""
Expand All @@ -226,13 +244,29 @@ class GPU:
vram = OptIntAttr("#.V:GiB VRAM")
vramperf = TblAttr("Bandwidth", {"": "Std BW {<~1GiB/s)", "h": "High BW", "hh": "Very High BW"})

def __init__(self, gputype="g", brand="N", gen='', cu=None, perf='', vram=None, vramperf=''):
self.gputype = gputype
self.brand = brand
self.gen = gen
self.cu = cu
self.perf = perf
self.vram = vram
self.vramperf = vramperf

def shorten(self):
# remove h modifiers
return GPU(gputype=self.gputype, brand=self.brand, gen=self.gen, cu=self.cu, vram=self.vram)


class IB:
"""Class representing Infiniband"""
type = "Infiniband"
component_name = "ib"
ib = BoolAttr("?IB")

def shorten(self):
return self


class Flavorname:
"""A flavor name; merely a bunch of components"""
Expand All @@ -250,14 +284,15 @@ def __init__(

def shorten(self):
"""return canonically shortened name as recommended in the standard"""
if self.hype is None and self.hwvirt is None and self.cpubrand is None:
return self
# For non-x86-64, don't strip out CPU brand for short name, as it contains the architecture
if self.cpubrand and self.cpubrand.cpuvendor not in ('i', 'z'):
return Flavorname(cpuram=self.cpuram, disk=self.disk,
cpubrand=CPUBrand(self.cpubrand.cpuvendor),
gpu=self.gpu, ib=self.ib)
return Flavorname(cpuram=self.cpuram, disk=self.disk, gpu=self.gpu, ib=self.ib)
return Flavorname(
cpuram=self.cpuram and self.cpuram.shorten(),
disk=self.disk and self.disk.shorten(),
hype=self.hype and self.hype.shorten(),
hwvirt=self.hwvirt and self.hwvirt.shorten(),
cpubrand=self.cpubrand and self.cpubrand.shorten(),
gpu=self.gpu and self.gpu.shorten(),
ib=self.ib and self.ib.shorten(),
)


class Outputter:
Expand Down

0 comments on commit 52fd69c

Please sign in to comment.