module Platform.RunPod.Nvidia.SM90 import Model.Config import Model.Parameter import Model.Word32 import Model.Word64 import Platform.Linux.Nvidia.Compatibility import Platform.Linux.Nvidia.Memory.ABI import Platform.RunPod.Nvidia.SM86 import Std.List import Std.Natural import Std.Word -- The RunPod H100 SXM (Hopper, compute 9.0): the 80 GB HBM3 part of the -- 8xH100 nodes nanochat's speedrun rents, taken one GPU at a time. The -- product record is the RunPod target record SM86 defines (identity, product -- name, compute capability, video memory); only its values are Hopper's. -- -- Measured on RunPod pod gpt2-h100, driver 580.126.09, 2026-10-10 -- (evidence: donto-resources research/gpt2-alpha-2026-10-06/h100/profile): -- name "NVIDIA H100 80GB HBM3", PCI 0x2330 sub 0x16C1, VBIOS 96.00.DA.00.0C -- 132 SMs, 2048 threads and 65536 registers per SM, 1024 threads per CTA -- 233472 B shared memory per SM, 232448 B per CTA opted in, 49152 B default -- 50 MiB L2, 5120-bit HBM3 at 2619 MHz, SM clock up to 1980 MHz, 700 W -- 85017493504 B video memory, 480 MiB of it reserved by the driver def runPodH100TargetIdentity : Bytes = b"runpod-nvidia-h100-80gb-hbm3-sm90" def runPodH100ProductIdentity : Bytes = b"NVIDIA H100 80GB HBM3" -- cuDeviceTotalMem 85017493504 = 0x13_CB70_0000 (81079 MiB free + 480 MiB -- reserved = nvidia-smi's 81559 MiB total) def runPodH100TotalVideoMemory : StdU64 = 0x0000_0013_CB70_0000 -- 480 MiB (nvidia-smi -q -d MEMORY, "Reserved") def runPodH100ReservedVideoMemory : StdU64 = 0x0000_0000_1E00_0000 def runPodH100TargetProfile : RunPodSM86TargetProfile = (record RunPodSM86TargetProfile (runPodSM86TargetIdentityValue = runPodH100TargetIdentity) (runPodSM86ProductIdentityValue = runPodH100ProductIdentity) (runPodSM86ComputeMajorValue = 9) (runPodSM86ComputeMinorValue = 0) (runPodSM86TotalVideoMemoryValue = runPodH100TotalVideoMemory) (runPodSM86ReservedVideoMemoryValue = runPodH100ReservedVideoMemory)) -- Hopper command-stream facts (NVIDIA open-gpu-doc classes/compute/ -- clcbc0.h and clcbc0qmd.h): SASS_VERSION 0x90, the class 0xCBC0 and SPA -- version 9.0. HOPPER_COMPUTE_A launches are described by QMD V04_00, a -- 384-byte record the compiler places in a 512-byte slot (SEND_PCAS_A -- addresses QMDs in 256-byte units). def runPodSM90QMDSlotBytes : Nat = 512 def runPodSM90QMDArchitecture : ModelWord32 = 144 def runPodSM90ComputeClass : ModelWord32 = 52160 def runPodSM90SPAVersion : ModelWord32 = 2304 -- ---- what the H100 supplies (Platform.Linux.Nvidia.Compatibility) ---- -- Shared memory per block is the opt-in limit the hardware admits, which -- the QMD V04 encoder honours (Accelerator.SM90.SharedMemory): CUDA's -- 48 KiB default is its driver's policy, not the card's. Unified memory is -- absent: RunPod's H100 hosts were not established to open -- /dev/nvidia-uvm (GPT2.Build.Target runs them direct-RM). def runPodH100Record : Bytes = b"comparisons/h100/README.md" def runPodH100Supplies : (family StdList NvidiaSupply) = (let unrestricted measured = (constructor NvidiaEvidence NvidiaEvidenceMeasured runPodH100Record) in let unrestricted architectural = (lambda unrestricted source : Bytes . constructor NvidiaEvidence NvidiaEvidenceArchitectural source) in then (nvidiaSupply b"instruction-set" 90 (architectural b"NVIDIA Hopper GH100: compute capability 9.0 (CUDA C++ Programming Guide, compute capabilities)")) (nvidiaSupply b"compute-class" (modelWord32ToNatural runPodSM90ComputeClass) (architectural b"HOPPER_COMPUTE_A (open-gpu-doc, clcbc0.h)")) (nvidiaSupply b"registers-per-thread" 255 (architectural b"an 8-bit register operand, R255 the zero register (Accelerator.SM90.Word)")) (nvidiaSupply b"threads-per-block" 1024 measured) (nvidiaSupply b"shared-bytes-per-block" 232448 measured) (nvidiaSupply b"driver-branch" (nvidiaCompatibilityTextWord b"580.") measured) (nvidiaSupply b"video-memory-bytes" (modelWord64Natural runPodH100TotalVideoMemory) measured) nvidiaNoSupplies)