# TensorRT-LLM Qwen2.5 7B on an NVIDIA A40

Measured: 24 November 2026

This directory preserves field test 003 of the Compare AI Cost inference-engine
research: TensorRT-LLM serving Qwen2.5-7B-Instruct on one NVIDIA A40, with the
same model, request shape, load generator and cost formula as the vLLM (field
test 001) and SGLang (field test 002) runs. Each JSON file is an unchanged
export from `vllm bench serve`.

## Configuration

- Provider: RunPod Secure Cloud, on-demand, CA-MTL-1
- Hardware: one NVIDIA A40 with 48 GB of GPU memory (driver 595.112.07)
- Cost basis: $0.60 per hour, rounded ($0.59 GPU plus about $0.014 for the
  100 GB container disk)
- Image: `nvcr.io/nvidia/tensorrt-llm/release:1.2.1`
- Serving engine: TensorRT-LLM 1.2.1, PyTorch backend, started with
  `trtllm-serve /workspace/models/qwen7b --host 127.0.0.1 --port 8000` and
  no other options (engine defaults)
- Model: `Qwen/Qwen2.5-7B-Instruct` in BF16, downloaded from Hugging Face
- Load generator: `vllm bench serve` 0.34.0 in a separate `uv` virtual
  environment on the same Pod, `--backend openai`, `/v1/completions`
- Request shape: random dataset, 512 input tokens and 256 output tokens,
  `random_range_ratio 0.0`, `seed 0`, `ignore_eos` false
- Maximum concurrency: 1, 8, 32 and 64; prompts per level = max(10 x
  concurrency, 50)

## Server facts from the TensorRT-LLM log

- KV cache: 470,428 tokens reserved (25.12 GiB, `free_gpu_memory_fraction`
  0.9, 32 tokens per block). 470,428 x 57,344 bytes per token =
  26,976,266,035 bytes, which matches `max_gpu_total_bytes` in the log.
  For reference, vLLM reserved 505,856 tokens and SGLang 428,234.
- Model weights: 14.44 GiB in GPU memory after loading
- Chunked prefill: off (`enable_chunked_prefill=False`), `max_num_tokens`
  8,192
- KV cache block reuse (prefix caching): on (`enable_block_reuse=True`)
- Decode CUDA graphs captured for batch sizes 1 to 32, 64 and 128
- Scheduler policy: `GUARANTEED_NO_EVICT`; autotuner enabled
- Served model name: `qwen7b` (the client sent `--model qwen7b` and read the
  tokenizer from the local model folder)
- Server ready (health check passing): 11:40:13 UTC

The full log is in `environment/trtllm_server.log`.

## Files

- `a40_qwen7b_trtllm_c1.json`, `_c8.json`, `_c32.json`, `_c64.json`: the
  second sweep, which supplies the published tables
- `sweep1/a40_qwen7b_trtllm_sweep1_c*.json`: the first sweep, unchanged
- `summary.csv`: selected measured fields from the second sweep plus derived
  GPU-cost figures, in the same columns as the vLLM summary
- `environment/`: engine version, GPU record, `pip freeze` of the image as
  shipped, and the server log
- `evidence/runpod_billing_2026-11-24.json`: RunPod pod billing record, pod
  ID replaced with a label

All eight raw files report zero failed requests, and every run produced the
full 256 output tokens per request (12,800 / 20,480 / 81,920 / 163,840).

## Repeatability

Both sweeps have raw JSON exports and checksums.

| Max concurrency | Sweep 1 output tok/s | Sweep 2 output tok/s | Difference |
| --------------: | -------------------: | -------------------: | ---------: |
|               1 |                27.63 |                34.85 |     +26.1% |
|               8 |               262.40 |               260.76 |      -0.6% |
|              32 |               872.61 |               869.39 |      -0.4% |
|              64 |             1,489.34 |             1,490.01 |      +0.0% |

The concurrency 1 gap comes from a single stalled request in the first
sweep. Sweep 1 at concurrency 1 lasted 463.3 seconds against 367.3 seconds
in sweep 2, and its mean time to first token was 2,025 ms against a median of
98 ms. Both point to one request that waited roughly 96 seconds for its first
token, while the other 49 behaved like sweep 2. It was the first traffic the
server received after start-up, so it is treated as warm-up. The cause was
not traced; the server log shows no error.

## Run note

While downloading the model, `pip install -U "huggingface_hub[cli]"` upgraded
`huggingface_hub` in the image to 2.4.0, which the bundled `transformers`
4.57.3 does not support. It was restored to the shipped version (0.36.2, as
recorded in `environment/pip_freeze.txt`) before the server started. The
server and both sweeps ran on the image's own package versions. Future runs
download the model from a separate environment so the engine's packages are
never touched.

## Derived cost formula

```text
GPU cost per 1M output tokens =
  hourly GPU cost * 1,000,000 / (output tokens per second * 3,600)
```

```text
GPU cost per 1,000 requests =
  hourly GPU cost * (1,000 * 256 output tokens)
  / (output tokens per second * 3,600)
```

## Billing

The Pod was created at 07:19 UTC and terminated at about 12:25 UTC. Setup
began at 11:33 UTC, so about four hours were idle. The billing record covers
the whole life of the Pod, idle time included: $3.00 of GPU time and $0.07 of
disk, $3.08 in total for about 5.1 hours, consistent with the $0.59 GPU and
about $0.014 disk hourly rates. The benchmark itself, from setup to the end of
the second sweep, took about 50 minutes. The idle time does not change the
derived cost figures, which use the hourly rate and measured throughput only.

## Evidence boundary

This benchmark covers one GPU, model, engine and synthetic request profile,
with engine defaults. The load generator ran on the same Pod as the server and
shared its CPU. The derived figures attribute the full hourly compute cost to
output tokens. Complete production cost also depends on storage, transfer,
start-up time, idle capacity, retries, observability and engineering work.
