Repository navigation
Rewrite/go - #1
Merged
Merged
Conversation
Replaces previous roadmap with comprehensive gap analysis against the GPU.NET × Tenstorrent Inference Benchmarking Framework spec. Key additions: - AMD ROCm platform (MI300X, MI250X) alongside NVIDIA and Tenstorrent - Three-backend architecture (NVIDIA/AMD/Tenstorrent) with shared interface - TTFT, TPOT, SLA bands, goodput, concurrency sweep, seq-length matrix - Quality gate (lm-evaluation-harness, parity checks, precision disclosure) - Crossover analysis and structured benchmark report - Phased implementation priority
Project structure: cmd/gpu-benchmark/ CLI entry (cobra) internal/platform/ Platform interface + NVIDIA, AMD, Tenstorrent impls internal/benchmark/ Load generator with TTFT, TPOT, SLA, goodput internal/docker/ Container lifecycle management internal/download/ HuggingFace model download/cache internal/orchestrator/ Ties platform + docker + benchmark together internal/report/ Result persistence, summarize (table/csv/json) internal/workload/ Model registry, seq profiles, traffic profiles internal/sysinfo/ System command helpers Milestone 1 status: - CLI: run, summarize, sysinfo commands - Platform interface with NVIDIA (working), AMD (stub), Tenstorrent (stub) - Docker container lifecycle (pull, run, wait healthy, stop) - Load generator: concurrent requests, streaming SSE parsing - Metric collection: E2E latency, TTFT, TPOT, SLA bands, goodput - Warmup phase (5 discarded requests by default) - Cold-start time recording - Result JSON persistence + summarize (table/csv/json) - Model registry (models.yaml) - Cost calculation - Signal cleanup (SIGINT/SIGTERM) - 6.3MB static binary (vs 57MB Bun compiled) Not yet implemented: - Sysinfo standalone command (full hardware + OS collection) - Cross-compile targets - Tests
sysinfo command:
- Collects CPU (model + cores), RAM, OS, kernel, Docker version, disk space
- Platform-aware: Linux (/proc/cpuinfo, /proc/meminfo, /etc/os-release)
and macOS (sysctl) paths
- Pretty print and --json output
- Detects GPU platform (NVIDIA/AMD/Tenstorrent) and shows device details
Orchestrator:
- collectSystemInfo() now calls sysinfo.Collect() for full OS-level info
- SystemInfo JSON includes CPU, RAM, OS, kernel, Docker, disk
Tests (44 total, all passing):
internal/benchmark:
- SLA compliance (meetsSLA) — 8 cases across all 3 bands
- Result aggregation (aggregateResults) — success, empty, all-failed
- Percentile computation — 5 cases + empty
- Median duration — odd, even, single, empty
- Prompt generation determinism
- Truncate utility
internal/platform:
- VRAM parsing — 7 input variants
- Quantization flags — all 6 quant types
- Platform Name() — all 3 platforms
- NVIDIA ContainerConfig — image, env vars, GPU flags, model args
- AMD ContainerConfig — /dev/kfd device flags
- Docker image override
internal/report:
- Write + Load round-trip — full BenchmarkResult
- Empty directory, system_info.json skip, invalid JSON skip
- Special characters in model names
- JSON field verification (platform, stream, warmup, SLA)
internal/workload:
- YAML model loading — valid, missing ID, defaults
- File not found, invalid YAML
- FindModel — with slash, without slash, default quant
Bug fixes (13 Go bugs fixed):
Critical:
BUG 2: break in select now uses labeled break to exit for-loop
(classic Go gotcha — break inside select breaks select, not for)
High severity:
BUG 4: Cold start measurement uses time.Since(start) instead of
accumulating intervals (was reporting 0 on first-check success)
BUG 5: useStreamOpts is now threaded through to sendRequest() and
conditionally includes stream_options in the payload
BUG 6: Replaced double signal handler with single handler that does
both cancel() and dmgr.Cleanup() atomically
BUG 7: Backoff formula simplified to 2^attempt where attempt is the
retry number, independent of cfg.Retries
BUG 8: printTable() now has nil checks on r.Metrics (was nil panic)
Medium severity:
BUG 9: truncate() uses rune-based slicing for safe UTF-8
BUG 10: FixCachePermissions probes write access before running sudo
chown (was hanging for password on macOS)
BUG 12: parseVRAM uses proper float rounding instead of integer
truncation
BUG 13: Summarize() now returns errors from LoadResults instead of
silently swallowing them
BUG 14: Warmup generates separate prompts so benchmark prompts
aren't pre-warmed in server cache
BUG 15: SSE scanner buffer increased to 1MB
Minor:
- Removed duplicate configs/models.yaml
- go vet passes clean
- Updated PLAN.md: Milestone 1 and 2 both marked done
New features:
- Fixed prompt dataset: 190 real-world prompts embedded in binary
via go:embed (internal/benchmark/prompts.go + prompts.txt)
- PromptDataset API: Load, Get, Sample, SampleN, GeneratePrompts
with token-length targeting (concatenates real prompts to hit
target token count using ~4 chars/token heuristic)
- Token verification via /tokenize endpoint (--verify-tokens flag)
with batch verification and deviation warnings
- Concurrency sweep: --concurrency-sweep 1,2,4,8,16,32,64,128
- Sequence-length sweep: --seq-sweep runs all 5 framework profiles
(short-chat, long-input-rag, long-output-reasoning,
very-long-context, summarisation)
- Repeat with statistics: --repeat N produces mean ± stddev
aggregation across repeats for each matrix cell
- Traffic profiles: --traffic-profile flag (single-stream,
interactive, high-concurrency, offline-batch)
- Matrix orchestration: model × seq-profile × concurrency × traffic
- Per-cell JSON result storage in <model>_sweep/ subdirectory
- SweepAggregate type with TPSMean, TPSStddev, TTFT/TPOT means
- PrintSweepTable for formatted output
CLI flags added:
--concurrency-sweep comma-separated concurrency levels
--seq-sweep run all 5 seq-length profiles
--repeat N repeat each cell for confidence intervals
--traffic-profile select traffic profile
--verify-tokens validate prompt token counts
Tests: 60 total (8 new prompts, 6 new sweep, 4 new report-sweep)
All pass. go vet clean. Binary: 6.3MB
New features:
- Config file support: .gpu-benchmark.yaml with search from
cwd up to $HOME. CLI flags always override config values.
Example config via ExampleConfig() for docs.
- Markdown report generation (gpu-benchmark report):
system config section, benchmark results table, per-model
detail sections with throughput/latency/SLA tables, sweep
results aggregation with auto-discovery of sweep subdirs
- Reproducible artifact export (gpu-benchmark export):
tar.gz with all JSON/MD/CSV files + manifest.json,
reproducible timestamps, --list flag to inspect archives
- Preflight checks (gpu-benchmark preflight):
Docker availability, disk space (--min-disk-gb),
nvidia-container-toolkit, python3, HF token
- 429 rate-limit handling: honors Retry-After header
(both seconds and HTTP-date formats), falls back to 5s
- parseRetryAfterHeader added to http.go alongside
existing HTTP wrappers
New files:
internal/config/config.go + config_test.go (7 tests)
internal/report/markdown.go + markdown_test.go (3 tests)
internal/report/export.go + export_test.go (4 tests)
internal/sysinfo/preflight.go
New CLI commands:
gpu-benchmark report --results-dir <dir>
gpu-benchmark export --results-dir <dir> [--output path]
gpu-benchmark preflight [--min-disk-gb 50]
Tests: 76 total, all pass. go vet clean.
New features:
- Compare command (gpu-benchmark compare <dir_a> <dir_b>):
side-by-side TPS/latency/cost table, crossover analysis
(where B overtakes A), SLA goodput comparison (--sla flag)
- Quality gate (gpu-benchmark quality):
lm-evaluation-harness runner, precision detection
(config.json + server response), configurable thresholds
(MMLU ≥55%, HumanEval ≥35%, GSM8K ≥45%)
- Config → run integration: .gpu-benchmark.yaml values
automatically applied for unset CLI flags
- Quality gate flag on run command: --quality-gate --quality-tasks
New tests (18 new, 94 total):
internal/quality/gate_test.go (6 tests)
internal/report/compare_test.go (8 tests)
internal/benchmark/http_test.go (3 tests)
internal/docker/docker_test.go (5 tests)
internal/download/download_test.go (4 tests)
internal/sysinfo/preflight_test.go (5 tests)
CI:
.github/workflows/ci.yml — Go 1.23/1.24, vet, test, build
Docs:
README.md rewritten for Go CLI
PLAN.md updated: M5 marked done
All 94 tests pass. go vet clean. Binary: 6.7MB.
AMD ROCm backend:
- 4-strategy hardware detection: rocm-smi, /sys/class/kfd,
/sys/class/drm, lspci with PCI ID → GFX arch mapping
- VRAM detection from rocm-smi CSV and sysfs mem_banks
- GFX architecture detection (gfx942, gfx90a, gfx1100, etc.)
via sysfs properties and PCI device ID lookup table
- HSA_OVERRIDE_GFX_VERSION auto-configuration from detected arch
- Container config: --device /dev/kfd, /dev/dri, --group-add
video+render, --network host, HIP_VISIBLE_DEVICES
- Runtime checks: amdgpu module, /dev/kfd access, user groups
Tenstorrent Wormhole backend:
- 5-strategy hardware detection: tt-smi JSON, tt-smi text,
tt-topology, /sys/class/tenstorrent sysfs, lspci with
Tenstorrent vendor ID (0x1e52) and device ID lookup
- Board model detection: WH n300, WH n150, Grayskull
- Native server support: StartNativeServer() for non-Docker path
- Container config: --device /dev/tenstorrent, hugepage mounts
- Runtime checks: kernel module, hugepages, Docker availability
Per-platform model configuration:
- New ModelConfig fields: Platform, DockerImage, ServingBackend
- models.yaml updated with platform-specific model entries
(NVIDIA, AMD ROCm, Tenstorrent TT)
- Orchestrator filters models by detected platform
- Per-model Docker image override in container config
Tests: 28 new tests (110 total), all pass. go vet clean.
Binary: 7.0MB (linux/amd64).
…needed - Move platform auto-detection to platform.AutoDetect() (single source of truth) - Probes NVIDIA → AMD → Tenstorrent in order, picks first hit - Warns when multiple platforms detected: tells user to use --platform - platform.ProbeAll() for sysinfo: shows ALL detected GPUs simultaneously - sysinfo no longer has --platform flag; always probes everything - run: --platform is now documented as 'override auto-detection' - Remove duplicate detectPlatform() from main.go and orchestrator.go - 5 new tests for AutoDetect/ProbeAll (115 total)
--dry-run now works on any machine regardless of GPU presence: - Platform detection failure is non-fatal in dry-run mode - Falls back to DryRunPlatform with sensible defaults per vendor - Skips Docker init, signal handlers, container lifecycle - Shows what container config WOULD be used (image, model, port) DryRunPlatform implements the Platform interface with: - Returns synthetic GPU (80GB) for VRAM checks - Correct Docker images per vendor (vllm, rocm/vllm, tt-inference-server) - Correct GPU passthrough flags per vendor 3 new tests (118 total). All pass.
- Delete all src/*.ts files and Node.js config (package.json, bun.lock, tsconfig.json) - Remove TODO.md (all items resolved) - Fix resource leak in ExportBundle (file handle shadow variable) - Fix defer cancel() inside loop in quality gate - Fix isLinux() to use runtime.GOOS instead of env vars - Fix AMD platform: --device rocm (was cpu), dynamic --port - Fix VRAM check to compute total available across all GPUs - Replace custom LCG PRNG with math/rand - Replace custom sqrt() with math.Sqrt, fix sample variance formula - Fix probeStreamOptions false positives (only return true on HTTP 200) - Add error logging in writeSystemInfo - Remove dead code: cfgField, allDevices, detectPlatform, config.Merge - Update bugs.md and PLAN.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.