diff --git a/dsl/extdeps/gpu/types.dag b/dsl/extdeps/gpu/types.dag new file mode 100644 index 00000000000..4c7f0a898b0 --- /dev/null +++ b/dsl/extdeps/gpu/types.dag @@ -0,0 +1,68 @@ +module extdeps.gpu.types + +import std.types { Int, NonEmptyStr, String, List } +import extdeps.vendor { Vendor } +import extdeps.hardware { Hardware } +import extdeps.memory.types { MemoryFacts } +import extdeps.vendor.nvidia { nvidia } +import extdeps.vendor.amd { amd } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } + +data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { + uri: Uri { + scheme: Https + locator: "docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-capabilities" + } +} + +data gpu_types_compute_fabric_parallel_copy_debt: List = [ + "SCAFFOLD: byte-identical GPU vocabulary still declared in product.compute_fabric until the connector PR removes it", + "dissolve-on: product.compute_fabric connector PR deletes local GpuRuntime/GpuComputeCapability/GpuCapabilityLabelOutcome/gpu_compute_capability_sm_label/GpuFacts/AcceleratorFacts and imports from extdeps.gpu.types", +] + +type GpuRuntime = Cuda | Rocm | Metal | OpenCl + +type GpuComputeCapability { + vendor: Vendor + major: Int + minor: Int +} + +type UnsubstantiatedGpuCapabilityLabel { vendor: Vendor } + +type GpuCapabilityLabelOutcome + = GpuCapabilityLabelOk { label: String } + | GpuCapabilityLabelRejected { reason: UnsubstantiatedGpuCapabilityLabel } + +fn gpu_compute_capability_sm_label(cap: GpuComputeCapability) -> GpuCapabilityLabelOutcome { + if cap.vendor == nvidia { + GpuCapabilityLabelOk { + label: concat("sm_", concat(to_string(cap.major), concat("_", to_string(cap.minor)))) + } + } else { + if cap.vendor == amd { + GpuCapabilityLabelOk { + label: concat("gfx", concat(to_string(cap.major), to_string(cap.minor))) + } + } else { + GpuCapabilityLabelRejected { + reason: UnsubstantiatedGpuCapabilityLabel { vendor: cap.vendor } + } + } + } +} + +type GpuFacts { + vendor: Vendor + model: NonEmptyStr + compute_capability: GpuComputeCapability? + memory: MemoryFacts + supported_runtimes: List +} + +type AcceleratorFacts { + vendor: Vendor + model: NonEmptyStr +} diff --git a/dsl/extdeps/memory/types.dag b/dsl/extdeps/memory/types.dag index 72670f69293..3d9e63c51fc 100644 --- a/dsl/extdeps/memory/types.dag +++ b/dsl/extdeps/memory/types.dag @@ -15,6 +15,18 @@ data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { } } +data memory_types_compute_fabric_parallel_copy_debt: List = [ + "SCAFFOLD: byte-identical MemoryKind/MemoryFacts still declared in product.compute_fabric until the connector PR removes them", + "dissolve-on: product.compute_fabric connector PR deletes local MemoryKind/MemoryFacts and imports from extdeps.memory.types", +] + +type MemoryKind = Dram | Hbm | UnifiedShared + +type MemoryFacts { + capacity: ByteSize + memory_kind: MemoryKind +} + type SdramSignalingFamily = | DoubleDataRate type DramGeneration { diff --git a/dsl/test/claim/extdeps_round2_grounding_witness_test.dag b/dsl/test/claim/extdeps_round2_grounding_witness_test.dag index 8ae3d270ef3..4ac47906989 100644 --- a/dsl/test/claim/extdeps_round2_grounding_witness_test.dag +++ b/dsl/test/claim/extdeps_round2_grounding_witness_test.dag @@ -47,7 +47,7 @@ import extdeps.cloud.gcp.gcp { GcpSts, gcp_service_wire_label, } -import product.compute_fabric { +import extdeps.gpu.types { GpuFacts, AcceleratorFacts, GpuComputeCapability, @@ -55,6 +55,8 @@ import product.compute_fabric { GpuCapabilityLabelRejected, UnsubstantiatedGpuCapabilityLabel, gpu_compute_capability_sm_label, +} +import extdeps.memory.types { MemoryFacts, MemoryKind, Hbm,