Skip to content

feat: ingest and display kv_transfer_lib on benchmark results#516

Open
Oseltamivir wants to merge 2 commits into
masterfrom
feat/kv-transfer-lib-ingest
Open

feat: ingest and display kv_transfer_lib on benchmark results#516
Oseltamivir wants to merge 2 commits into
masterfrom
feat/kv-transfer-lib-ingest

Conversation

@Oseltamivir

@Oseltamivir Oseltamivir commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The benchmarking repo is gaining runtime detection of the KV-cache transfer library (Mooncake, NIXL, MoRI-IO, UCX) for disaggregated runs, emitted as an optional kv_transfer_lib string on result rows (companion InferenceX PR, branch feat/kv-transfer-lib-metadata). This PR is the forward-only app side: ingest the field when present and show it in chart tooltips. Until now the transfer library was invisible downstream — dynamo-sglang covers both Mooncake (DSV4 recipes) and NIXL (GLM-5 STP recipes) under one framework key; only mooncake-atom / mori-sglang encoded it in the name.

Changes

DB (packages/db)

  • Migration 008: nullable kv_transfer_lib text column on benchmark_results (+ lowercase CHECK). Result-level metadata, deliberately not part of the config natural key — config identity and trend-line continuity are unchanged. Recreates the latest_benchmarks materialized view (it materializes select br.* at creation time) with the identical migration-007 definition.
  • benchmark-mapper: surfaces the field as a metrics sibling (like workers), trimmed/lowercased, defensively narrowed — absent/empty/non-string ⇒ undefined.
  • benchmark-ingest: writes the column (NULL when absent), included in the conflict-update path.
  • All four benchmark SELECTs and the json-provider return it.

App (packages/app)

  • BenchmarkRowAggDataEntryInferenceData passthrough.
  • Tooltips show a KV Transfer line (Mooncake / NIXL / MoRI-IO / UCX; unmapped values uppercased) in the parallelism/configuration section of all three tooltip variants: official, unofficial-run overlay, and GPU date-comparison. NULL/absent renders nothing — unknown is never guessed to a default.
  • unofficial-run route carries the field from raw artifacts so overlays match the official path.

Unofficial run overlay support

Works for both official runs and ?unofficialrun= overlays: the overlay path reuses mapBenchmarkRow + transformBenchmarkRows, and the route copies kvTransferLib into the overlay BenchmarkRows. Covered by unit tests on the overlay route (route.test.ts) and the overlay tooltip generator (tooltip-utils.test.ts). Note: live manual verification isn't possible yet — no artifacts contain the field until the benchmarking-repo PR merges and a run lands; the overlay tests pin the behavior in the meantime.

Existing data

Historical rows stay NULL and the tooltip simply omits the line. If backfill is ever wanted, AMD history is derivable from the framework column alone (mooncake-atom ⇒ mooncake, mori-sglang ⇒ mori, vllm-disagg ⇒ nixl) in one UPDATE; recipe-driven dynamo-* history would need a git-history walk and is intentionally out of scope.

Testing

  • pnpm typecheck, pnpm lint, pnpm fmt clean.
  • New unit tests: mapper capture/normalization/narrowing (db), transform passthrough, tooltip line in all three variants incl. absent-field omission, overlay route carry/null. All touched files pass; the 13 pre-existing use-feature-gate / chunk-load-recovery / visit-tracker failures reproduce on clean master and are unrelated.

Sequencing

  • Reads are migration-tolerant: all four benchmark read queries surface the column via to_jsonb(row) ->> 'kv_transfer_lib' (the migration-006 workers rollout pattern), so previews and prod work whether or not migration 008 has run. A regression test pins this.
  • Migration 008 must run before the first ingest of field-bearing artifacts — the ingest INSERT references the column directly. Since artifacts only carry the field once the benchmarking-repo PR merges, running the migration any time before that is sufficient.

Note

Medium Risk
Touches benchmark ingest and all benchmark read queries plus a materialized view rebuild; mis-sequenced migration could 500 the dashboard, though the to_jsonb guard and optional field limit blast radius.

Overview
Adds optional KV-cache transfer library metadata (mooncake, nixl, mori, ucx) for disaggregated benchmark runs, from runner artifacts through the DB to chart tooltips—without changing config identity or trend lines.

Database: Migration 008 adds nullable kv_transfer_lib on benchmark_results (lowercase CHECK), rebuilds latest_benchmarks, and the ingest path maps, normalizes, and upserts the field separately from scalar metrics (same pattern as workers).

API reads: Benchmark SELECTs expose the value via to_jsonb(row) ->> 'kv_transfer_lib' so queries still plan when migration 008 is not applied yet.

App: The field flows BenchmarkRow → chart points → KV Transfer in official, unofficial overlay, and GPU date-comparison tooltips (known labels mapped; absent/null omits the line). The unofficial-run overlay route passes it through from artifacts.

Reviewed by Cursor Bugbot for commit 22a039c. Bugbot is set up for automated code reviews on this repo. Configure here.

The benchmarking repo now derives the KV-cache transfer library
(Mooncake, NIXL, MoRI-IO, UCX) at result-processing time and emits an
optional `kv_transfer_lib` string on disaggregated result rows. Until
now that detail was invisible downstream — e.g. dynamo-sglang covers
both Mooncake (DSV4) and NIXL (GLM-5 STP) recipes under one framework
key.

Forward-only ingestion:

- Migration 008: nullable `kv_transfer_lib` column on benchmark_results
  (result-level metadata, not part of the config natural key, so config
  identity and trend-line continuity are unchanged), and recreates the
  latest_benchmarks materialized view to expose it.
- ETL: benchmark-mapper surfaces the field as a metrics sibling
  (lowercased, defensively narrowed); benchmark-ingest writes it.
- Queries/API: all benchmark SELECTs and the json-provider return it.
- UI: tooltips show a "KV Transfer" line in the official, overlay
  (unofficial run), and GPU-comparison views. NULL/absent renders
  nothing — unknown is never guessed.

Historical rows stay NULL (the runner didn't emit the field); the
tooltip simply omits the line for them. AMD history is derivable from
the framework column if a backfill is ever wanted.
@Oseltamivir Oseltamivir requested a review from adibarra as a code owner July 3, 2026 02:52
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment Jul 3, 2026 3:21am

Request Review

…eries

Migrations are applied manually (pnpm admin:db:migrate), separately from
the Vercel deploy, so the PR preview runs against a DB that doesn't have
migration 008 yet. A bare reference to a non-existent column fails to
plan ("column \"kv_transfer_lib\" does not exist"), 500ing every
benchmarks request and blanking the dashboard — the same failure mode as
the migration-006 workers rollout.

Read the column via to_jsonb(row) ->> 'kv_transfer_lib' in all four read
paths (getLatestBenchmarks base-table + view branches,
getBenchmarksForRun, getAllBenchmarksForHistory). JSON key lookup is a
runtime op that returns NULL for an absent key instead of failing at
parse time; behavior is identical once the column exists.

Adds a regression test asserting the read queries never reference the
column directly. The ingest INSERT still requires migration 008 — run it
before the first ingest of field-bearing artifacts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant