feat: Workload Mix Optimizer (M115)#254
Merged
Merged
Conversation
- WorkloadMixOptimizer class in workload_mix.py - WorkloadSpec, WorkloadAllocation, MixOptimizationResult Pydantic models - Brute-force enumeration with budget pruning - SLA compliance check using measured percentiles - CLI workload-mix subcommand with --workload, --total-gpus, table + JSON output - Programmatic optimize_workload_mix() API - 32 new tests Closes #253
hlin99-Review-Bot
approved these changes
Apr 6, 2026
hlin99-Review-Bot
left a comment
Contributor
There was a problem hiding this comment.
✅ Approved by hlin99-Review-Bot
Idea Value: Strong addition — workload mix optimization is a natural next step after multi-backend comparison. Aligns well with the project's data-driven GPU planning goals.
Code Quality:
- Clean
WorkloadMixOptimizerwith brute-force + budget pruning — appropriate for the problem size - Pydantic models well-defined with proper validators (
WorkloadSpec,WorkloadAllocation,MixOptimizationResult) - SLA check uses measured percentiles from benchmark data (no guessing ✓)
- CLI follows established patterns with Rich table + JSON output
- 32 tests covering models, optimizer, convenience API, and public imports
docs/iterations/current.mdupdated ✓- ROADMAP.md updated ✓
CI: All checks pass (lint, test 3.10/3.11/3.12)
LGTM 👍
hlin99-Review-BotX
approved these changes
Apr 6, 2026
hlin99-Review-BotX
left a comment
There was a problem hiding this comment.
✅ Approved by hlin99-Review-BotX
Idea Value: Solid — workload mix optimization is the logical extension for multi-workload GPU cluster planning. Aligns with project goals.
Code Quality:
WorkloadMixOptimizerbrute-force + pruning approach is clean and appropriate- Pydantic models with proper validators (
WorkloadSpec.namestrip, weight > 0) _check_slauses measured percentiles — data-driven ✓_is_bettercomparison logic is correct (SLA-met first, then fewer instances, then lower waste)- CLI follows repo patterns (Rich table + JSON, argparse registration)
- 32 tests with good coverage across models, optimizer, convenience API, imports
docs/iterations/current.mdandROADMAP.mdupdated ✓
CI: All checks pass (lint, test 3.10/3.11/3.12)
LGTM 👍 — 2nd approval, should auto-merge.
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
Add Workload Mix Optimizer (M115) — given benchmark data for multiple workloads (different models or request patterns), find the minimum total GPU instances while meeting per-workload SLA constraints.
Changes
WorkloadMixOptimizerclass inworkload_mix.pywith brute-force enumeration and budget pruningWorkloadSpec,WorkloadAllocation,MixOptimizationResultPydantic modelsworkload-mixsubcommand with--workload(repeatable),--total-gpus, Rich table + JSON outputoptimize_workload_mix()APICloses #253