Skip to content

Display TensorRT-LLM AgentX server metrics - #747

Merged
cquil11 merged 12 commits into
masterfrom
agent/capture-trtllm-server-metrics
Sep 2, 2026
Merged

Display TensorRT-LLM AgentX server metrics#747
cquil11 merged 12 commits into
masterfrom
agent/capture-trtllm-server-metrics

Conversation

@cquil11

@cquil11 cquil11 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a TensorRT-LLM server-metrics adapter for Dynamo disaggregated roles
  • expose TensorRT-LLM token, cache, queue, and KV metrics in AgentX charts and aggregates
  • preserve separate prefill and decode metric sources

Follows SemiAnalysisAI/InferenceX#2625 and NVIDIA/TensorRT-LLM#12545.

Validation

  • 24 focused Vitest tests passed
  • oxlint passed
  • oxfmt check passed
  • TypeScript typecheck passed

Note

Medium Risk
Touches production ETL versioning, disaggregated metric identity, and workflows that write production DB and invalidate cache; chart-series bumps require backfill/recompute for historical TRT runs to match new behavior.

Overview
Adds end-to-end TensorRT-LLM / Dynamo-TRT support in the AgentX data path: a dedicated server-metrics adapter, chart-series ETL (v16–18) for native trtllm_* and Dynamo rank-aware KV gauges, matching aggregate extraction, and UI that shows a combined chip + CPU cache hit label when TRT reports only the GPU field under offload.

CI / ops: ingest can target a named Neon child branch (resolve connection via Neon API, verify host, invalidate a preview URL). New Recompute Agentic Metrics workflow on master force-backfills chart series and aggregate stats for one GitHub run, then invalidates production cache. Staging adds a refresh-chart-series step after ingest (scoped by --run-id on backfills).

UI: Agentic point-detail charts replace equal-width legend slots with wrapped legends (layoutChartLegend + shared ChartLegend) so dense KV-cache labels no longer overlap; docs note the TRT metric preferences and recompute workflow.

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

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
inferencemax-app Ready Ready Preview Sep 2, 2026 2:49pm UTC

Request Review

@cquil11

cquil11 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing because the project scope is now limited to porting active, nondeprecated AMD multi-node configurations to srt-slurm. This PR is outside that scope.

@cquil11 cquil11 closed this Aug 27, 2026
@cquil11

cquil11 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Reopening: this PR predates the recent out-of-scope configuration-porting detour and was closed by mistake during an overly broad cleanup. Its prior state is being restored.

@cquil11 cquil11 reopened this Aug 27, 2026
Comment thread packages/db/src/etl/server-metrics-adapters.ts
Comment thread packages/db/src/etl/server-metrics-adapters.ts
Comment thread packages/db/src/queries/agentic-aggregates.ts
Comment thread packages/db/src/etl/server-metrics-adapters.ts
The hand-rolled point-detail charts laid their legend out on an
equal-width grid (`innerW / itemCount`) with no regard for how long the
labels actually are. At the inline 720-unit render the KV-cache chart
packs eleven per-engine series into ~58 units each, so "prefill (500e)",
"decode (5021)" and the rest overprinted one another into an unreadable
smear.

Add a shared legend layout helper that estimates each label's advance
width from its characters (fullwidth CJK counted at ~1em, Latin by
character class, rounded up so we wrap early rather than collide) and
packs items greedily into as many rows as they need. Charts grow their
viewBox height and bottom padding by the same amount, so the plot area
keeps its exact geometry and the extra rows extend the SVG downward — a
legend that already fit on one row renders exactly where it did before.

Applied to all three charts that shared the pattern: TimeSeriesChart,
StackedAreaChart, and the distribution percentile chips. Legend items
are now packed left rather than spread across the plot width.

Verified at inline (720), narrow, and expanded (1300) sizes with the
eleven real KV-cache labels, with CJK labels, and against real trace
data for point 439515 inline and in the expanded dialog.

中文:修复 agentic 明细页图表图例重叠问题。

这些手写 SVG 图表此前按 `innerW / 图例项数` 等宽分配图例位置,完全没有
考虑标签实际长度。在 720 单位的内联渲染下,KV cache 图表要放下 11 条
per-engine 曲线,每项只有约 58 单位,导致 "prefill (500e)"、"decode (5021)"
等标签互相叠印,完全无法辨认。

新增共享的图例排版辅助模块:按字符估算每个标签的宽度(CJK 全角字符按约
1em 计算,拉丁字符按字符类别估算,并统一向上取整,宁可提前换行也不重叠),
再贪心地将图例项分配到所需的行数。图表将 viewBox 高度与底部内边距同步增加
相同数值,因此绘图区几何尺寸完全不变,多出的行向下延伸——原本单行就能放下的
图例,渲染位置与改动前完全一致。

该修复已应用到共用此排版逻辑的全部三个图表:TimeSeriesChart、
StackedAreaChart 以及分布图的分位数图例。图例项现在改为左对齐紧凑排列,
不再横向铺满绘图区宽度。

已在内联(720)、窄容器、展开(1300)三种尺寸下,使用真实的 11 条 KV cache
标签及 CJK 标签验证,并针对 439515 号数据点的真实 trace 数据验证了内联渲染
与展开弹窗。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ingest-agentic-results.yml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0896009. Configure here.

Comment thread .github/workflows/stage-results.yml
@cquil11
cquil11 merged commit dcc7bbd into master Sep 2, 2026
28 checks passed
@cquil11
cquil11 deleted the agent/capture-trtllm-server-metrics branch September 2, 2026 14:53
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