stormlog.tensorflow

TensorFlow support for Stormlog.

class stormlog.tensorflow.TensorFlowProfiler(device=None)[source]

Bases: object

High-level TensorFlow profiling interface.

Parameters:

device (str | None)

profile_training(model, dataset, epochs=1, steps_per_epoch=None)[source]

Profile model training.

Parameters:
  • model (Any) – TensorFlow model

  • dataset (Any) – Training dataset

  • epochs (int) – Number of epochs

  • steps_per_epoch (int | None) – Steps per epoch

Return type:

None

profile_inference(model, data, batch_size=32)[source]

Profile model inference.

Parameters:
  • model (Any) – TensorFlow model

  • data (Any) – Input data

  • batch_size (int) – Batch size for inference

Return type:

None

get_results()[source]

Get profiling results.

Return type:

Any

reset()[source]

Reset profiler state.

Return type:

None

class stormlog.tensorflow.TFMemoryProfiler(device=None, enable_tensor_tracking=True)[source]

Bases: object

Main TensorFlow Stormlog class.

Parameters:
  • device (str | None)

  • enable_tensor_tracking (bool)

capture_snapshot(name='snapshot')[source]

Capture current memory state.

Parameters:

name (str)

Return type:

MemorySnapshot

profile_function(func)[source]

Decorator to profile function memory usage.

Parameters:

func (Callable[[~P], R])

Return type:

Callable[[~P], R]

profile_context(name='context')[source]

Context manager for profiling code blocks.

Parameters:

name (str)

Return type:

Iterator[None]

start_continuous_profiling(interval=1.0)[source]

Start continuous memory profiling.

Parameters:

interval (float)

Return type:

None

stop_continuous_profiling()[source]

Stop continuous memory profiling.

Return type:

None

get_results()[source]

Get comprehensive profiling results.

Return type:

ProfileResult

reset()[source]

Reset profiler state.

Return type:

None

stormlog.tensorflow.TensorFlowMemoryTracker

alias of MemoryTracker

stormlog.tensorflow.TensorFlowVisualizer

alias of MemoryVisualizer

stormlog.tensorflow.TensorFlowAnalyzer

alias of MemoryAnalyzer

stormlog.tensorflow.TensorFlowGapFinding

alias of GapFinding

stormlog.tensorflow.get_system_info()[source]

Get system and TensorFlow environment information.

Return type:

Dict[str, Any]

Modules

analyzer

TensorFlow Memory Analysis

cli

TensorFlow Stormlog CLI

context_profiler

TensorFlow Context Profiling

diagnose

Diagnostic bundle builder for the TensorFlow Stormlog diagnose command.

profiler

Core TensorFlow Stormlog

tf_env

TensorFlow runtime environment configuration.

tracker

Real-time TensorFlow Memory Tracking

utils

Utility functions for TensorFlow memory profiling.

visualizer

TensorFlow Memory Visualization