Repository navigation
v1.1.1
ONNX block exports
Per model, two zips hold the 5 SAM2 blocks (image encoder, prompt encoder, mask
decoder, memory attention, memory encoder). Both target opset 18 with attention
and RoPE fully decomposed: the native opset-23 ONNX Attention / RotaryEmbedding
ops break on the ONNX Runtime TensorRT EP (Attention falls back to CUDA → heavy
subgraph fragmentation; dynamic RoPE fails the engine build with a myelin error).
<model>-opset18.zip— decomposed RoPE (rotate-half) + SDPA primitives, fp32.
Portable: runs on onnxruntime >= 1.17 (CPU / CUDA / TensorRT EP), CUDA 11/12/13.<model>-opset18-fp16.zip— same graphs converted to mixed precision for the
CUDA/CPU EP (which can't convert precision at runtime). Only the two heavy blocks
(image encoder, memory attention) run fp16; the prompt encoder, mask decoder and
memory encoder stay fp32. Not because those blocks are individually fp16-unsafe
(each is — mask IoU 1.0), but because running ALL blocks fp16 compounds in the
recurrent memory loop and loses the masklet (mask IoU ~0); 2-block fp16 is safe.
For full-precision-speed everywhere, use the fp32 zip on TensorRT with bf16
(bf16's fp32 range survives all-blocks; Ampere+).