Inference Concepts (15%)
Official exam topics: exam-guide/nca-amad-exam-page.md ("Inference Concepts"). NVIDIA defines this area as foundational knowledge of AI inference, including inference-serving infrastructure, inference pipeline phases and modes, optimization techniques, improving throughput, latency and performance, and understanding inference costs.
Expect which optimization, which metric, which serving component, why is it slow, what drives cost scenarios. The reading list: NIM for LLMs API reference and the NIM LLM benchmarking guide (overview, metrics, parameters), Triton batchers, NIM Operator model caching, TensorRT-LLM docs (overview, paged attention and in-flight batching, sparse attention), Mastering LLM Techniques: Inference Optimization, LLM Inference Benchmarking: Fundamental Concepts, KV cache reuse, post-training quantization, and NIM out-of-memory troubleshooting.
Exam topics in this domain 1. 3.1 Inference-serving infrastructure: model servers, gateways and routing, provider abstraction, NVIDIA Dynamo, autoscaling, queuing, cold starts 2. 3.2 Pipeline phases and modes: prefill and decode; real-time, batch and streaming 3. 3.3 Optimization techniques: quantization, KV and prefix caching, batching, speculative decoding, parallelism, disaggregated serving, context length and GPU memory 4. 3.4 Performance measures and load testing; latency vs throughput trade-offs 5. 3.5 Inference cost drivers
Checked against NVIDIA documentation (November 2026).
- NVIDIA Dynamo is an open-source, inference-engine-agnostic framework for distributed LLM serving: it runs above engines such as TensorRT-LLM, vLLM and SGLang and adds disaggregated prefill/decode, KV-cache-aware routing, KV cache offloading and GPU planning. Triton Inference Server is part of the Dynamo platform (also called Dynamo-Triton).
- NIM for LLMs exposes an OpenAI-compatible API (/v1/chat/completions, /v1/completions, /v1/models) and picks an optimized engine profile for the GPUs it finds.
- NIM Operator deploys and manages NIM on Kubernetes, including model caching (download model weights once to persistent storage) to cut start-up time, and autoscaling.
3.1 Serving Infrastructure
| Component | Role |
|---|---|
| Inference engine | Runs the model efficiently on GPUs: TensorRT-LLM, vLLM, SGLang |
| Model server | Wraps engines with APIs, batching, model management and metrics: Triton (Dynamo-Triton), NIM, vLLM's server |
| NIM microservice | Packaged model + optimized engine + server + standard API in one container (D6) |
| Gateway / router | Single entry point: authentication, rate limits, quotas, logging, routing across models or replicas (by cost, load, capability, KV-cache hits) |
| Provider abstraction | One API (often OpenAI-compatible) in front of several model providers, so applications can switch models without code changes |
| Orchestrator | Kubernetes schedules replicas; NIM Operator, Run:ai (D8) |
| Dynamo | Distributed serving across many GPUs and nodes: disaggregated serving, KV-aware routing, planner that reallocates GPUs |
Scaling, queuing and cold starts - Request queuing: when all slots are busy, requests wait; queue depth and wait time are key health signals. - Autoscaling: add or remove replicas based on load. For LLMs, scale on queue length, request concurrency, GPU KV-cache utilization or tokens per second, not just CPU usage (Kubernetes Horizontal Pod Autoscaler with custom metrics). - Cold start: a new replica must pull the container, load tens of GBs of weights and warm up, which can take minutes. Mitigations: model caching (NIM Operator caches weights on persistent volumes), pre-pulled images, keeping a minimum number of warm replicas, scaling ahead of predicted demand. - Scaling strategies: horizontal (more replicas), vertical (bigger GPUs or more GPUs per replica via tensor parallelism), scheduled scaling for known peaks, scale-to-zero for rarely used models (with cold-start cost).
3.2 Phases and Modes
Prefill and decode | Phase | What happens | Bound by | Drives | |---|---|---|---| | Prefill | The whole prompt is processed in parallel; the KV cache is built; the first token is produced | Compute | Time to first token (TTFT) | | Decode | One token at a time, each reading all weights and the growing KV cache | Memory bandwidth | Inter-token latency (ITL) and total generation time |
Long prompts make prefill expensive; long outputs make decode expensive. Disaggregated serving puts prefill and decode on different GPU pools so each can be sized and optimized separately and long prefills don't stall other users' decoding (Dynamo transfers the KV cache between them).
Modes
| Mode | Use | Optimization target |
|---|---|---|
| Real-time (online) | Chat, agents, APIs with a user waiting | Low TTFT and ITL at acceptable cost |
| Streaming | Return tokens as they are generated (server-sent events, stream: true) | Perceived latency: users see text immediately |
| Batch (offline) | Summarize a million documents overnight, score a dataset | Maximum throughput and lowest cost per token; latency doesn't matter |
3.3 Optimization Techniques
| Technique | What it does | Trade-off |
|---|---|---|
| Quantization (FP8, INT8, INT4 weight-only such as AWQ, NVFP4 on Blackwell) | Fewer bytes per weight (and activation, KV cache): less memory, more throughput | Possible accuracy loss; post-training quantization with calibration (TensorRT Model Optimizer) usually keeps accuracy close; always re-evaluate |
| KV cache | Store keys and values of past tokens so they aren't recomputed | Uses GPU memory that grows with batch × sequence length |
| Paged attention | KV cache in fixed-size blocks allocated on demand | Less fragmentation → more concurrent requests |
| In-flight (continuous) batching | New requests join and finished ones leave the batch at every step | Much higher throughput than static batching |
| KV cache reuse / prefix caching | Reuse cached keys and values for shared prompt prefixes (system prompts, few-shot examples, multi-turn history) | Big TTFT savings for repeated prefixes; needs memory; TensorRT-LLM adds priority-based eviction and KV-cache event APIs for cache-aware routing |
| Speculative decoding | A small draft model (or extra heads such as Medusa/EAGLE) proposes several tokens; the large model verifies them in one pass | Lower latency with identical output distribution; gains depend on how often drafts are accepted |
| Tensor parallelism | Split each layer's matrices across GPUs (fast NVLink needed) | Fits bigger models, lowers latency; communication overhead |
| Pipeline parallelism | Split layers across GPUs or nodes | Fits very large models; pipeline bubbles |
| Disaggregated serving | Separate prefill and decode pools | Better utilization at scale; more moving parts |
| Sparse attention (TensorRT-LLM) | Attend to a subset of tokens for long contexts | Faster long-context inference; may affect accuracy |
| Guided decoding | Constrain output to a JSON schema, regex or grammar | Valid structured output; slight overhead |
| Triton batchers | Dynamic batcher (groups individual requests within a short delay) for stateless models; sequence batcher for stateful models | Throughput vs added wait |
Context length and GPU memory GPU memory ≈ model weights + KV cache + activations/overhead. - Weights ≈ parameters × bytes per parameter (FP16 = 2, FP8 = 1, INT4 = 0.5): a 70B model in FP16 ≈ 140 GB. - KV cache per token = 2 (keys and values) × layers × KV heads × head dimension × bytes; total grows with concurrent requests × sequence length. Long contexts and many users can need as much memory as the weights. - Out-of-memory fixes (NIM troubleshooting): lower the maximum sequence length or max batch size, use a quantized profile, add GPUs (tensor parallelism), reduce the KV-cache memory fraction, or choose a smaller model.
3.4 Performance Measures and Load Testing
| Metric | Definition |
|---|---|
| Time to first token (TTFT) | From sending the request to receiving the first token (includes queuing and prefill) |
| Inter-token latency (ITL) / time per output token (TPOT) | Average gap between tokens after the first |
| End-to-end request latency | TTFT + generation time for all output tokens |
| Throughput | Output tokens per second (system-wide) and requests per second |
| Tokens per second per user | Generation speed one user experiences (≈ 1 / ITL) |
| Concurrency | Number of requests in flight |
| Goodput | Throughput of requests that meet the latency SLA |
Latency vs throughput Bigger batches and more concurrency raise throughput (GPU busier) but raise latency per request. The right operating point is the highest throughput that still meets the latency SLA. Plot latency against throughput at increasing concurrency to find it.
Load testing (LLM Inference Benchmarking, NIM benchmarking guide) - Use a benchmarking tool (GenAI-Perf, now succeeded by AIPerf) against the endpoint with realistic input and output lengths and concurrency levels (or request rates). - Sweep concurrency (for example 1, 8, 32, 128) and record TTFT, ITL, throughput and errors. - Warm up first; run long enough; keep the same settings when comparing; report percentiles (p50, p95, p99), not just averages. - Parameters that change results: input/output token lengths, concurrency, streaming on/off, model profile (precision, tensor parallelism), max batch size.
3.5 Inference Cost Drivers
| Driver | Why it matters | Lever |
|---|---|---|
| Model size | More parameters → more GPUs and memory per request | Smaller or distilled model, MoE, quantization |
| Tokens (input and output) | Cost scales with tokens processed; output tokens are slower | Shorter prompts, prefix caching, concise outputs, limits on reasoning tokens |
| Traffic (volume and peaks) | Determines replicas needed | Autoscaling, batching, caching answers |
| Hardware | GPU type and price per hour; utilization | Right-size GPUs, fractional GPUs for small models (Run:ai), newer GPUs with FP8/FP4 |
| Latency targets | Tight SLAs force small batches and spare capacity | Relax SLAs for batch work; separate real-time and batch fleets |
| Agentic workflows | Many calls per task multiply tokens | Fewer steps, model routing, smaller models for simple steps |
Cost per million tokens = GPU cost per hour ÷ millions of tokens generated per hour (for example, 2,000 tokens/s × 3,600 s = 7.2 M tokens per hour; at an illustrative $3.60 per GPU-hour that is $3.60 ÷ 7.2 = $0.50 per million tokens), so raising throughput (at the required latency) lowers cost.
Exam Tips - Prefill = compute-bound, sets TTFT; decode = memory-bandwidth-bound, sets ITL. - In-flight batching + paged KV cache = high throughput; prefix caching = lower TTFT for shared prompts. - Speculative decoding: draft proposes, target verifies; same output quality, lower latency. - Disaggregated serving separates prefill and decode pools (Dynamo). - Quantize with PTQ and re-check accuracy; FP8 on Ada/Hopper+, FP4 on Blackwell. - OOM: lower max sequence length or batch size, quantize, or add GPUs. - Report TTFT, ITL, throughput and percentiles at realistic concurrency. - Cold starts: cache models (NIM Operator), keep warm replicas. - Throughput up at fixed latency → cost per token down.
References
- NVIDIA NCA-AMAD certification exam page — checked Nov 11, 2026
Check your understanding
Token generation is slow. Will faster tensor cores fix it?Show answerHide answer
Answer
Usually not. Decode is memory-bandwidth-bound; batching, KV-cache efficiency and quantization help more.Does speculative decoding lower output quality?Show answerHide answer
Answer
No. A draft model proposes tokens and the target model verifies them, so the output matches the target model while latency drops.Is average latency enough to judge whether you meet an SLA?Show answerHide answer
Answer
No. Report percentiles such as p95 and p99, and time to first token and inter-token latency, at realistic concurrency.Does a longer context window cost extra memory?Show answerHide answer
Answer
Yes. The KV cache grows with batch size times sequence length, so longer contexts allow fewer concurrent requests.