Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe61e32c6d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let Some(item) = &o.item else { return Ok(vec![Answer::default()]) }; | ||
| let us = self.prices.price(&self.call(item)?)?; | ||
| let a = self.answer(item)?; | ||
| wait(issued + Duration::from_secs_f64(us / 1e6)); |
There was a problem hiding this comment.
Handle negative extrapolated prices before constructing a duration
When a request's context falls outside the measured range, the linear extrapolation can produce a negative duration even when every measurement is positive. For example, measurements of 100 µs at context 16 and 340 µs at context 40 price a one-token context at −50 µs. Prices::read accepts that report, but Duration::from_secs_f64 then panics, killing the scheduler instead of returning an error. Validate the extrapolated price and return a descriptive error or apply an explicit nonnegative pricing policy before constructing the duration.
AGENTS.md reference: AGENTS.md:L111-L112
Useful? React with 👍 / 👎.
…a bench report measured A server is what it decides and what its GPU takes to run each decision. `KernScheduler` already runs its ranks' orders through `Run`, so `priced::Priced` replaces the second and leaves the first alone: it answers an order once the time `kern bench` measured for the call's shape has passed, and hands back one fixed token a row. The frontend, the scheduler and the rank's pool are the server's own code, on a machine with no GPU, starting in three seconds. A price is read off the report of the workload `kern workload` writes from a manifest's bounds: a step at its own size, a chunk between the measured chunks around its rows, each plus what a token of context adds. A size nobody measured is an error that names it. A report of another manifest, a second rank, a speculative round and the pooled tier are refused. The real rank's `rank item` debug line now carries the call's shape, so a real server's orders can be priced off the same report and compared. Measured against the real server (Qwen3.8-27B, one GB300, open-loop Poisson load, three load points, docs/serve.md): TPOT p50 within +0.1% to +0.3%, TTFT p50 +1.4% to +2.1%, E2E p50 within 1.4% where the real server repeats itself. Order by order, launch to done differs from the price by -0.3% to -0.6% of the summed prices, writing inputs adds 0.2% to 0.5%, and the time between two orders is the same on both. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: JinYan Su <751080330@qq.com>
fe61e32 to
d8deef5
Compare
What
kern server <target> --prices <report.json> --capacity <tokens>loads no GPU. The frontend,KernSchedulerand the rank's pool are the server's own code; the rank behindRunis replaced bypriced::Priced, which answers an order once the time akern benchreport measured for the call's shape has passed, and hands back one fixed token a row. It starts in about three seconds and several run beside each other on a machine with no device.--trace.rank itemdebug line now carries the call's shape (vars, tokens held), so a real server's orders can be priced off the same report.The report is the one measured on the workload
kern workloadwrites from a manifest's bounds (#143); the error messages and docs name that command's--groups/--chunk, so this reads best after #143.Measured (docs/serve.md, 2026-11-18, one GB300, Qwen3.8-27B)
The same requests at the same times, open-loop Poisson load, real server with 32 cores:
Order by order, as shares of a load's summed prices: writing inputs +0.2% to +0.5%, launch to done less the price −0.3% to −0.6%, graph capture of a new shape ≤0.26%; the time between two orders is the same on both servers (45–80 µs against 44–91 µs). What remains is in the prices: whole chunks of 2048–4096 rows are priced 2.3% high, short last chunks over a context 6–8% low.
Gate
crates/kern-serve/tests/priced.rs: six tests over theplain.jsonfixture (measured calls, the per-token slope, chunk interpolation, the unmeasured-call error, linearity as a property, a priced rank driven throughRanksorders). fmt and clippy-D warningsclean locally.🤖 Generated with Claude Code