feat(output): add --show-gpu-ratios (vCPU/GPU, RAM/GPU columns) - #154
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
find/search show vCPUs and GPUs as separate columns, so seeing whether an instance can actually feed its accelerators requires computing vCPU/GPU by hand across two columns. For CPU/IO-bound ML workloads (data prep or I/O-heavy inference where the GPU sits mostly idle) that ratio is the decisive spec, not the raw GPU count: g5.4xlarge (16 vCPU / 1 GPU = 16.0) vs g5.12xlarge (48 vCPU / 4 GPUs = 12.0) — the naive "4 GPUs -> 4x throughput" reading is backwards, since the bigger box actually starves each GPU MORE. Adds TableOptions.ShowGPURatios, wired to a new --show-gpu-ratios flag on both find and search. Renders two additional columns (vCPU/GPU, RAM/GPU) alongside the existing GPU/GPU Model/VRAM columns, computed from data already in InstanceTypeResult (no new API calls). A fractional GPU (GPUs==0, GPUPartitionSize>0, e.g. g6f.large — a time-sliced L4 partition) renders "-" for both rather than dividing by a fractional count: that row is a shared slice of one GPU, not a caller-controlled resource, so the ratio would be a number that looks precise but answers no real question. Verified against live AWS data (us-east-1): g5.4xlarge and g5.12xlarge reproduce the issue's own motivating numbers exactly (16.0 and 12.0); g6f.large correctly shows dashes. Fixes #51
scttfrdmn
force-pushed
the
feat/51-vcpu-per-gpu
branch
from
August 19, 2026 05:03
de2e77f to
fabe41e
Compare
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.
Summary
find/searchshow vCPUs and GPUs as separate columns, so seeing whether an instance can actually feed its accelerators requires computing vCPU/GPU by hand across two columns. For CPU/IO-bound ML workloads (data prep or I/O-heavy inference where the GPU sits mostly idle) that ratio is the decisive spec, not the raw GPU count — the issue's own motivating example:g5.4xlarge(16 vCPU / 1 GPU = 16.0) vsg5.12xlarge(48 vCPU / 4 GPUs = 12.0). The naive "4 GPUs → 4x throughput" reading of the separate columns is backwards: the bigger box actually starves each GPU more.Adds
TableOptions.ShowGPURatios, wired to a new--show-gpu-ratiosflag on bothfindandsearch. Renders two additional columns (vCPU/GPU,RAM/GPU) alongside the existingGPUs/GPU Model/VRAMcolumns, computed from data already present inInstanceTypeResult— no new API calls. A fractional GPU (GPUs==0,GPUPartitionSize>0, e.g.g6f.large— a time-sliced L4 partition) renders-for both rather than dividing by a fractional count: that row is a shared slice of one GPU, not a caller-controlled resource-feeding ratio, so the number would look precise but answer no real question.Verification against live AWS
us-east-1,--show-price --show-gpu-ratios:Test plan
pkg/output/printer_test.go:TestPrintTable_ShowGPURatios_MotivatingExample(reproduces the issue's own g5.4xlarge/g5.12xlarge numbers),TestPrintTable_ShowGPURatios_RAMPerGPU,TestPrintTable_ShowGPURatios_FractionalGPUShowsDash,TestPrintTable_ShowGPURatios_NonGPURowShowsDash,TestGPURatioDisplay(pure-helper boundary cases: zero memory, zero GPUs),TestPrintTable_ShowGPURatios_Default(columns are opt-in — absent without the flag).pkg/output/printer.gomakesgo vetfail to compile the new tests (unknown field ShowGPURatios) — the tests cannot pass without the fix.go build ./...,go vet ./...,go test ./...all greengolangci-lint run ./cmd/... ./pkg/output/...— only pre-existing findings in untouched code (app.go, gendocs.go, root.go, and one unrelated printer.go helper), none in the new codemake check-docsclean (regenerateddocs-gen/find.mdanddocs-gen/search.mdfor the new flag)## [Unreleased]Fixes #51