kempnerpulse.present.history

Per-GPU rolling time-series store and the record→series adapter.

The plot and focus views need short rolling histories of display-unit series (percent, GB/s, W, °C, …) per GPU. HistoryStore is a fixed-capacity ring buffer keyed by (gpu_id, series_key); update_history() reads one batch of ComputedRecord objects, converts canonical values to display units, and pushes them under the keys the views read.

Series keys (the contract the views depend on):

real_util sm_active tensor dram gpu_util gr_active sm_occupancy
fp16 fp32 fp64
tc_hmma tc_imma tc_dfma tc_dmma tc_qmma
memcpy mem_used_pct power gpu_temp
pcie_rx pcie_tx pcie_rxtx nvlink_gbps

Functions

update_history(history, records)

Push one batch of records' display-unit series into history.

Classes

HistoryStore

Fixed-capacity per-(gpu, key) ring buffers of floats.

class kempnerpulse.present.history.HistoryStore[source]

Bases: object

Fixed-capacity per-(gpu, key) ring buffers of floats.

__init__(maxlen=120)[source]
Parameters:

maxlen (int)

push(gpu_id, key, value)[source]

Append value to the (gpu_id, key) series (oldest drops out).

Parameters:
Return type:

None

get(gpu_id, key)[source]

Return the (gpu_id, key) series, or an empty deque if absent.

Parameters:
Return type:

Deque[float]

kempnerpulse.present.history.update_history(history, records)[source]

Push one batch of records’ display-unit series into history.

All conversions to display units happen here: percents come from canonical fractions ×100, NVLink GB/s from canonical bytes/second ÷1e9. A series is skipped (not zero-filled) whenever its canonical source is None.

Parameters:
Return type:

None