Expand description
How much heap a tiled network’s tiles take, and how many a browser keeps in flight.
The arithmetic the tiled drivers (inversion::tiled, onnx feature) budget with, kept out of
the onnx gate so a host that only estimates memory (and does not run networks) computes the
same figures. A network’s cost per tile comes from the registry
(ModelSpec::tile_cost).
Structs§
- Tile
Config - Tiling parameters for the tiled drivers (
tiled_field_inversion,tiled_volume_algorithm).
Constants§
- WASM_
MAX_ PATCH_ ACTIVATION_ BYTES - Largest footprint a single patch may have on WASM, running alone.
- WASM_
TILE_ ACTIVATION_ BUDGET - Heap budget for all concurrent tiles on WASM — see
tile_concurrency(onnxfeature).
Functions§
- max_
wasm_ patch_ edge - Largest patch edge that fits
WASM_MAX_PATCH_ACTIVATION_BYTESfor a network costingbytes_per_voxelper patch voxel. - patch_
bytes 🔒 - Heap one cubic patch of this edge holds.
- tile_
bytes - Heap one tile of this config holds while it runs, for a network of this cost
(
ModelSpec::tile_cost): its patch, rounded up to the network’s divisor astile_patch_sizedoes, times the network’s bytes per patch voxel.u64, becausep³ · bytesoverflows a 32-bitusizefor large patches. - tile_
patch_ size - Padded input-patch size per axis for a config and the net’s
size_divisor:core + 2·halorounded up to a multiple ofdivisor. Isotropic, so one value serves all axes. Callers use this to build a reusableOnnxModel::plan_forplan of shape[1, 1, p, p, p]. - tiles_
within_ wasm_ budget - How many tiles of this config fit a browser’s share of heap — at least one, however big the
patch — for a network of this cost (
ModelSpec::tile_cost). - wasm_
tiles_ in_ flight - Tiles a WASM host with
threadsworkers keeps in flight: the threads, capped bytiles_within_wasm_budget. This is whattile_concurrency(onnxfeature) returns on WASM; it is callable anywhere, so a host estimating a browser run’s memory can use the same count.