Views
No views yet
| Metric | Measured Telemetry | Engineering Impact |
|---|---|---|
| Model Parameters | 1.23 Billion | Base foundation transformer weights |
| Quantization Precision | INT4 (~4.501 bits/weight) | Compressed from 16-bit float |
| Storage Footprint | ~695 MB (.safetensors) | Reduced from ~2.48 GB FP16 baseline |
| Peak Memory Allocation | 0.771 GB – 0.828 GB | Safely below iOS Jetsam (OOM) memory limits |
| Cold Start Prefill | 44.64 tokens/sec | High I/O penalty loading tensors from disk |
| Warm Start Prefill | 778.79 tokens/sec | ~17.4x throughput increase (Cached in RAM) |
| Sustained Throughput | ~319.62 – 321.88 tokens/sec | Real-time autoregressive token generation |
| Generated Output Length | Peak Unified Memory | Measured KV Cache Overhead |
|---|---|---|
| 300 Tokens | 0.737 GB | Base runtime |
| 600 Tokens | 0.718 GB | Active memory recycling |
| 1,200 Tokens | 0.759 GB | ~41 MB cache delta |
11. Cold Start Prefill (44.64 tok/s) — High I/O Storage Penalty
2┌─────────────┐ Disk Read & Bus Transfer ┌────────────────┐ Compute Pass ┌──────────────┐
3│ NVMe / SSD │ ───────────────────────────► │ Unified Memory │ ───────────────► │ GPU Compute │
4└─────────────┘ (~22.4 ms/tok) └────────────────┘ └──────────────┘
5
62. Warm Start Prefill (778.79 tok/s) — Zero Storage Latency (~17.4x Acceleration)
7 ┌────────────────┐ Direct Stream ┌──────────────┐
8 │ Resident Cache │ ───────────────► │ GPU Compute │
9 └────────────────┘ (~1.28 ms/tok) └──────────────┘
101Prefill Latency Comparison (Tokens per Second)
2──────────────────────────────────────────────────────────────────────────────
3Cold Start (Disk I/O) | ██ (44.64 tok/s)
4Warm Start (RAM Cached) | ████████████████████████████████████ (778.79 tok/s) [17.4x]
5──────────────────────────────────────────────────────────────────────────────
61pip install mlx-lm huggingface_hub
21mlx_lm.generate \
2 --model rajib-sarwar/Llama-3.2-1B-Instruct-4bit-MLX \
3 --prompt "Explain how 4-bit quantization reduces memory pressure on Apple Silicon." \
4 --max-tokens 300
51from mlx_lm import load, generate
2
3# Load the 4-bit model directly from Hugging Face Hub
4model, tokenizer = load("rajib-sarwar/Llama-3.2-1B-Instruct-4bit-MLX")
5
6prompt = "Explain how 4-bit quantization reduces memory pressure on Apple Silicon."
7
8response = generate(
9 model,
10 tokenizer,
11 prompt=prompt,
12 max-tokens=300,
13 verbose=True
14)
15
16print(response)
17meta-llama/Llama-3.2-1B-Instruct bfloat16 tensors using mlx_lm.convert:1# 1. Force snapshot metadata caching
2python3 -c "from huggingface_hub import snapshot_download; snapshot_download('meta-llama/Llama-3.2-1B-Instruct')"
3
4# 2. Execute 4-bit quantization
5mlx_lm.convert \
6 --hf-path meta-llama/Llama-3.2-1B-Instruct \
7 -q \
8 --q-bits 4 \
9 --upload-repo rajib-sarwar/Llama-3.2-1B-Instruct-4bit-MLX
10