Skip to main content

Module weights

Module weights 

Source
Expand description

Initializer weight resolution: inline data and external mmap (§19.2, §12).

Turns each TensorProto initializer into an onnx_runtime_ir::WeightRef descriptor that the IR stores. Inline tensors keep their bytes; external tensors are described by (path, offset, length) and the referenced files are memory-mapped so downstream consumers get zero-copy access via WeightStore::bytes.

Structs§

ExpertQuantization
Quantization geometry needed to interpret one expert’s packed tensor slice.
ExpertTensorLayout
Compact layout descriptor used to derive expert byte ranges.
ExpertWeightRegion
One expert’s contiguous byte window in an external initializer mapping.
WeightRangeError
Overflow error shared by loader range catalogs and paging-aware kernels.
WeightRegionCatalog
Validated expert-region catalog over a WeightRef in a WeightStore.
WeightStore
A resolved set of initializer weights, keyed by the value they populate, plus the live memory maps backing any external data files.

Enums§

ExpertStorageOrder
Physical storage order declared by the model/package layout descriptor.
NonPageableReason
Why an external tensor cannot use the expert paging path.
Pageability
Pageability classification. Non-pageable tensors remain valid and use the existing resident/materializing execution path.

Functions§

checked_byte_count
Checked element-size multiplication, rejecting slices larger than isize.
checked_product
Checked product that still detects overflow when another factor is zero.
checked_range
Checked fixed-width range index * width .. start + width.
checked_storage_byte_count
Checked storage byte count, including sub-byte ONNX dtypes.
load_weights
Resolve all initializers, memory-mapping external data relative to model_dir. name_map maps initializer names to the graph value ids created by the graph_builder.