Weights

annotation class Weights(val memory: MemoryDomain = MemoryDomain.MMAP_FILE)(source)

Marks a tensor as an immutable weight that should be file-backed (memory-mapped) when possible.

Equivalent to @Place(device = CPU, memory = MMAP_FILE) with Residency.PERSISTENT. The planner treats these tensors as read-only and long-lived, preferring OS-paged file access over heap allocation.

Example:

@Weights
val embeddings: Tensor<FP32, Float>

@Weights(memory = MemoryDomain.HOST_HEAP) // force heap for small weights
val biasVector: Tensor<FP32, Float>

Properties

Link copied to clipboard