MCPcopy Create free account
hub / github.com/RL-Align/RL-Kernel / print_panel

Method print_panel

scripts/run_perf.py:19–39  ·  view source on GitHub ↗
(metrics: Dict[str, Any])

Source from the content-addressed store, hash-verified

17class PerfReport:
18 @staticmethod
19 def print_panel(metrics: Dict[str, Any]):
20 print(f"\n\t{metrics['tip']}")
21 print(f"{'============ RL-Kernel Serving Benchmark ============':^60}")
22 PerfReport._row("Hardware Device", metrics["device"])
23 PerfReport._row("Model Architecture", f"Vocab={metrics['vocab']}, Seq={metrics['seq']}")
24 PerfReport._row("Dtype Precision", str(metrics["dtype"]))
25
26 print(f"{'---------------Throughput & Efficiency----------------':^60}")
27 PerfReport._row("Max VRAM Reduction (GB)", f"{metrics['vram_saved']:.2f}")
28 PerfReport._row("Logp Compute Speedup", f"{metrics['logp_speedup']}")
29 PerfReport._row("Sampling Speedup (Fused)", f"{metrics['sample_speedup']}")
30
31 print(f"{'---------------Latency Statistics (ms)----------------':^60}")
32 PerfReport._row("Mean Logp Latency", f"{metrics['avg_logp_ms']:.2f}")
33 PerfReport._row("Mean Sampling Latency", f"{metrics['avg_sample_ms']:.2f}")
34 PerfReport._row("Zero-Copy Sync Latency", f"{metrics['sync_ms']:.4f}")
35
36 status = "PASSED (Industrial Grade)" if metrics["sync_ms"] < 100 else "OPTIMIZATION NEEDED"
37 PerfReport._row("System Sync Status", status)
38
39 print("=" * 60)
40
41 @staticmethod
42 def _row(key: str, value: Any):

Callers 1

mainFunction · 0.80

Calls 1

_rowMethod · 0.80

Tested by

no test coverage detected