stormlog.attributed_viz
Stormlog-native memory visualisation with tensor attribution.
Generates a self-contained HTML page that renders an interactive CUDA memory
timeline where every allocation is labelled with its tensor name, shape, and
allocation site — replacing the opaque hex-address chart from PyTorch’s
built-in _memory_viz.trace_plot().
Usage:
from stormlog.attributed_viz import render_attributed_html
html = render_attributed_html(snapshot_dict, tensor_index)
Path("memory_attributed.html").write_text(html)
Functions
|
Generate a self-contained HTML page with attributed memory timeline. |
|
- stormlog.attributed_viz.render_attributed_wandb_preview_html(snapshot, tensor_index, *, device=0, max_timeline_points=480, max_marker_points=80, max_offenders=12, max_active_rows=12)[source]
- Parameters:
snapshot (Any)
tensor_index (Dict[str, Any])
device (int)
max_timeline_points (int)
max_marker_points (int)
max_offenders (int)
max_active_rows (int)
- Return type:
str
- stormlog.attributed_viz.render_attributed_html(snapshot, tensor_index, *, device=0)[source]
Generate a self-contained HTML page with attributed memory timeline.
- Parameters:
snapshot (Any) – The raw dict from
torch.cuda.memory._snapshot()or loaded from the pickle file. Must have"segments"and"device_traces".tensor_index (Dict[str, Any]) – The dict from
build_cuda_tensor_attribution_index().device (int) – The CUDA device index to render.
- Returns:
A complete HTML document string.
- Return type:
str