Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9821c05
test(dash): characterization safety-net + mockup visual baseline (Pha…
michaelroy-amd Jun 23, 2026
6cac90f
feat(dash): port btop chrome helpers — outlined tabs, logo, overlay, …
michaelroy-amd Jun 23, 2026
59f4a85
feat(dash): add Home tab additively (ActiveTab grows; default unchang…
michaelroy-amd Jun 23, 2026
b07a2aa
feat(dash): collapse to Home/Action/Observe/Chat 4-tab IA (Phase 3)
michaelroy-amd Jun 23, 2026
9d6f8b0
feat(dash): Esc menu + command palette + tabbed Options + global Help…
michaelroy-amd Jun 23, 2026
eec5e52
feat(dash): minimal launcher front door for bare rocm (Phase 5)
michaelroy-amd Jun 23, 2026
31dc92c
feat(dash): wide triptych shell with LOGS/CONTEXT right dock (Phase 6)
michaelroy-amd Jun 23, 2026
9a49d43
test(dash): harden — empty/loading/error states, honesty, a11y of col…
michaelroy-amd Jun 23, 2026
337bb71
fix(dash): wire outlined tabs into live chrome, center-align in wide …
michaelroy-amd Jun 23, 2026
eb45342
fix(dash): restore footer legend to the bottom row
michaelroy-amd Jun 23, 2026
c0e4910
feat(dash): rounded btop-title bento boxes, per-box color, inline Act…
michaelroy-amd Jun 23, 2026
e59df68
fix(dash): shorten the btop title notch and tighten the label brackets
michaelroy-amd Jun 23, 2026
cec2b5a
feat(dash): round the tab panel, unify inactive tabs with the border,…
michaelroy-amd Jun 24, 2026
1c4a6ab
fix(dash): let the active tab accent curve outward into the frame
michaelroy-amd Jun 24, 2026
96b0015
feat(dash): 5-tab IA — Home/ROCm/Serving/Observe/Chat
michaelroy-amd Jun 24, 2026
cf3be3d
feat(dash): ROCm & Serving tab modules + PaneFocus (retire action.rs)
michaelroy-amd Jun 24, 2026
68884b4
feat(dash): de-modal managers — render inline in the ROCm/Serving Det…
michaelroy-amd Jun 24, 2026
747b905
feat(telemetry): live TTFT/TPOT from vLLM histograms
michaelroy-amd Jun 24, 2026
16b9a18
feat(dash): Observe redesign — AI-serving metrics
michaelroy-amd Jun 24, 2026
42862ed
test(dash): Phase 6 harden — a11y theme sweep + demo buffer-dump
michaelroy-amd Jun 24, 2026
2c970e4
feat(dash): re-modal managers + real log scrolling
michaelroy-amd Jun 24, 2026
3317c9f
docs(dash): IA redesign + modal/scroll plans
michaelroy-amd Jun 27, 2026
8385ab6
fix(dash): reconcile branch with main after rebase (doctor→examine, h…
michaelroy-amd Jun 27, 2026
8e70bdd
chore(dash): remove internal design/plan docs and mockups from public PR
michaelroy-amd Jun 29, 2026
7a13613
refactor(dash): delete orphaned overview tab and unused draw_placeholder
michaelroy-amd Jun 29, 2026
a789185
fix(dash): usable short-terminal Esc menu, accurate hints, saturating…
michaelroy-amd Jun 29, 2026
58206fa
test(dash): NaN guards + TPOT/efficiency coverage; refresh stale IA c…
michaelroy-amd Jun 29, 2026
351a513
Merge origin/main into dash-ui-polish-work
michaelroy-amd Jun 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions apps/rocm/src/dash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,42 @@ pub fn run(replay: Option<PathBuf>, demo: bool, chat_mock: bool) -> Result<()> {
// `zbus::blocking`, which builds its own runtime and `block_on`s internally;
// doing that on a dash runtime worker thread panics with "Cannot start a
// runtime from within a runtime". See `run_async`.
let args = resolved_args(&config, &paths, ActiveTab::Overview);
let args = resolved_args(&config, &paths, ActiveTab::Home);
let rt = build_dashboard_runtime()?;
rt.block_on(run_async(config, paths, args, replay, chat_mock))
}

/// Entry point for bare `rocm` and interactive `rocm chat`. Opens the unified
/// dashboard with the Chat tab focused. Thin wrapper over the same runtime/
/// `run_async` path as [`run`]; no replay/demo, embedded daemon as usual.
/// Entry point for bare `rocm`: show the minimal launcher front door, then
/// escalate into the existing dash/chat entry points based on the choice.
///
/// The launcher is a thin synchronous pre-screen (no daemon, no async runtime);
/// `rocm dash` / `rocm chat` reach [`run`] / [`run_chat`] directly and are
/// unaffected by this path.
pub fn run_launcher(chat_mock: bool) -> Result<()> {
let paths = AppPaths::discover()?;
let config = RocmCliConfig::load(&paths).unwrap_or_default();
let theme = config.dashboard.tui.theme;
match rocm_dash_tui::ui::launcher::run_launcher(&theme)? {
None => Ok(()),
Some(choice) => {
use rocm_dash_tui::ui::launcher::LauncherChoice;
match choice {
LauncherChoice::Chat => run_chat(chat_mock),
// Serve / Set up / Diagnose / Open dashboard all escalate into
// the full dash (Home); the guided managers are reachable there
// via the Action tab + seam (ponytail: no separate routing yet).
LauncherChoice::Serve
| LauncherChoice::SetUp
| LauncherChoice::Diagnose
| LauncherChoice::OpenDashboard => run(None, false, chat_mock),
}
}
}
}

/// Entry point for interactive `rocm chat`. Opens the unified dashboard with the
/// Chat tab focused. Thin wrapper over the same runtime/`run_async` path as
/// [`run`]; no replay/demo, embedded daemon as usual.
pub fn run_chat(chat_mock: bool) -> Result<()> {
let paths = AppPaths::discover()?;
let config = RocmCliConfig::load(&paths)?;
Expand Down Expand Up @@ -370,7 +398,7 @@ mod tests {
#[test]
fn resolved_args_take_connect_and_theme_from_config() {
let c = cfg();
let args = resolved_args(&c, &paths(), ActiveTab::Overview);
let args = resolved_args(&c, &paths(), ActiveTab::Home);
assert_eq!(args.connect, c.dashboard.tui.connect);
assert_eq!(args.theme, c.dashboard.tui.theme);
assert!(!args.chat_mock);
Expand Down
12 changes: 6 additions & 6 deletions apps/rocm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,10 @@ fn maybe_migrate_legacy_dashboard_config() {
fn launch_default() -> Result<()> {
refresh_startup_update_check_quietly();
if interactive_terminal() {
// Bare `rocm` routes to the unified dash chat (parity reached, Phases
// 3-8); the legacy `tui::run` assistant is retained but no longer the
// interactive entrypoint.
return dash::run_chat(false);
// Bare `rocm` opens the minimal launcher front door; "Open full
// dashboard" / `d` escalates into the unified dash, "Chat" reaches the
// Chat tab. `rocm dash` / `rocm chat` bypass the launcher.
return dash::run_launcher(false);
}

let paths = AppPaths::discover()?;
Expand Down Expand Up @@ -22453,8 +22453,8 @@ VERSION_ID="41"
let src = main_rs_source();
let body = strip_line_comments(&launch_default_body(&src));
assert!(
body.contains("dash::run_chat(false)"),
"bare `rocm` interactive branch must route to dash::run_chat; body:\n{body}"
body.contains("dash::run_launcher(false)"),
"bare `rocm` interactive branch must route to the launcher; body:\n{body}"
);
assert!(
!body.contains("tui::run"),
Expand Down
6 changes: 6 additions & 0 deletions crates/rocm-dash-collectors/src/lemonade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ pub fn parse_stats(body: &str) -> InstanceSample {
// Lemonade has no cumulative token counter; surface the rate directly.
gen_tokens_total: None,
gen_tps: stats.tokens_per_second,
// TTFT/TPOT histograms are a vLLM-Prometheus concept; Lemonade leaves
// them None (Observe shows `—`).
ttft_sum_s: None,
ttft_count: None,
tpot_sum_s: None,
tpot_count: None,
}
}

Expand Down
47 changes: 47 additions & 0 deletions crates/rocm-dash-collectors/src/vllm_prom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const KEY_RUNNING: &str = "vllm:num_requests_running";
const KEY_WAITING: &str = "vllm:num_requests_waiting";
const KEY_KV_CACHE: &str = "vllm:gpu_cache_usage_perc";
const KEY_GEN_TOKENS: &str = "vllm:generation_tokens_total";
// TTFT / TPOT latency histograms. We read the cumulative `_sum` (seconds) and
// `_count` series; the runner windows successive readings into an average ms
// (Δsum/Δcount), mirroring the `generation_tokens_total` → `gen_tps` path.
const KEY_TTFT_SUM: &str = "vllm:time_to_first_token_seconds_sum";
const KEY_TTFT_COUNT: &str = "vllm:time_to_first_token_seconds_count";
const KEY_TPOT_SUM: &str = "vllm:time_per_output_token_seconds_sum";
const KEY_TPOT_COUNT: &str = "vllm:time_per_output_token_seconds_count";

#[derive(Debug, Clone)]
pub struct VllmPrometheusCollector {
Expand Down Expand Up @@ -96,6 +103,11 @@ pub(crate) fn parse(text: &str) -> InstanceSample {
let kv = extract(text, KEY_KV_CACHE).map(|v| (v * 100.0) as f32);
// Cumulative output-token counter; the runner differences it into a rate.
let gen_tokens_total = extract(text, KEY_GEN_TOKENS);
// Cumulative latency histograms; the runner windows them into avg ms.
let ttft_sum_s = extract(text, KEY_TTFT_SUM);
let ttft_count = extract(text, KEY_TTFT_COUNT);
let tpot_sum_s = extract(text, KEY_TPOT_SUM);
let tpot_count = extract(text, KEY_TPOT_COUNT);
if running.is_none() && waiting.is_none() && kv.is_none() && gen_tokens_total.is_none() {
warn!("vllm metrics payload had none of the expected keys");
}
Expand All @@ -106,6 +118,10 @@ pub(crate) fn parse(text: &str) -> InstanceSample {
gen_tokens_total,
// vLLM uses the cumulative-counter path; no direct rate.
gen_tps: None,
ttft_sum_s,
ttft_count,
tpot_sum_s,
tpot_count,
}
}

Expand Down Expand Up @@ -158,6 +174,15 @@ vllm:gpu_cache_usage_perc{model=\"deepseek-r1\"} 0.4231
# HELP vllm:generation_tokens_total Number of generation tokens processed.
# TYPE vllm:generation_tokens_total counter
vllm:generation_tokens_total{model=\"deepseek-r1\"} 1234567.0
# HELP vllm:time_to_first_token_seconds Histogram of time to first token.
# TYPE vllm:time_to_first_token_seconds histogram
vllm:time_to_first_token_seconds_sum{model=\"deepseek-r1\"} 50.0
vllm:time_to_first_token_seconds_count{model=\"deepseek-r1\"} 200.0
vllm:time_to_first_token_seconds_bucket{model=\"deepseek-r1\",le=\"0.1\"} 5.0
# HELP vllm:time_per_output_token_seconds Histogram of time per output token.
# TYPE vllm:time_per_output_token_seconds histogram
vllm:time_per_output_token_seconds_sum{model=\"deepseek-r1\"} 30.0
vllm:time_per_output_token_seconds_count{model=\"deepseek-r1\"} 1500.0
";

#[test]
Expand All @@ -170,6 +195,28 @@ vllm:generation_tokens_total{model=\"deepseek-r1\"} 1234567.0
assert_eq!(s.gen_tokens_total, Some(1_234_567.0));
}

#[test]
fn parses_ttft_tpot_histograms() {
let s = parse(SAMPLE);
// The `_sum`/`_count` series are read; `_bucket` lines are ignored
// (distinct metric name, so the sum key never matches a bucket line).
assert_eq!(s.ttft_sum_s, Some(50.0));
assert_eq!(s.ttft_count, Some(200.0));
assert_eq!(s.tpot_sum_s, Some(30.0));
assert_eq!(s.tpot_count, Some(1500.0));
}

#[test]
fn ttft_tpot_absent_yields_none() {
// A payload with the core gauges but no latency histograms → all None.
let text = "vllm:num_requests_running 7\nvllm:generation_tokens_total 9000\n";
let s = parse(text);
assert_eq!(s.ttft_sum_s, None);
assert_eq!(s.ttft_count, None);
assert_eq!(s.tpot_sum_s, None);
assert_eq!(s.tpot_count, None);
}

#[test]
fn parses_generation_counter_without_labels() {
let s = parse("vllm:generation_tokens_total 9000\n");
Expand Down
41 changes: 41 additions & 0 deletions crates/rocm-dash-core/src/efficiency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ pub fn gpu_ids_overlap(gpu_ids: &[String], gpus: &[GpuMetrics]) -> bool {
gpus.iter().any(|g| device_in(&g.device_id, gpu_ids))
}

/// Summed board power (W) of the GPUs one instance occupies.
///
/// Uses the same id-normalizing join as [`tokens_per_watt`]. `None` when no
/// matched GPU reports power (id join found nothing / amd-smi unavailable) so
/// the Observe table shows `—` rather than a fabricated `0 W`.
#[must_use]
pub fn instance_power_w(gpu_ids: &[String], gpus: &[GpuMetrics]) -> Option<f64> {
let total: f64 = gpus
.iter()
.filter(|g| device_in(&g.device_id, gpu_ids))
.map(|g| f64::from(g.power_w))
.sum();
(total > 0.0).then_some(total)
}

/// Tokens-per-watt for one serving instance: generation throughput (tok/s)
/// divided by the summed power (W) of the GPUs it occupies.
///
Expand Down Expand Up @@ -143,4 +158,30 @@ mod tests {
assert!(!gpu_ids_overlap(&[], &gpus));
assert!(!gpu_ids_overlap(&["0".into()], &[]));
}

#[test]
fn instance_power_sums_matching_gpus() {
let gpus = [
gpu("gpu-0", 200.0),
gpu("gpu-1", 300.0),
gpu("gpu-2", 999.0),
];
// Instance occupies gpus 0 and 1 → 500 W; gpu-2 is excluded.
assert_eq!(
instance_power_w(&["0".into(), "1".into()], &gpus),
Some(500.0)
);
}

#[test]
fn instance_power_no_match_yields_none() {
let gpus = [gpu("gpu-5", 250.0)];
assert_eq!(instance_power_w(&["0".into()], &gpus), None);
}

#[test]
fn instance_power_empty_ids_yields_none() {
let gpus = [gpu("gpu-0", 250.0)];
assert_eq!(instance_power_w(&[], &gpus), None);
}
}
30 changes: 28 additions & 2 deletions crates/rocm-dash-core/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ pub struct Instance {
/// occupies. `None` when throughput or GPU power telemetry is unavailable.
#[serde(default)]
pub tokens_per_watt: Option<f64>,
/// Live average time-to-first-token (ms), windowed from the vLLM TTFT
/// histogram. `None` until two scrapes (or absent for non-vLLM engines);
/// Observe shows `—`. Serde-default for NDJSON replay back-compat.
#[serde(default)]
pub ttft_ms: Option<f64>,
/// Live average time-per-output-token (ms), windowed from the vLLM TPOT
/// histogram. `None` until two scrapes (or absent); Observe shows `—`.
#[serde(default)]
pub tpot_ms: Option<f64>,
pub launch_args: Vec<String>,
pub env_vars: std::collections::BTreeMap<String, String>,
pub log_file: Option<String>,
Expand All @@ -108,8 +117,8 @@ mod tests {

#[test]
fn instance_deserializes_without_efficiency_fields() {
// Replay back-compat: NDJSON sessions recorded before tokens_per_watt
// existed must still load, defaulting the new fields to None.
// Replay back-compat: NDJSON sessions recorded before tokens_per_watt /
// ttft_ms / tpot_ms existed must still load, defaulting them to None.
let legacy = r#"{
"container_id": "c1", "container_name": "vllm-a", "status": "running",
"model_name": "deepseek-r1", "gpu_ids": ["0"], "partition_info": null,
Expand All @@ -121,6 +130,23 @@ mod tests {
let inst: Instance = serde_json::from_str(legacy).expect("legacy instance must parse");
assert_eq!(inst.gen_tps, None);
assert_eq!(inst.tokens_per_watt, None);
assert_eq!(inst.ttft_ms, None);
assert_eq!(inst.tpot_ms, None);
assert_eq!(inst.kv_cache_usage_pct, Some(42.0));
}

#[test]
fn instance_round_trips_ttft_tpot_through_serde() {
// The new live-latency fields survive a serialize → deserialize cycle.
let inst = Instance {
container_id: "c1".into(),
ttft_ms: Some(180.5),
tpot_ms: Some(22.0),
..Default::default()
};
let json = serde_json::to_string(&inst).expect("serialize");
let back: Instance = serde_json::from_str(&json).expect("deserialize");
assert_eq!(back.ttft_ms, Some(180.5));
assert_eq!(back.tpot_ms, Some(22.0));
}
}
15 changes: 15 additions & 0 deletions crates/rocm-dash-core/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ pub struct InstanceSample {
/// Lemonade `/api/v1/stats.tokens_per_second`). vLLM leaves this `None` and
/// uses the `gen_tokens_total` delta path. Plain data — no async/HTTP/render.
pub gen_tps: Option<f64>,
/// Cumulative vLLM `time_to_first_token_seconds_sum` / `_count` histogram
/// readings at scrape time. The runner windows successive readings into
/// `Instance.ttft_ms` (Δsum/Δcount × 1000), mirroring the `gen_tps` path;
/// these raw cumulative values are not stored on `Instance`. `None` for
/// engines that don't expose the histogram.
pub ttft_sum_s: Option<f64>,
pub ttft_count: Option<f64>,
/// Cumulative vLLM `time_per_output_token_seconds_sum` / `_count` histogram
/// readings; windowed into `Instance.tpot_ms` the same way.
pub tpot_sum_s: Option<f64>,
pub tpot_count: Option<f64>,
}

pub trait InstanceMetrics: Send + Sync {
Expand Down Expand Up @@ -135,6 +146,10 @@ pub fn merge_instance(
// is derived at snapshot assembly.
gen_tps: sample.gen_tps,
tokens_per_watt: None,
// Derived at the runner by windowing the sample's cumulative histogram
// readings (mirrors gen_tps); left None at merge time.
ttft_ms: None,
tpot_ms: None,
launch_args: svc.launch_args.clone(),
env_vars: svc.env_vars.clone(),
log_file: svc.log_file.clone(),
Expand Down
42 changes: 41 additions & 1 deletion crates/rocm-dash-daemon/src/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ fn build_sysinfo() -> GpuSystemInfo {
fn build_instances(t_s: f64, seed: &mut u64) -> Vec<Instance> {
CONTAINERS
.iter()
.map(|c| {
.enumerate()
.map(|(idx, c)| {
let kv =
(jitter(seed) - 0.5).mul_add(4.0, osc(t_s, 13.0, c.phase_s, c.kv_mean, c.kv_amp));
let kv = kv.clamp(0.0, 100.0);
Expand Down Expand Up @@ -577,6 +578,19 @@ fn build_instances(t_s: f64, seed: &mut u64) -> Vec<Instance> {
* f64::from(osc(t_s, 19.0, c.phase_s, 180.0, 90.0)))
.max(0.0);

// Synthesize plausible live latency so `rocm dash --demo` shows real
// TTFT/TPOT values: TTFT ~80–360 ms, TPOT ~10–40 ms, oscillating
// with load. The first instance leaves them `None` to exercise the
// honest `—` path (an engine that doesn't expose the histogram).
let (ttft_ms, tpot_ms) = if idx == 0 {
(None, None)
} else {
(
Some(f64::from(osc(t_s, 23.0, c.phase_s, 220.0, 140.0)).max(20.0)),
Some(f64::from(osc(t_s, 11.0, c.phase_s + 3.0, 25.0, 15.0)).max(5.0)),
)
};

Instance {
container_id: c.container_id.into(),
container_name: c.container_name.into(),
Expand All @@ -594,6 +608,8 @@ fn build_instances(t_s: f64, seed: &mut u64) -> Vec<Instance> {
waiting_reqs: Some(waiting),
gen_tps: Some(gen_tps),
tokens_per_watt: None,
ttft_ms,
tpot_ms,
launch_args: c.launch_args.iter().map(|s| (*s).to_string()).collect(),
env_vars,
log_file: Some(format!("/var/log/vllm/{}.log", c.container_name)),
Expand Down Expand Up @@ -633,6 +649,30 @@ fn write_line<W: Write + ?Sized>(w: &mut W, entry: &PersistedEntry) -> anyhow::R
mod tests {
use super::*;

#[test]
fn demo_synthesizes_finite_ttft_tpot_with_one_honest_none() {
// `rocm dash --demo` must show real TTFT/TPOT (Phase 4): the synthesized
// instances carry finite latency, with the first left None to exercise
// the honest `—` path (an engine without the histogram).
let mut seed = 42;
let insts = build_instances(5.0, &mut seed);
assert!(insts.len() >= 2, "need >1 demo instance to test both paths");
assert_eq!(insts[0].ttft_ms, None, "first instance is the honest None");
assert_eq!(insts[0].tpot_ms, None);
for inst in &insts[1..] {
let ttft = inst.ttft_ms.expect("synthesized TTFT");
let tpot = inst.tpot_ms.expect("synthesized TPOT");
assert!(
ttft.is_finite() && ttft > 0.0,
"TTFT finite/positive: {ttft}"
);
assert!(
tpot.is_finite() && tpot > 0.0,
"TPOT finite/positive: {tpot}"
);
}
}

/// Same options must yield byte-identical output (hard invariant).
#[test]
fn deterministic_same_seed_byte_identical() {
Expand Down
Loading
Loading