Skip to content

feat: GPU Hour Calculator (M116)#256

Merged
hlin99 merged 1 commit into
mainfrom
feat/m116-gpu-hours
Apr 6, 2026
Merged

feat: GPU Hour Calculator (M116)#256
hlin99 merged 1 commit into
mainfrom
feat/m116-gpu-hours

Conversation

@hlin99

@hlin99 hlin99 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

Add GPU Hour Calculator (M116) — given benchmark data and a daily traffic profile (hourly QPS schedule), estimate total GPU hours, costs, and auto-scaling savings.

Changes

  • GPUHourCalculator class in gpu_hours.py with QPS-to-instance mapping
  • TrafficProfile, HourlyTraffic, GPUHourReport, ScalingSavings, HourBreakdown Pydantic models
  • 24-hour traffic profile input with per-hour QPS values
  • Auto-scaling savings: compare fixed (peak) vs dynamic (per-hour) provisioning
  • CLI gpu-hours subcommand with --benchmark, --traffic-profile, --gpu-cost, Rich table + JSON output
  • Programmatic calculate_gpu_hours() API
  • 24 new tests covering models, calculator, CLI, edge cases, public imports
  • Updated ROADMAP.md (M115 ✅, M116 🔄) and docs/iterations/current.md

Closes #255

- GPUHourCalculator class in gpu_hours.py
- TrafficProfile, HourlyTraffic, GPUHourReport, ScalingSavings, HourBreakdown models
- 24-hour traffic profile with hourly QPS mapping to required instances
- Auto-scaling savings estimation (fixed vs dynamic provisioning)
- CLI gpu-hours subcommand with --benchmark, --traffic-profile, --gpu-cost
- Programmatic calculate_gpu_hours() API
- 24 new tests

Closes #255

@hlin99-Review-Bot hlin99-Review-Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (hlin99-Review-Bot)

CI all green (lint + tests 3.10/3.11/3.12). Code review:

  • Idea: GPU Hour Calculator fits naturally as M116 — practical cost estimation from traffic profiles with auto-scaling savings analysis. Good addition.
  • Code quality: Clean Pydantic models with proper validation (hour range, unique hours, sorted output). Calculator logic is straightforward and correct. CLI well-structured with Rich table + JSON output.
  • Tests: 24 tests covering models, calculator, CLI, edge cases, and public imports. Good coverage.
  • Docs: ROADMAP.md and iterations/current.md updated correctly.

Ship it.

@hlin99-Review-BotX hlin99-Review-BotX left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (hlin99-Review-BotX)

CI all green (lint + tests 3.10/3.11/3.12). Code review:

  • Idea: GPU Hour Calculator is a natural M116 addition — maps traffic profiles to GPU cost estimates with auto-scaling savings analysis. Practical and well-scoped.
  • Code quality: Clean Pydantic models with proper validation (hour range 0-23, unique hours, sorted output). Calculator logic is straightforward — QPS-to-instance mapping with ceil, fixed vs dynamic comparison. CLI follows established patterns (Rich table + JSON).
  • Tests: 24 tests covering models, calculator, CLI, edge cases, and public imports. Good coverage.
  • Docs: ROADMAP.md (M115 ✅, M116 🔄) and iterations/current.md updated correctly.

Ship it.

@hlin99 hlin99 merged commit 6153baa into main Apr 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: GPU Hour Calculator (M116)

3 participants