Inference and optimization

LLM inference and quantization labs

Nine labs on the numbers that decide whether an LLM deployment is affordable: VRAM, latency, throughput, dollars.

9 labs ~6 hours total 8 on real GPUs 1 hosted

Serving a language model is an optimization problem: how many requests per second can one GPU answer, at what latency, at what memory footprint, and at what cost per thousand tokens. Quantization (storing weights in 8-bit or 4-bit instead of 16-bit) shrinks memory and often speeds decoding; batching and paged key-value caches raise throughput; profilers show where the GPU is idle. These are the levers the NVIDIA NCP-GENL Model Optimization domain tests, and the ones our practice-test data shows candidates miss most.

The labs measure everything rather than asserting it. Load a model in fp16, INT8 and NF4 and benchmark VRAM, latency and output quality; sweep batch size and precision to find the throughput knee; build a mini Triton-style dynamic batcher in about thirty lines and load-test it; move to production serving with vLLM and measure PagedAttention capacity, continuous batching and prefix caching; cascade requests across model tiers on NIM and read the real cost field. Three labs close the loop on efficiency: the PyTorch profiler, Nsight Systems, and a four-stage GPU cost audit that turns NVML samples into dollars of waste.

GPU labs run on live NVIDIA pods in the browser; the routing lab is hosted. Each takes 25 to 55 minutes and is checked step by step.

The labs, in order

All labs
  1. 1
    fp16int8nf4
    GPU Pro
    ncp-genl · quantizationIntermediate

    Quantize & Optimize LLMs with bitsandbytes

    Load a model in fp16, INT8, and NF4, then benchmark the three precisions on VRAM, latency, and output quality. See where quantization wins and where it costs you.

    ncp-genlncp-adsnca-genl
    40 min4 steps
    Launch
  2. 2
    fp32fp16bf16
    GPU Pro
    ncp-genl · precision-sweepIntermediate

    Batch Size & Precision Sweep: Finding Your Sweet Spot

    Sweep batch sizes and numerical precisions (fp32, fp16, bf16) on a real model to find the throughput/VRAM knee, then ship a production recommendation with SKU-aware precision picks and an accuracy gate.

    ncp-genlnca-aiioncp-ads
    40 min4 steps
    Launch
  3. 3
    GPU Pro
    ncp-genl · inference-servingIntermediate

    Inference Serving Patterns: Dynamic Batching, Throughput, and the Triton Mental Model

    Build a mini-Triton inference server in ~30 lines of Python: a dynamic batcher with max_batch_size and max_queue_delay knobs, load-tested against a naive baseline, swept for the throughput-latency tradeoff, and bridged to a real Triton config.pbtxt.

    ncp-genlncp-aionca-genl
    40 min4 steps
    Launch
  4. 4
    # vLLM · 10 concurrent
    $ asyncio.gather(…)
    wall time ....... 3.8s
    throughput ...... 1,842 tok/s
    GPU Pro
    ncp-genl · deploy-serve-llms-jupyterIntermediate

    Deploy & Serve LLMs in Production (Jupyter)

    Go from slow single-request inference to production-ready LLM serving with vLLM. Benchmark throughput, tune settings, and learn when to use vLLM vs Triton vs TGI.

    ncp-genlnca-genl
    45 min5 steps
    Launch
  5. 5
    2048512
    GPU Pro
    ncp-genl · vllm-servingAdvanced

    vLLM Production Serving: PagedAttention, Continuous Batching, Prefix Caching

    Stand up vLLM and measure the three features that make it the de-facto inference server: PagedAttention's KV-cache capacity, continuous batching throughput, and prefix caching speedups. Then write the production spec — server args, Kubernetes deployment, monitoring, autoscaling.

    ncp-genlncp-aionca-genl
    55 min4 steps
    Launch
  6. 6
    # model-routing-cascade · agent
    POST /api/agent/invoke
    200 OK · graded
    HOSTED Pro
    ncp-aai · model-routing-cascadeIntermediate

    Model Routing & Cost Cascade with NIM

    Save 60–80% on inference by cascading queries through cheap → mid → expensive NIM models. Measure real costs via NIM's usage.cost field and compare against an always-large baseline.

    ncp-aai
    25 minHosted
    Launch
  7. 7
    # torch.profiler · top ops
    $ table(sort=cuda_time)
    gemm ........ 41%
    memcpy ...... 22%
    softmax ..... 9%
    GPU Pro
    nca-aiio · pytorch-profilerIntermediate

    Profile PyTorch Training with the Built-in Profiler

    Instrument a training loop with torch.profiler, read the op-level table, inspect the Chrome/Perfetto timeline, and decide when to reach for Nsight Systems instead.

    nca-aiioncp-genlncp-ads
    35 min4 steps
    Launch
  8. 8
    GPU Pro
    nca-aiio · nsight-profilingIntermediate

    Nsight Systems Profiling: Finding the Bottleneck That Costs You 40% of Your GPU

    Run the full profile-then-fix loop with NVIDIA Nsight Systems — instrument a training loop with NVTX ranges, capture a .nsys-rep, parse the NVTX summary to pinpoint the bottleneck, then apply a targeted fix and measure the speedup.

    nca-aiioncp-aioncp-genl
    35 min4 steps
    Launch
  9. 9
    $$$
    GPU Pro
    ncp-aio · cost-auditIntermediate

    GPU Cost & Efficiency Audit

    Build a four-stage cost-audit pipeline — measure, classify, price, recommend — that turns raw NVML samples into dollar-denominated waste and specific remediation actions. The skeleton behind every enterprise GPU cost product.

    ncp-aionca-aiionca-genl
    35 min4 steps
    Launch

Before you start

  • Python and basic PyTorch
  • What a token, a batch and a KV cache are (the labs define them again in context)
  • No serving experience required
Preporato Pro

Every lab in this collection, plus every practice test on the platform

$29.99 per month or $290 per year. Cancel any time. Free labs need only an account.

Frequently asked questions

More lab topics