Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions dsl/extdeps/gpu/types.dag
Original file line number Diff line number Diff line change
@@ -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<NonEmptyStr> = [
"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<Hardware>
major: Int
minor: Int
}

type UnsubstantiatedGpuCapabilityLabel { vendor: Vendor<Hardware> }

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<Hardware>
model: NonEmptyStr
compute_capability: GpuComputeCapability?
memory: MemoryFacts
supported_runtimes: List<GpuRuntime>
}

type AcceleratorFacts {
vendor: Vendor<Hardware>
model: NonEmptyStr
}
12 changes: 12 additions & 0 deletions dsl/extdeps/memory/types.dag
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
}
}

data memory_types_compute_fabric_parallel_copy_debt: List<NonEmptyStr> = [
"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 {
Expand Down
4 changes: 3 additions & 1 deletion dsl/test/claim/extdeps_round2_grounding_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ import extdeps.cloud.gcp.gcp {
GcpSts,
gcp_service_wire_label,
}
import product.compute_fabric {
import extdeps.gpu.types {
GpuFacts,
AcceleratorFacts,
GpuComputeCapability,
GpuCapabilityLabelOk,
GpuCapabilityLabelRejected,
UnsubstantiatedGpuCapabilityLabel,
gpu_compute_capability_sm_label,
}
import extdeps.memory.types {
MemoryFacts,
MemoryKind,
Hbm,
Expand Down