AI Infrastructure & Local LLMs
0/24 complete

Module 03 · GPU Benchmarking

Comparing Quantization Levels: Speed vs. Quality Trade-Offs

20 minfocused lesson0copyable prompts3completion checks3source links
Open lesson + course map

On this lesson

Course outline

A quantization comparison should isolate precision/format while holding the base model, revision, prompt template, runtime, and workload constant. The goal is to find the smallest variant that still meets the task’s quality and reliability thresholds—not the variant with the most attractive label.

// concept

Design a Fair Matrix

Choose one official or trusted base checkpoint and supported variants generated with a documented tool/version. Verify provenance, digest, license, and any calibration method. Record naming exactly; “Q4” alone can hide different quantization schemes.

Fix:

  • runtime and backend;
  • GPU/CPU offload placement;
  • context and active sequences;
  • sampling/seed where possible;
  • prompt formatting and system message;
  • input set and output limit;
  • warm-up and repetition count;
  • thermal/power environment.

Test at least one higher-precision reference and two practical candidates. If the reference cannot fit the same device, disclose the changed hardware or run it separately as quality-only evidence.

// concept

Evaluate More Than Average Quality

Use task-specific slices. A general assistant might need factuality, instruction following, refusal behavior, formatting, Urdu/Roman Urdu, code, and long-context retrieval. A classifier needs per-class precision/recall or a simpler reviewed confusion table. A structured extractor needs schema validity and field accuracy.

Track catastrophic failures separately from small stylistic differences. A one-point average improvement does not compensate for inventing account numbers or dropping negation in a safety-critical task.

For each variant capture file size, load time, peak RAM/VRAM, prompt speed, generation speed, TTFT, p50/p95, invalid outputs, retries, and quality by slice. Randomize order and blind human reviewers to variant names when feasible.

// worked_example

Worked Example

An English-only summary set shows little difference between 8-bit and two 4-bit variants. A bilingual extraction slice reveals one 4-bit variant drops Urdu date qualifiers more often. The service requires bilingual accuracy, so that candidate fails even though it is fastest.

The chosen variant has slightly lower throughput than the winner but meets every acceptance threshold and leaves VRAM headroom for two concurrent requests. The report does not conclude that its quantization is universally superior.

// concept

Interpret Speed Carefully

Lower precision may reduce memory traffic and allow better GPU residency, but a particular hardware/backend may lack efficient kernels. A smaller file can therefore load faster yet decode at the same or lower speed. Partial offload, cache type, batch size, and context may interact with the result.

If changing quantization also allows a larger base model, run two analyses: within-model quantization effect, then end-to-end candidate selection. Do not merge them into one causal claim.

// failure_cases

Failure Cases

7 cases to diagnose

  • Comparing community variants with unknown conversion settings.

  • Using one generic benchmark and no real task set.

  • Averaging away a dangerous failure category.

  • Testing each variant with different context or offload.

  • Reporting speed without retries and schema failures.

  • Calling small sample noise a meaningful quality gap.

  • Assuming lower bit depth always improves performance.

// pakistan_angle

Pakistan Angle

Include the languages and document patterns the product will actually handle. Have a fluent reviewer check Urdu script and Roman Urdu rather than scoring by automated similarity alone. Use synthetic or authorized redacted documents.

Quantization may extend the life of locally available hardware and reduce power, but measure wall power and completion time if economics matter. Faster completion at higher watts can cost differently from slower continuous operation; publish dated assumptions.

// hands_on

Hands-On Exercise

Compare three variants of one base revision on at least 60 prompts across four slices. Blind-score outputs, compute schema/retry rates, and capture speed/memory/thermals. Define thresholds before viewing results and write a one-page decision including limitations.

// completion_rubric

Completion Rubric

3 grading bands

  • Complete

    provenance and variables are controlled, quality slices include critical failures, and the decision uses predeclared thresholds.

  • Needs revision

    metrics are sound but variants, review method, or interaction effects are not fully documented.

  • Not complete

    bit labels or average tokens/second substitute for a workload evaluation.

// sources

Sources