Skip to content
1 min read · 214 words

Interface: GpuBudget

Defined in: src/batteries/llm/chat_common/gpu_budget.ts:37

A snapshot of the WebGPU device's memory budget, as reported by the adapter/device limits.

Remarks

All sizes are bytes. maxBufferSize and maxStorageBufferBindingSize are the hard per-allocation ceilings a single ONNX tensor buffer cannot exceed — the practical wall an over-large context window hits first (e.g. ~4 GiB on Apple Metal). These are LIMITS, not live usage; pair with GpuBufferInstrument for live high-water-mark tracking.

Properties

PropertyTypeDescriptionDefined in
adapterInfo?{ architecture?: string; description?: string; device?: string; vendor?: string; }Best-effort adapter description (vendor/architecture/device), when the runtime exposes it.src/batteries/llm/chat_common/gpu_budget.ts:43
adapterInfo.architecture?string-src/batteries/llm/chat_common/gpu_budget.ts:43
adapterInfo.description?string-src/batteries/llm/chat_common/gpu_budget.ts:43
adapterInfo.device?string-src/batteries/llm/chat_common/gpu_budget.ts:43
adapterInfo.vendor?string-src/batteries/llm/chat_common/gpu_budget.ts:43
availablebooleantrue when these numbers came from a real navigator.gpu device; false/absent ⇒ unavailable.src/batteries/llm/chat_common/gpu_budget.ts:45
maxBufferBytesnumberLargest single GPUBuffer the device will allocate, in bytes (GPUSupportedLimits.maxBufferSize).src/batteries/llm/chat_common/gpu_budget.ts:39
maxStorageBufferBindingBytesnumberLargest storage-buffer binding, in bytes (GPUSupportedLimits.maxStorageBufferBindingSize).src/batteries/llm/chat_common/gpu_budget.ts:41