This file is the canonical list of runnable scripts and notebooks maintained under examples/.
examples/demo_llama_conversion.py— Convert a Hugging Face Llama checkpoint, swap everytorch.nn.Linearfort81.nn.Linear, and inspect the cached ternary weights.examples/scaling_laws_ternary.py— Compare ternary vs float scaling laws across RMSNorm, RoPE, and throughput axes.examples/ternary_sparse_preview.py— Explore hybrid sparsity, GEMM packing, and quantized transformer inference with notebook-friendly visuals.examples/ternary_quantization_demo.ipynb— Tutorial notebook showing packed GEMMs, quantized trits, and dequantization.examples/ternary_phi3_ptq_qat_demo.ipynb— End-to-end Phi-3-mini PTQ/QAT notebook with size, latency, and perplexity tracking.examples/ternary_transformer_demo.ipynb— Micro GPT stack with cached ternary projections and packed GEMM profiling.examples/ternary_mnist_demo.ipynb— Quantize an MNIST classifier, pack weight buffers, and route inference throught81lib.gemm_ternary.examples/ternary_qat_inference_comparison.py— Run a miniature QAT loop, log ternary threshold schedules, and compare latency betweentorch.matmuland cachedTernaryTensor.
examples/ternary_hardware_sim_demo.ipynb— Build a ternary adder, trace virtual power/latency, and compare energy vs binary hardware usingt81.hardware.TernaryEmulator.examples/cli-examples.md— Copy/paste-ready snippets fort81-convert,t81-gguf, andt81-qatworkflows.
Refer to docs/use-cases.md for details on how these examples tie into broader quantization, scaling-law, and hardware experiments, and consult the quantization workflow diagram for the PyTorch → CLI → inference path.