BalancedTernaryEngine. Pipeline
(balanced_ternary_engine v0.1.0-dev)
Copy Markdown
End-to-end conversion: safetensors model → .tbin balanced ternary model.
{:ok, summary} =
BalancedTernaryEngine.Pipeline.run("model.safetensors", "model.tbin",
arch: :llama,
mode: :absmean
)Steps:
- Read all tensors from the source
.safetensorsfile (BalancedTernaryEngine.Safetensors) - Classify every tensor via the architecture policy
(
BalancedTernaryEngine.Architectures) → ternary | keep FP16 | skip - Quantize ternary targets with the selected mode and pack them; sensitive tensors are stored as raw FP16 records
- Export a version-2
.tbinfile with provenance metadata
Options
:arch—:llama,:gpt2,:bert,:vit,:generic(default::generic):mode— quantization mode passed toBalancedTernaryEngine.Quantizer.quantize/2::delta,:twn,:absmean(default::twn):delta— explicit threshold when mode is:delta:compress— gzip the output (default: false)
Summary
Functions
Validate that a conversion input path exists.