Skip to content
NVIDIA Generative AI LLMs Associate (NCA-GENL) Exam Prep

Lesson 4 of 5 · 14 min

x
4/5

Software Development (24%)

Video lesson: NCA-GENL Domain 4: Software Development

Official exam topics: exam-guide/nca-genl-exam-page.md ("Software Development"). NVIDIA defines this area simply as create, maintain and test software. In practice it is about turning a model into a working, monitored application: picking the components, serving the model efficiently, wiring up RAG and chat, and watching it run. The reading list: NVIDIA Generative AI Examples, TensorRT — Get Started, NeMo best practices, NVIDIA's Mastering LLM Techniques: Customization, Hugging Face Datasets, BERT, the Triton Inference Server Quick Start, spaCy and scikit-learn. Shared topics: RAG, chatbots and summarizers, Python NLP packages and vector databases are explained in D1; this domain covers implementing, serving and monitoring them.

Exam topics in this domain 1. 4.1 Identify the data, hardware and software components a solution needs 2. 4.2 Build LLM use cases (RAG, chatbots, summarizers) as software 3. 4.3 Deploy models and evaluate scalability, performance and reliability 4. 4.4 Monitor data collection, experiments and other software processes 5. 4.5 Write software components or scripts; use Python NLP and ML packages

Checked against NVIDIA documentation (November 2026). - NVIDIA NIM: prebuilt inference microservices (containers) that package a model with an optimized engine (TensorRT-LLM, vLLM or SGLang, chosen for the GPU) and expose OpenAI-compatible HTTP APIs for LLMs. NIMs exist for LLMs, embedding and reranking models (NeMo Retriever), speech, vision and more. They run on any NVIDIA GPU environment: cloud, data centre or workstation. Try them at build.nvidia.com; download from NGC. - Triton Inference Server, now also branded NVIDIA Dynamo-Triton, serves models from many frameworks with one server. NVIDIA Dynamo is the newer distributed inference framework for serving LLMs across many GPUs (for example disaggregated prefill and decode). - TensorRT is NVIDIA's SDK for optimizing trained networks for inference; TensorRT-LLM is its open-source library specialised for LLMs. - NVIDIA's Generative AI Examples repository and NVIDIA AI Blueprints (for example the RAG blueprint) provide reference applications built from NIM microservices.

4.1 Choosing Components

Map the requirement to a component:

RequirementComponent
Fast, supported LLM endpoint without building an engineNIM for that model
Serve several models from different frameworks (PyTorch, ONNX, TensorRT, Python) on one serverTriton Inference Server
Squeeze maximum LLM throughput on NVIDIA GPUsTensorRT-LLM engine (inside NIM or Triton)
Optimize a non-LLM network (CNN, BERT)TensorRT (often via ONNX export)
Fine-tune or customize an LLMNeMo framework or NeMo Customizer; Hugging Face PEFT
Clean and deduplicate training dataNeMo Curator
Keep a chatbot on topic and safeNeMo Guardrails (D5)
Embeddings and reranking for RAGEmbedding and reranking NIMs (NeMo Retriever) or open models
Vector searchMilvus, FAISS, cuVS (D1)
Orchestrate LLM calls, retrieval and tools in PythonLangChain or LlamaIndex (both integrate with NIM endpoints)
Prebuilt GPU-optimized containers and modelsNGC catalog
GPU-accelerated data prepRAPIDS cuDF / cuML (D2)

Sizing the hardware

  • Weights memory ≈ parameters × bytes per parameter (FP16/BF16 = 2, FP8/INT8 = 1, INT4 = 0.5). A 70B model in FP16 ≈ 140 GB, so it needs several GPUs or quantization.
  • Add the KV cache, which grows with batch size × sequence length, times 2 (keys and values) × layers × KV heads × head size × bytes per value. Models with grouped-query attention have fewer KV heads, so their cache is smaller (Llama 3.1 8B in FP16: about 128 KiB per token). Long contexts and many concurrent users can need as much memory as the weights.
  • Larger memory per GPU and faster interconnects (NVLink) matter when a model is split across GPUs with tensor parallelism.
  • Precision support depends on the GPU generation: FP8 Tensor Cores arrived with Ada Lovelace (for example L40S) and Hopper (H100/H200); Blackwell adds FP4. Older GPUs such as Ampere (A100) have no FP8.

4.2 Building the Application

A RAG service in code (the pattern)

