stormlog.visualizer

Visualization tools for GPU memory profiling data.

Classes

MemoryVisualizer([profiler])

Comprehensive visualization tool for memory profiling data.

class stormlog.visualizer.MemoryVisualizer(profiler=None)[source]

Bases: object

Comprehensive visualization tool for memory profiling data.

Parameters:

profiler (GPUMemoryProfiler | None)

plot_memory_timeline(results=None, snapshots=None, save_path=None, interactive=True)[source]

Plot memory usage over time.

Parameters:
  • results (List[ProfileResult] | None) – List of ProfileResults to plot

  • snapshots (List[MemorySnapshot] | None) – List of MemorySnapshots to plot

  • save_path (str | None) – Path to save the plot

  • interactive (bool) – Whether to create interactive plot

Returns:

Matplotlib or Plotly figure

Return type:

matplotlib.pyplot.Figure | plotly.graph_objects.Figure

plot_cross_rank_timeline(events, save_path=None)[source]

Plot a merged, aligned cross-rank device-memory timeline.

Parameters:
Return type:

matplotlib.pyplot.Figure

plot_function_comparison(results=None, metric='memory_allocated', save_path=None, interactive=True)[source]

Compare memory usage across different functions.

Parameters:
  • results (List[ProfileResult] | None) – List of ProfileResults to compare

  • metric (str) – Metric to compare (‘memory_allocated’, ‘execution_time’, ‘peak_memory’)

  • save_path (str | None) – Path to save the plot

  • interactive (bool) – Whether to create interactive plot

Returns:

Matplotlib or Plotly figure

Return type:

matplotlib.pyplot.Figure | plotly.graph_objects.Figure

plot_memory_heatmap(results=None, save_path=None)[source]

Create a heatmap showing memory usage patterns.

Parameters:
  • results (List[ProfileResult] | None) – List of ProfileResults to analyze

  • save_path (str | None) – Path to save the plot

Returns:

Matplotlib figure

Return type:

matplotlib.pyplot.Figure

create_dashboard(results=None, snapshots=None, save_path=None)[source]

Create a comprehensive dashboard with multiple visualizations.

Parameters:
  • results (List[ProfileResult] | None) – List of ProfileResults

  • snapshots (List[MemorySnapshot] | None) – List of MemorySnapshots

  • save_path (str | None) – Path to save the dashboard

Returns:

Plotly figure with subplots

Return type:

plotly.graph_objects.Figure

export_data(results=None, snapshots=None, format='csv', save_path='memory_profile_data')[source]

Export profiling data to various formats.

Parameters:
  • results (List[ProfileResult] | None) – List of ProfileResults to export

  • snapshots (List[MemorySnapshot] | None) – List of MemorySnapshots to export

  • format (str) – Export format (‘csv’, ‘json’, ‘excel’)

  • save_path (str) – Base path for saved files

Returns:

Path to saved file

Return type:

str

show(fig)[source]

Display a figure.

Parameters:

fig (matplotlib.pyplot.Figure | plotly.graph_objects.Figure)

Return type:

None