This module walked silicon (GPU, CUDA), compilers (TensorRT, ONNX), and shrink tools (quantization, compression). Edge AI is where those artifacts run off the datacenter: phones, PCs NPUs, Jetson, industrial gateways. Volume 06 VRAM/dtype math still holds—often as DRAM + NPU SRAM, not HBM. Volume 12 KV/FlashAttention ideas appear in miniature (short context, tiny caches) or disappear (encoder-only classifiers).
Module 18.4 starts next: if the “edge” is just a laptop calling an API, that is Tier 1—not Edge AI. Do not confuse on-device inference with API-only clients.
Learning Objectives
By the end of this lesson, students should be able to:
- Define Edge AI as on-device (or near-device) inference with tight power, memory, and privacy constraints.
- Map runtimes: TFLite / LiteRT, ONNX Runtime, CoreML, TensorRT on Jetson, QNN, WebGPU/WASM.
- Choose model classes that belong on-device vs on a GPU server vs API-only.
- Apply INT8/INT4 + distillation as the default edge compression path.
- List failure modes: thermal throttle, op coverage, model update, offline eval drift.
- Hand off to Module 18.4 sizing: when “edge” is really a 3060 desktop (Tier 2), not a phone NPU.
Edge AI is inference (and rarely tiny on-device learning) executed on hardware co-located with the sensor or user—smartphone SoC NPUs, laptops NPUs, microcontrollers, NVIDIA Jetson, industrial PCs—rather than in a remote GPU cluster. Constraints dominate: watts, milliwatts, DRAM in the 4–16 GB class (or KB on MCUs), thermals, and often no CUDA. Success looks like a quantized ONNX/TFLite/CoreML graph with a hard latency SLO, not a 70B FP16 chat model.
What Actually Runs on the Edge
| Workload | Fits on-device? | Usual artifact |
|---|---|---|
| Keyword spot, VAD, tiny ASR encoder | Yes (MCU–phone) | INT8 TFLite / microTVM |
| Vision detect / OCR / pose | Yes (NPU / Jetson) | ONNX → TensorRT / CoreML / QNN |
| Embedding / rerank (small) | Often | ONNX INT8; distill from server teacher |
| 7B INT4 chat (laptop/Jetson 8–16 GB) | Borderline “fat edge” | GGUF / ORT; this is close to 18.4 Tier 2 |
| 13B+ FP16, long-context agents | No—server or API | vLLM / TRT-LLM / Module 18.1 SDKs |
Runtime Map (no CUDA assumed)
Mobile SoC
- CoreML (Apple), NNAPI / QNN (Android)
- TFLite delegates, MediaPipe
- Watch ANE/NPU op coverage
NVIDIA Jetson
- TensorRT + CUDA (small cousin of 18.3.3)
- Power modes / jetson_clocks
- Still budget VRAM-like shared mem
PC NPU / Web
- ORT DirectML, OpenVINO, WebGPU
- Hybrid: NPU embed + API LLM
- Do not pretend WebGPU is an H100
Export Path Toward the Device
Train in PyTorch → export ONNX (previous lectures) → convert/quantize for the vendor runtime. Keep dynamic shapes honest: phones hate unbounded seq. Hybrid apps call Module 18.1 APIs for the heavy LLM and keep PII features on-device.
Privacy, Power, and Honesty
Edge wins when
- PII / camera frames must not leave the device
- Offline or flaky WAN (factory, aircraft, field)
- Hard real-time < network RTT
- Per-unit API cost would dominate at millions of devices
Do not call it Edge AI when
- The app is only an API client (Tier 1)—valid, just different
- You need 70B quality and will secretly round-trip anyway
- Thermals throttle after 30 s and your demo was 5 s
- Op fallback silently hits CPU and misses the SLO
Related Lectures
| Lecture | Why it sits beside Edge AI |
|---|---|
| ONNX / TensorRT | Export + Jetson compile path |
| Quantization / Compression | How models fit DRAM/NPU |
| Vol. 06 INT8 | Default edge dtype |
| Vol. 12 KV Cache | Why on-device LLMs stay short-context |
| 18.1 OpenAI SDK | Hybrid: edge + API |
| 18.4 Tier 1 | Next: laptop as API client, not NPU |
“Any local model is Edge AI.” A 4090 under a desk running vLLM is local serving (Module 18.4 Tiers 2–3), not a phone NPU. Second: “INT8 on-device matches FP16 server logits.” Measure on-device; vendor kernels differ. Third: “Edge means we never need the cloud.” Hybrid is the adult pattern: on-device for privacy/latency-critical slices, API/GPU for the heavy generator.
Knowledge Check
- Short Answer: Define Edge AI in one sentence. Answer: On-device (or near-device) inference under tight power, memory, and often privacy constraints.
- True/False: A laptop calling the OpenAI API is Edge AI. Answer: False—that is Tier 1 API-only; no on-device model.
- Multiple Choice: Typical phone runtime: (a) InfiniBand NCCL, (b) CoreML / TFLite / QNN, (c) multi-node H100. Answer: (b).
- Short Answer: Why are on-device LLMs usually short-context? Answer: KV cache grows with sequence length; edge DRAM cannot hold long KV plus weights.
- True/False: Jetson can still use TensorRT/CUDA even though it is “edge.” Answer: True (NVIDIA edge; not a phone SoC).
- Multiple Choice: Default compression path to the device: (a) FP64 teacher dumped raw, (b) distill + INT8/INT4 export, (c) skip export entirely. Answer: (b).
- Short Answer: Name one reason a demo passes and production fails on phones. Answer: Thermal throttle, CPU fallback for missing NPU ops, or background memory pressure (any).
- True/False: Hybrid on-device embed + cloud LLM can be a valid privacy design if embeddings are non-invertible enough for the threat model—still review PII. Answer: True, with the caveat that threat modeling is required.
- Multiple Choice: 70B FP16 chat belongs: (a) phone NPU, (b) server GPU / API, (c) 8-bit MCU. Answer: (b).
- Short Answer: What module/lecture sizes “any laptop + API key” next? Answer: Module 18.4 Tier 1 API-Only.
Key Takeaways
- Edge AI = on-device inference under watts/DRAM/privacy—not every local GPU.
- ONNX/TFLite/CoreML/TRT-Jetson + INT8/INT4 + distillation are the default path.
- Vol. 12 KV still kills long-context on-device LLMs.
- Hybrid edge + API is common; Tier 1 is API-only and comes next.
- Continue with 18.4 Tier 1 API-Only.
Lab: Classify five product pitches (factory camera, consumer chat app, laptop Copilot, Jetson robot, MCU keyword spot) as Edge / Tier 1 API / Tier 2+ local GPU. Sketch one export path for the Jetson and one hybrid path for the chat app.
Discussion: When is “we run the model on-device for privacy” marketing vs a real threat model? Bring embeddings, logs, and update channels into the argument.
Recap: Edge AI runs compressed models next to the user. Continue with Module 18.4 Tier 1 API-Only.