1from openai import OpenAI          # NIM exposes an OpenAI-compatible API2client = OpenAI(base_url="http://localhost:8000/v1", api_key="not-used-locally")3 4def answer(question, vector_store, k=4):5    q_vec = embed(question)                                    # same model as the documents6    chunks = vector_store.search(q_vec, top_k=k)               # ANN search7    context = "\n\n".join(c.text for c in chunks)8    messages = [9        {"role": "system", "content": "Answer only from the context. If it is not there, say you don't know. Cite sources."},10        {"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"},11    ]12    r = client.chat.completions.create(model="meta/llama-3.1-8b-instruct",13                                       messages=messages, temperature=0.1, max_tokens=400)14    return r.choices[0].message.content, [c.source for c in chunks]

The same code works against a hosted NIM endpoint, a local NIM container or another OpenAI-compatible server by changing base_url and model.

Chatbot specifics - Keep conversation history in the application (the model is stateless); trim or summarize it to fit the context window. - Apply the model's chat template (roles, special tokens). Using the wrong template degrades output. - Stream tokens to the user (stream=True) to cut perceived latency. - Add input/output guardrails, and log conversations (with PII handling) for evaluation.

Summarizer specifics - Check document length in tokens; use map-reduce or refine chains for long documents. - Use low temperature and an explicit length and format.

Using NLP packages inside the app - spaCy for preprocessing: sentence splitting for chunking, NER to extract metadata or redact PII. - Hugging Face Datasets to load, map (tokenize in batches) and filter large corpora efficiently; data is memory-mapped, so it need not fit in RAM. - scikit-learn for lightweight classifiers (intent routing before the LLM).

4.3 Deploying and Evaluating Scalability, Performance and Reliability

Inference optimizations (Mastering LLM Techniques: Inference Optimization)

LLM inference has two phases: prefill (process the whole prompt in parallel; compute-bound; determines TTFT) and decode (generate one token at a time; memory-bandwidth-bound; determines inter-token latency).

TechniqueWhat it does
KV cacheStores attention keys and values of earlier tokens so each new token doesn't recompute them
Paged KV cache (PagedAttention)Allocates the KV cache in blocks, like virtual memory, cutting fragmentation and allowing more concurrent requests
In-flight (continuous) batchingNew requests join the running batch as soon as others finish, instead of waiting for the whole batch: much higher throughput
Quantization (FP8, INT8, INT4 with AWQ or GPTQ, weight-only or weights + activations)Less memory and bandwidth → faster and cheaper; check accuracy
Speculative decodingA small draft model proposes several tokens; the large model verifies them in one pass
FlashAttentionFused, memory-efficient attention kernels
Tensor parallelism / pipeline parallelismSplit a large model across GPUs
Kernel fusion, graph optimizationWhat TensorRT and TensorRT-LLM do when building an engine

TensorRT and TensorRT-LLM

  • TensorRT takes a trained model (commonly via ONNX), applies layer fusion, precision calibration (FP16, INT8, FP8) and kernel auto-tuning, and builds an optimized engine for a specific GPU.
  • TensorRT-LLM (whose default backend since version 1.0 is PyTorch-based, with TensorRT engines still available) provides LLM-specific optimizations (in-flight batching, paged KV cache, quantization, speculative decoding, multi-GPU) behind a Python API (LLM(...)), and serves through Triton or its own OpenAI-compatible server.
  • An engine is built for a target GPU architecture; rebuild it when the GPU type changes.

Triton Inference Server (Quick Start)

  • Models live in a model repository: models/<model_name>/<version>/model.onnx (or model.plan, model.pt, …) plus a config.pbtxt describing the backend, inputs, outputs and batching.
  • Backends: TensorRT, ONNX Runtime, PyTorch, TensorFlow, Python, TensorRT-LLM, vLLM.
  • Dynamic batching: Triton groups individual requests into batches within a short delay to raise throughput.
  • Concurrent model execution: several instances of a model (or several models) on the same GPU.
  • Ensembles / business logic scripting: chain preprocessing → model → postprocessing on the server.
  • Protocols: HTTP/REST and gRPC; metrics in Prometheus format on port 8002.
  • Typical start: docker run --gpus all -p8000:8000 -p8001:8001 -p8002:8002 -v $PWD/models:/models nvcr.io/nvidia/tritonserver:<tag>-py3 tritonserver --model-repository=/models.

