howtospark

Training

39 methods · 1 recipe

The resources you can run out of

Required — does it fit?

Required
CapacitySpark128 GB

Can the weights fit — to load and transform them, and for the finished model to run. The gate on whether you can do anything at all.

Quality of life — how well does it run?

BandwidthSpark273 GB/s

Bytes streamed per token at decode — the Spark's ~273 GB/s LPDDR5x is the usual single-user bottleneck.

ComputeSpark1 PFLOP FP4

FLOPs — dominates prefill and large-batch serving.

KV cacheSparkshares 128 GB

Runtime state that grows with context × batch; binds at long context.

Reduce model size

Fidelity

Quantization

Planned

GGUF K-quants

llama.cpp mixed per-layer bit allocation — the Ollama / on-device path.

LossyCapacityBandwidthPTQllama.cpp
Planned

Dynamic quantization (importance-aware)

Spend bits where they hurt — nominal 1-bit quants that are really ~2.3 bpw in the right places.

LossyCapacityBandwidthPTQllama.cpp
Reference

AWQ

Protects the ~1% salient weights by activation scale; best-in-class INT4.

LossyCapacityBandwidthPTQvLLMTensorRT-LLMSGLang
Reference

GPTQ

Hessian-based layerwise error compensation; the classic 4-bit weight quant.

LossyCapacityBandwidthPTQvLLMTensorRT-LLMSGLangTransformers
Reference

SmoothQuant

Migrates activation outliers into the weights to unlock W8A8.

LossyComputeBandwidthPTQvLLMTensorRT-LLM
Reference

Rotation / transform quant

Suppress outliers via rotations (QuaRot, SpinQuant, QuIP#, FlatQuant) to enable low-bit activations.

LossyCapacityBandwidthComputePTQvLLMTensorRT-LLM
Reference

bitsandbytes NF4 / LLM.int8

Zero-calibration load-time quant; NF4 is the base for QLoRA fine-tuning.

LossyCapacityPTQTransformers
Reference

AQLM / QuIP# (2-bit codebook)

Codebook / vector quantization pushing weights toward ~2 bits.

LossyCapacityPTQvLLMTransformers
Reference

SpQR

Variable bitrate for weights: isolate the sensitive outliers in high precision and push everything else to ~3 bits.

LossyCapacityBandwidthPTQTransformers
Reference

SqueezeLLM

Non-uniform quantization that places quant levels by second-order sensitivity, with rare outliers kept sparse in FP16 — more bits, effectively, where they matter.

LossyCapacityBandwidthPTQ

Offload / distribute

Reduce KV cache size

Accelerate decoding

Create a net new model

Edit or adapt a model