ExAtlas.Spec.GpuCatalog (ExAtlas v0.5.0)

Copy Markdown View Source

Canonical GPU atoms mapped to each provider's native identifier.

ExAtlas refers to GPUs by a stable, provider-agnostic atom (:h100, :a100_80g, :rtx_4090, ...). Providers translate the canonical atom into whatever identifier their API expects when building a spawn request.

New providers register their mapping here by extending the @providers map.

Summary

Functions

List every canonical GPU atom ExAtlas knows about, across all providers.

Translate a canonical GPU atom to the provider-specific identifier.

List the GPU atoms known for a provider.

Types

canonical()

@type canonical() :: atom()

provider()

@type provider() :: :runpod | :fly | :lambda_labs | :vast | :mock | module()

Functions

all_canonical()

@spec all_canonical() :: [canonical()]

List every canonical GPU atom ExAtlas knows about, across all providers.

for_provider(canonical, provider)

@spec for_provider(canonical(), provider()) :: {:ok, String.t()} | {:error, term()}

Translate a canonical GPU atom to the provider-specific identifier.

Returns {:ok, id} when the mapping exists, or {:error, {:unsupported_gpu, gpu, provider}}.

Examples

iex> ExAtlas.Spec.GpuCatalog.for_provider(:h100, :runpod)
{:ok, "NVIDIA H100 80GB HBM3"}

iex> ExAtlas.Spec.GpuCatalog.for_provider(:h100, :lambda_labs)
{:ok, "gpu_1x_h100_pcie"}

iex> ExAtlas.Spec.GpuCatalog.for_provider(:nonexistent, :runpod)
{:error, {:unsupported_gpu, :nonexistent, :runpod}}

supported_gpus(provider)

@spec supported_gpus(provider()) :: [canonical()]

List the GPU atoms known for a provider.