feat: add prefill_density feature for TTFT prediction - #31
Conversation
7b1b12c to
74c91b0
Compare
|
Thanks for this. The change itself is clean and correctly scoped. I verified the wiring: prefill_density now appears in exactly the same places as effective_input_tokens across both servers, train/predict column orders match (no train/serve skew), and it's correctly TTFT-only. Nice that it's a small, low-risk feature with the clip(lower=1) divide-by-zero guard. Main thing blocking a confident approval is how this was validated. The tables look rigorous, but they appear to come from synthetic/simulated data rather than a real benchmark trace, and a couple of the numbers are hard to interpret as-is (avg TTFT moved -0.06 ms, which is noise; "P99 routing regret -19.4%" is a large relative delta on a 4.02 to 3.24 ms absolute base with no significance test). Could you add: Actual-vs-predicted calibration plots, with and without the feature, for TTFT (where we expect improvement) and TPOT (to confirm it's genuinely unchanged, since the feature is TTFT-only, so a shift there would signal a bug). Scatter or per-quantile calibration is more convincing than aggregate MAPE. If we establish this (a documented before/after calibration plus workload spec), it'd be a great template for a feature-engineering regression test going forward: every new engineered feature should come with the same actual-vs-predicted evidence on a named workload, so we can tell real signal from noise and catch regressions in the other target. |
|
Thanks for the thorough review and for verifying the wiring end to end. You're right that the validation is synthetic. All three levels (standalone A/B, E2E server, routing simulation) used a physics-grounded contention model (density² × √itl), not a real benchmark trace. The -0.06 ms avg TTFT delta is noise, agreed the routing accuracy (+0.82%) and P99 regret (-0.78 ms absolute) are the meaningful signals, though I take your point that they need error bars to be convincing. I have a baseline from a CoreWeave cluster (Qwen3-32B FP8, 3 × H200, 851 real TTFT samples), but it was collected under low concurrency, so it doesn't exercise the contention signal that prefill_density targets. The scripts already compute actual-vs-predicted arrays and per-seed std internally, I just only saved aggregates to the result JSONs. I'll re-run and add the per-seed breakdowns with error bars, actual-vs-predicted calibration scatter for TTFT and TPOT (to confirm no regression on the unchanged target), and a workload spec table to the PR. For real contention evidence, I can run a before/after on Waldorf under concurrent load that would give us the named-workload calibration you're describing. Like the idea of making this a standard for future feature PRs. |
|
This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the |
Signed-off-by: Madhu Goutham Reddy Ambati <mambati@redhat.com>
Signed-off-by: Madhu Goutham Reddy Ambati <mambati@redhat.com>
Signed-off-by: Madhu Goutham Reddy Ambati <mambati@redhat.com>
74c91b0 to
3c889e0
Compare
Signed-off-by: Madhu Goutham Reddy Ambati <mambati@redhat.com>
dc56969 to
d9d8447
Compare



What does this PR do?
Adds
prefill_density(num_request_running / input_token_length) as an engineered feature for TTFT prediction. Wires it through the full pipeline: feature preparation, training, prediction, metrics export, and model saving.Why is this change needed?
XGBoost uses axis-aligned splits and cannot efficiently learn ratio-based interactions from raw features. GPU contention is physically non-linear many small concurrent prefills cause disproportionate per-token overhead. Pre-computing the density ratio lets XGBoost capture
density² × √(input_token_length)interactions that it cannot decompose fromnum_request_runningandinput_token_lengthindependently.Validation: 3-level testing
1. Prediction accuracy (standalone A/B, 10 seeds, P90 quantile regression):
Feature importance: 0.102 (10.2%, 4th highest). Tested across 3 scenarios helps under non-linear contention, harmless when no signal exists.
2. E2E pipeline test:
Started actual training server, fed 2000 samples via
/add_training_data_bulk, waited for retrain, ran 500 predictions via/predict. Pipeline works end-to-end.3. Routing simulation (8 pods, 2000 requests, 10 seeds):
How was this tested?
Checklist
Related Issues
Closes #27