Repository navigation
Conversation
|
@yatesdr As requested, I refactored the PR. I had to do an additional refactor to account for the recipe refactor and other upstream changes. It took a bit longer than expected, since I got the flu in the middle. Hopefully the updated commit/PR messages have clear rationale and details. I believe I've covered all of your earlier points. I should mention that I have updates to the existing recipes pending, plus I've created two new additional recipes. I have tested this successfully on my new recipes and:
|
|
A case file has been opened for 533. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review for Agents · Value Proposition · Case File Recommendation: Changes RequestedThe seam is now right — Blockers:
Should fix:
Subtract / Simplify:Could remove ~7 of +35 added lines (plus about half of the new docs row):
Nits:5 nits To opt out, include #autobot:ignore in your post or comment. |
1a006c6 to
de1b5b5
Compare
Autobot ReviewFull Review for Agents · Value Proposition · Case File Recommendation: Changes RequestedBlockers:
Should fix:
Subtract / Simplify:Could remove ~17 of +98 added lines (≈9 of the +57 test hunk, ≈8 of the +41 code/docs), plus about half of the new docs row:
Nits:5 nits Full report — PR #533 "Cap the per-request context target" (head
|
51d81b0 to
02023eb
Compare
Autobot ReviewFull Review for Agents · Value Proposition · Case File Recommendation: Changes RequestedBlockers:
Should fix:
Subtract / Simplify:Could remove ~10 of +84 added lines (~7 in the test hunk, ~3 in docs):
Nits:6 nits: the Nothing was executed here and head To opt out, include #autobot:ignore in your post or comment. |
02023eb to
9118add
Compare
Autobot ReviewFull Review for Agents · Value Proposition · Case File Recommendation: Changes RequestedThe shape of the change is now right and should not be reworked: one optional field on the universal Blockers:
Should fix:
Subtract / Simplify:Could remove ~14 of +69 added lines (~10 test, 3 declaration, 1 planning), plus half of one docs row:
Nits:7 nits To opt out, include #autobot:ignore in your post or comment. |
9118add to
e623985
Compare
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe design is right and needs no rework: one field on the universal
Have your agent review the Full Review for complete findings, To opt out, include |
e623985 to
448f70a
Compare
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe design is right and needs no rework: one field on the universal
See the Full Review for Have your agent review the Full Review for complete findings, To opt out, include |
448f70a to
503a438
Compare
|
@yatesdr... I did a lot of refactoring to keep up with the massive number of commits. I've removed all blockers, tweaked the commit, and recync'd to commit: 8ae2d0b4fb7738cfdcff61b3fb8036020906f303. |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeAll prior blockers and earlier review items are resolved at
Walkthrough
Merge Risk: Low · up to
|
88c3553 to
298adfb
Compare
Adds `--request-context` to cap the prepared per-request context below the recipe max. This reduces KV pool/export size and enables higher concurrency on memory-constrained deployments. Why: The default per-request context (262,144 tokens) over-provisions the KV pool, so the desired concurrency may not fit. What Changed: - Added `context_target` to `RecipeParameters` (`ignition/parameters.py`): - CLI flag: `--request-context` - Scope: `DEPLOYMENT` - Manifest key: `context_target` - Plan report prints the effective value via `status_parts()`: the target when it's below the declared context limit (via `_declared_context_limit`) - Values above the recipe max are accepted and clamped to `recipe.context`; the field has no upper bound. - Added `Plan.prepared_context` (`ignition/planning.py`): - Returns the recipe max when no target is set. - Returns `min(recipe.context, N)` when a target is set. - `Plan.context` remains unchanged. - Validation and guarantees now use the effective cap: - Page-multiple validation checks the resolved `prepared_context` directly; values above the recipe max clamp to the recipe max (page-aligned by construction, so no error). - Bench checks compare `required_context` against `min(context, prepared_context)`, so an uncapped plan with a small pool still rejects infeasible bench selections. - Prefill-chunk checks compare against `min(context, prepared_context)`, so caps below the recipe’s prefill chunk are rejected at export rather than at `flare run`. - `Plan.to_dict()` emits `"prepared_context"`, and `guaranteed_tokens` uses it so the guarantee reflects the cap. - `demand_pages` uses `prepared_context` instead of the uncapped recipe maximum (SF-1b: the plan document previously overstated page demand by ~2x when the cap was active). - Export/serve behavior uses the effective cap: - `ignition/cli/serve.py` uses `plan.prepared_context` for `max_body_bytes`. - `context_hint` names the cap only when active: `plan.prepared_context < plan.declared_context`. - `ignition/cli/help.py` labels recipe context as a maximum that `--request-context` can lower. - `ignition/preparation/bootstrap.py` passes `plan.prepared_context` as the `context` key in `common_preparation_kwargs()`, the single seam all recipes consume. - `RecipeParameters.reproduction_args()` explicitly emits `--request-context N` when set; `repro_always` is not set for this field. - Docs updated: - `docs/cli-design.md`: flag row for `--request-context` (admission consequence + page-multiple rule), export owner-row names the cap, and the universal-fields paragraph now points to `RecipeParameters` in `ignition/parameters.py` instead of enumerating flags inline. - `docs/preparation-development.md`: points to `RecipeParameters` for the universal field list. - `docs/direct-execution.md`: adds `--request-context` to the preparation flags list. - Tests: - `tests/cli/test_planning.py`: new `test_request_context_target_prepared_context_and_manifest` verifies `prepared_context` resolution (capped, oversized, unset), bootstrap `context` key, page-multiple rejection, and manifest/reproduction-args emission. Result: - Deployments can cap prepared context and `max_sequence_tokens` below the recipe max. - Requests whose prompt plus requested output exceeds the cap are rejected at admission. - The cap sets an export-time ceiling and never raises the runtime bound. A cap above the physical page pool still shrinks the export artifact, while Helios `fit_context` clamps serve-time context to the pool. Evidence: - Measured on Qwen3.8-27B (this branch) on one RTX PRO 6000 Blackwell (SM120, 96 GB) with the flag active. - Workload: a memory-constrained deployment where the default per-request context (262,144 tokens) over-provisions the KV pool, leaving insufficient VRAM for the desired concurrency. - Three packages, one per prepared context — `ignition export qwen3.8-27b --gpus 0 --max-concurrency 8 --online-mxfp8`, served at concurrency 1–4 with `--kv-cache-limit concurrency`, using `--request-context` unset, `196608`, and `131072`. Total VRAM (GB, per GPU, from `nvidia-smi`): | Concurrency | Default (262,144) | `--request-context 196608` | `--request-context 131072` | | ----------: | ----------------: | -------------------------: | -------------------------: | | 1 | 31.0 | 29.0 | 27.1 | | 2 | 39.3 | 35.3 | 31.4 | | 3 | 47.6 | 41.6 | 35.7 | | 4 | 55.8 | 47.8 | 39.8 | - At concurrency 4, the 131,072 cap frees ~16 GB versus the default, providing headroom for higher concurrency. - Note: The VRAM savings apply to `--kv-cache-limit concurrency`, where the pool is sized as concurrency × prepared context. Under the default `--kv-cache-limit memory` mode, the pool fills available VRAM regardless of the cap; the cap still enforces admission control, but does not change the pool size. - Note: Reviewer open questions, resolved against the local engine and recipes clones: no shipped recipe overrides `adjust_page_tokens` (the only definition is the base-class default in `hyperflare_recipes/parameters.py`, which scales the page size by the context-parallel factor; the page-multiple validation checks that same effective page size, so the scaling is already accounted for), and no in-repo consumer reads `checkpoint_context` from a stored plan or benchmark record (emitted by `Plan.to_dict()`, read nowhere in either package), so emitting it beside `prepared_context` breaks no reader. Discord: rzr2020 Signed-off-by: Roberto Rivera <rzrivera@protonmail.com> Design-Signed-Off-By: Roberto Rivera <rzrivera@protonmail.com>; design-review=2e5b
298adfb to
1b86a19
Compare
|
@flare-autobot Resolved merge conflict from upstream commits. Sync'd to c146d7b. |
|
Let me know whether you are interested in this PR. According to the autobot, the PR is:
That said, if you are not interested in the change let me know and I'll cancel the PR. Cheers and thanks again for the lovely work! |
Adds
--request-contextto cap the prepared per-request context below the recipe max. This reduces KV pool/export size and enables higher concurrency on memory-constrained deployments.Why: The engine bakes the per-request context ceiling at export with no serve-time knob to lower it. --request-context N adds an admission-control ceiling: a request whose prompt plus requested output exceeds N is rejected before it loads pages. This is a bound no runtime pool setting (--kv-cache-limit, --max-concurrency) can express, since those trim the serve-time pool, not the prepared core's max_sequence_tokens. As a consequence, shortening the prepared context shrinks each request's KV allocation and buys concurrency headroom on memory-constrained deployments.
What Changed:
context_targettoRecipeParameters(ignition/parameters.py):--request-contextDEPLOYMENTcontext_targetstatus_parts(): the target when it's below the declared context limit (via_declared_context_limit)recipe.context; the field has no upper bound.Plan.prepared_context(ignition/planning.py):min(recipe.context, N)when a target is set.Plan.contextremains unchanged.prepared_contextdirectly; values above the recipe max clamp to the recipe max (page-aligned by construction, so no error).required_contextagainstmin(context, prepared_context), so an uncapped plan with a small pool still rejects infeasible bench selections.min(context, prepared_context), so caps below the recipe’s prefill chunk are rejected at export rather than atflare run.Plan.to_dict()emits"prepared_context", andguaranteed_tokensuses it so the guarantee reflects the cap.demand_pagesusesprepared_contextinstead of the uncapped recipe maximum (SF-1b: the plan document previously overstated page demand by ~2x when the cap was active).ignition/cli/serve.pyusesplan.prepared_contextformax_body_bytes.context_hintnames the cap only when active:plan.prepared_context < plan.declared_context.ignition/cli/help.pylabels recipe context as a maximum that--request-contextcan lower.ignition/preparation/bootstrap.pypassesplan.prepared_contextas thecontextkey incommon_preparation_kwargs(), the single seam all recipes consume.RecipeParameters.reproduction_args()explicitly emits--request-context Nwhen set;repro_alwaysis not set for this field.docs/cli-design.md: flag row for--request-context(admission consequence + page-multiple rule), export owner-row names the cap, and the universal-fields paragraph now points toRecipeParametersinignition/parameters.pyinstead of enumerating flags inline.docs/preparation-development.md: points toRecipeParametersfor the universal field list.docs/direct-execution.md: adds--request-contextto the preparation flags list.tests/cli/test_planning.py: newtest_request_context_target_prepared_context_and_manifestverifiesprepared_contextresolution (capped, oversized, unset), bootstrapcontextkey, page-multiple rejection, and manifest/reproduction-args emission.Result:
max_sequence_tokensbelow the recipe max.fit_contextclamps serve-time context to the pool.Evidence:
ignition export qwen3.8-27b --gpus 0 --max-concurrency 8 --online-mxfp8, served at concurrency 1–4 with--kv-cache-limit concurrency, using--request-contextunset,196608, and131072.Baseline (Qwen3.8-27B, RTX PRO 6000 96 GiB):
--request-context 196608--request-context 131072Example - Total VRAM (GB, per GPU, from
nvidia-smi):--request-context 196608--request-context 131072--kv-cache-limit concurrency, where the pool is sized as concurrency × prepared context. Under the default--kv-cache-limit memorymode, the pool fills available VRAM regardless of the cap; the cap still enforces admission control, but does not change the pool size.adjust_page_tokens(the only definition is the base-class default inhyperflare_recipes/parameters.py, which scales the page size by the context-parallel factor; the page-multiple validation checks that same effective page size, so the scaling is already accounted for), and no in-repo consumer readscheckpoint_contextfrom a stored plan or benchmark record (emitted byPlan.to_dict(), read nowhere in either package), so emitting it besideprepared_contextbreaks no reader.Discord: rzr2020
Signed-off-by: Roberto Rivera rzrivera@protonmail.com
Design-Signed-Off-By: Roberto Rivera rzrivera@protonmail.com; design-review=2e5b