NIM deployment

  • docker run --gpus all -e NGC_API_KEY -p 8000:8000 nvcr.io/nim/<org>/<model>:<tag>. On first start the NIM downloads the model and picks an optimized profile for the detected GPU.
  • Health endpoints (/v1/health/ready), OpenAI-compatible /v1/chat/completions and /v1/completions, metrics for Prometheus.
  • Scale on Kubernetes (Helm charts, the NIM Operator) with autoscaling on GPU or queue metrics.

Scalability, performance and reliability checks

QualityHow to evaluateHow to improve
LatencyTTFT and inter-token latency at expected load (p50, p95, p99)Smaller or quantized model, TensorRT-LLM, streaming, shorter prompts
ThroughputTokens/s and requests/s at target latencyIn-flight batching, more replicas, quantization
ScalabilityLoad tests at rising concurrencyHorizontal scaling (replicas) and autoscaling; tensor parallelism for model size
ReliabilityError rates, timeouts, recovery after failureHealth checks, retries with backoff, rate limiting, fallbacks, redundant replicas
Quality in productionSampled evaluation, user feedbackRegression test suite before each release (D3)

Performance testing tools: AIPerf (successor to GenAI-Perf) and Triton's perf_analyzer (D3).

4.4 Monitoring Data Collection, Experiments and Software

  • Service metrics: request rate, latency percentiles, error rate, queue length, tokens in/out (Prometheus + Grafana).
  • GPU metrics: utilization, memory, temperature, power via nvidia-smi and DCGM (Data Center GPU Manager) with the DCGM exporter for Prometheus.
  • Experiment tracking: W&B, MLflow or TensorBoard dashboards for loss curves and evaluation metrics (D3).
  • Data pipelines: row counts, schema checks, null rates and duplicate rates on every run; alert on sudden changes.
  • Model quality: drift in input distributions (topic mix, prompt length), rising "I don't know" or refusal rates, falling user ratings, guardrail trigger rates.
  • Logs and traces: structured logs per request with prompt version, model version and retrieved document IDs, so a bad answer can be traced (with PII redaction).

4.5 Writing Software Components

Good engineering the associate is expected to practise: - Version everything: code (Git), prompts and templates, model versions, datasets. - Configuration over hard-coding: endpoints, model names and parameters in config files or environment variables; secrets (API keys) never in code. - Unit tests for deterministic parts (chunkers, parsers, prompt builders) and evaluation tests for model outputs. - Containers (Docker) with pinned versions; start from NGC images for matching CUDA, driver and framework versions. - Batch work efficiently: batch embedding calls, vectorize with NumPy, avoid Python loops over rows in pandas. - Handle failures: timeouts, retries with exponential backoff, validating model output (for example JSON schema) before using it. - Code review by the senior engineer before merging; document what a script does and how to run it.

NeMo framework best practices (reading list) - Start from a NeMo recipe or example config and change a few parameters rather than writing a training loop from scratch. - Use mixed precision (BF16) and the provided parallelism settings; checkpoint regularly. - Convert checkpoints between Hugging Face and NeMo formats with the provided tools when moving between ecosystems.

Exam Tips - NIM = quickest optimized, supported endpoint with an OpenAI-compatible API. - Triton = one server for many frameworks; model repository + config.pbtxt; dynamic batching. - TensorRT-LLM = in-flight batching, paged KV cache, quantization, speculative decoding. - Prefill sets TTFT (compute-bound); decode sets inter-token latency (memory-bound). - Weights ≈ params × bytes; KV cache grows with batch × sequence length. - nvidia-smi / DCGM for GPU metrics; Prometheus for service metrics.

References

  1. NVIDIA NCA-GENL certification exam page — checked Nov 11, 2026

Check your understanding

  • A NIM microservice exists for the model you need. Should you write your own inference server?Show answer

    Answer

    No. NIM is the quickest way to a supported, optimized endpoint, and it exposes an OpenAI-compatible API.
  • Which phase of LLM inference sets time to first token, and which sets the time between tokens?Show answer

    Answer

    Prefill, which is compute-bound, sets time to first token. Decode, which is memory-bandwidth-bound, sets inter-token latency.
  • Does static batching give the best LLM throughput?Show answer

    Answer

    No. In-flight (continuous) batching, as in TensorRT-LLM, adds and removes requests every step and keeps the GPU busier.
  • Can a TensorRT engine built on one GPU type run optimally on another?Show answer

    Answer

    No. Engines are tuned for the GPU they were built on; rebuild for the target GPU.
Previous

Progress is saved in this browser.

Next Lesson