feat(grid-llmd-pool-metrics): add kvCachePressure scoring flavor - #13
Open
jordigilh wants to merge 2 commits into
Open
feat(grid-llmd-pool-metrics): add kvCachePressure scoring flavor#13jordigilh wants to merge 2 commits into
jordigilh wants to merge 2 commits into
Conversation
Ships a second Forge config flavor (forge-kv-cache.yaml) alongside the existing forge.yaml, selecting Grid's kvCachePressure scoring strategy instead of queueDepth. Both flavors share the same resources/ and configs/ assets and are driven entirely by published ghcr.io images (grid-operator, grid-ai-rollup, grid-overlay-sync v0.1.3) -- no local build or grid checkout changes required. - forge-kv-cache.yaml: same two-pool topology as forge.yaml, with scoringPolicy.strategy: kvCachePressure on both GridNetwork sites. - run-grid-demo.sh: new FORGE_CONFIG_NAME env var lets a demo select which Forge config file to use, defaulting to forge.yaml. - run.sh: intercepts a new --kv-cache flag and sets FORGE_CONFIG_NAME accordingly before delegating to run-grid-demo.sh. - README.md: documents both flavors side by side (which strategy each selects, how the score is computed, how to run either), and notes that both queue_depth and kv_cache are always shown in the live table regardless of which flavor is active. Live-validated end-to-end on helios08 (Aug 11): the kv-cache flavor's routing flip is driven by the KV signal while queue depth stays flat, confirming the two flavors exercise genuinely different Grid scoring paths, not just a cosmetic label change. Signed-off-by: Jordi Gil <jgil@redhat.com>
…_NAME Restricts FORGE_CONFIG_NAME to a bare filename within DEMO_DIR: any "/" (e.g. a stray "../" or an absolute path) is now rejected before it's used to build FORGE_CONFIG, instead of silently resolving outside the demo directory. Flagged as optional defense-in-depth by an independent security review of this PR (local-only, same-user config control, not a demonstrated exploit) -- applying it anyway since it's a two-line, zero-behavior- change guard for the two legitimate values (forge.yaml, forge-kv-cache.yaml). Signed-off-by: Jordi Gil <jgil@redhat.com>
Contributor
Author
|
Ran an independent security review of this diff. Summary: no medium/high/critical issues — One optional hardening idea came up (path traversal via |
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.
What
Adds a second, selectable Forge config flavor to
grid-llmd-pool-metrics:--kv-cacheselectsforge-kv-cache.yaml(Grid'skvCachePressurescoring strategy) instead of the defaultforge.yaml(queueDepth). Both flavors share the sameresources/andconfigs/assets and run entirely against publishedghcr.ioimages — no local build orgridcheckout required.Why
This is the demos-repo counterpart to a mirrored
--kv-cacheflag added to the internalgridxtask e2e topology (praxis-proxy/grid#46) — but this demo is independent of that PR:forge-kv-cache.yamlhardcodesscoringPolicy.strategy: kvCachePressuredirectly, so it works today againstmain, whether or notgrid#46has merged.ScoringStrategy::KvCachePressureis a real, already-tested Grid strategy; this demo makes it live-demoable using only published images.How it was validated
Ran both flavors end-to-end (quick + full mode) on
helios08:./run.sh --full --teardown(queueDepth, unchanged default) — pressure/flip/recovery proofs pass../run.sh --full --kv-cache --teardown(kvCachePressure) — KV-cache utilization rises and drives the A→B rank flip while queue depth stays flat, confirming the two flavors exercise genuinely different Grid scoring paths, not a cosmetic label swap.Changes
demos/grid-llmd-pool-metrics/forge-kv-cache.yaml(new) — same two-pool topology asforge.yaml,scoringPolicy.strategy: kvCachePressureon both sites.scripts/run-grid-demo.sh— newFORGE_CONFIG_NAMEenv var to select a Forge config file, defaulting toforge.yaml(backward compatible).demos/grid-llmd-pool-metrics/run.sh— intercepts--kv-cacheand setsFORGE_CONFIG_NAMEbefore delegating.demos/grid-llmd-pool-metrics/README.md— documents both flavors side by side.DCO sign-off included.