# SGLang Qwen2.5 7B on an NVIDIA A40

Measured: 21 November 2026

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

## Configuration

- Provider: RunPod Secure Cloud, on-demand, EU-SE-1
- Hardware: one NVIDIA A40 with 48 GB of GPU memory
- Cost basis: $0.60 per hour, rounded ($0.59 GPU plus $0.007 for the 50 GB
  container disk)
- Image: `runpod/pytorch:2.1.0-cu1320-torch280-ubuntu2404`
- Serving engine: SGLang 0.5.23, started with
  `python -m sglang.launch_server --model-path Qwen/Qwen2.5-7B-Instruct --host 127.0.0.1 --port 30000`
  and no other options (engine defaults)
- Model: `Qwen/Qwen2.5-7B-Instruct` in BF16
- Load generator: `vllm bench serve` 0.34.0 in a separate 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 SGLang log

- `mem_fraction_static` 0.843 (vLLM's default `gpu_memory_utilization` is
  0.9)
- KV cache: 428,234 tokens, K 11.44 GB plus V 11.44 GB, bfloat16 (vLLM
  reserved 505,856 tokens)
- `chunked_prefill_size` 4,096, `max_prefill_tokens` 16,384, schedule policy
  `fcfs`
- Attention backend `flashinfer`; radix cache (prefix caching) on
- Decode CUDA graphs captured for batch sizes 1 to 32 only, so batches above
  32 at concurrency 64 ran without a decode CUDA graph
- Start-up: server arguments logged 00:29:47 UTC, KV cache allocated
  00:30:18, ready 00:31:37 (about two minutes, most of it CUDA graph capture)

## Files

- `a40_qwen7b_sglang_c1.json`, `_c8.json`, `_c32.json`, `_c64.json`: the
  second sweep, which supplies the published tables
- `sweep1/a40_qwen7b_sglang_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
- `sglang_a40_both_sweeps_with_hashes.csv`: every measured field for both
  sweeps, with the SHA-256 of each raw file
- `evidence/runpod_billing_2026-11-21.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 |                35.64 |                35.65 |      +0.0% |
|               8 |               241.94 |               265.71 |      +9.8% |
|              32 |               872.16 |               872.76 |      +0.1% |
|              64 |             1,458.48 |             1,453.25 |      -0.4% |

The concurrency 8 gap comes from a one-off stall in the first sweep: p99 time
to first token was 7,641 ms against a median of 139 ms. It did not repeat in
the second sweep (p99 590 ms), so it is treated as warm-up.

## Run note

During the run, sweep 2 initially wrote to the sweep 1 file names because the
run label was not reset. The sweep 1 files had been copied to a backup on the
Pod before any overwrite. The overwritten files were renamed to sweep 2 and the
backup restored; the restored sweep 1 checksums match the hashes recorded when
sweep 1 finished. The loop now refuses to overwrite an existing result file.

## 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 left running for several hours after the benchmark finished. The
billing record shows $6.01 of GPU time and $0.07 of disk, $6.08 in total for
about 10.2 hours, consistent with the hourly rates. The benchmark itself used
about one hour. 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.
