stormlog.tui.app

Interactive Textual TUI for Stormlog.

Functions

run_app()

Entry-point to launch the Textual application.

Classes

GPUMemoryProfilerTUI(*args, **kwargs)

Main Textual application.

stormlog.tui.app.run_app()[source]

Entry-point to launch the Textual application.

Return type:

None

class stormlog.tui.app.GPUMemoryProfilerTUI(*args, **kwargs)[source]

Bases: App

Main Textual application.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

tracker_session: TrackerSession | None
cli_runner: CLICommandRunner
monitor_auto_cleanup: bool
recent_alerts: List[dict[str, Any]]
CSS = '\n    TabbedContent {\n        padding: 1;\n    }\n\n    RichLog {\n        height: 1fr;\n        border: solid gray;\n    }\n\n    Button {\n        margin: 0 1 1 0;\n        height: 5;\n        width: auto;\n        min-width: 16;\n        max-width: 30;\n        padding: 1 3;\n        content-align: center middle;\n        text-style: bold;\n        color: #ffffff;\n        background: $panel;\n    }\n\n    Button.-primary {\n        color: #ffffff;\n        background: $primary;\n        border: solid $primary-lighten-1;\n    }\n\n    Button.-success {\n        color: #ffffff;\n        background: $success;\n        border: solid $success-lighten-1;\n    }\n\n    Button.-warning {\n        color: #000000;\n        background: $warning;\n        border: solid $warning-lighten-1;\n    }\n\n    Button.-error {\n        color: #ffffff;\n        background: $error;\n        border: solid $error-lighten-1;\n    }\n\n    Button:hover {\n        opacity: 0.9;\n    }\n\n    #table-pytorch,\n    #table-tensorflow {\n        height: 12;\n        border: solid gray;\n    }\n\n    #pytorch-tab,\n    #tensorflow-tab {\n        layout: vertical;\n    }\n\n    #cli-tab {\n        layout: vertical;\n        height: 1fr;\n        border: solid gray;\n        padding: 0 1;\n    }\n\n    #cli-buttons-row1,\n    #cli-buttons-row2 {\n        layout: horizontal;\n        content-align: left middle;\n        height: auto;\n        min-height: 6;\n    }\n\n    #cli-buttons-row2 {\n        margin-top: 0;\n        margin-bottom: 1;\n    }\n\n    #cli-runner {\n        layout: horizontal;\n        content-align: left middle;\n        margin: 1 0;\n    }\n\n    #cli-command-input {\n        width: 1fr;\n        padding: 0 1;\n        height: 5;\n    }\n\n    #cli-loader {\n        height: 3;\n    }\n\n    #monitoring-tab {\n        layout: vertical;\n        height: 1fr;\n        border: solid gray;\n        padding: 0 1;\n    }\n\n    #monitor-status {\n        margin-bottom: 1;\n    }\n\n    #monitor-controls-row1,\n    #monitor-controls-row2,\n    #monitor-controls-row3 {\n        layout: horizontal;\n        content-align: left middle;\n        margin-bottom: 1;\n        height: auto;\n        min-height: 6;\n    }\n\n    #monitor-thresholds {\n        layout: horizontal;\n        content-align: left middle;\n        margin-bottom: 1;\n    }\n\n    #monitor-thresholds Label {\n        width: 12;\n    }\n\n    #monitor-thresholds Input {\n        width: 12;\n        margin-right: 1;\n    }\n\n    #monitor-alerts-table {\n        height: 8;\n        border: solid gray;\n        margin-top: 1;\n    }\n\n    #monitor-stats {\n        height: 10;\n        border: solid gray;\n    }\n\n    #monitor-log {\n        height: 1fr;\n        border: solid gray;\n        margin-top: 1;\n    }\n\n    #visualizations-tab {\n        layout: vertical;\n        height: 1fr;\n        border: solid gray;\n        padding: 0 1;\n    }\n\n    #visual-buttons {\n        layout: horizontal;\n        content-align: left middle;\n        margin-bottom: 1;\n        height: auto;\n        min-height: 6;\n        overflow: hidden;\n    }\n\n    #timeline-stats {\n        height: 8;\n        border: solid gray;\n        margin-bottom: 1;\n    }\n\n    #timeline-canvas {\n        border: solid gray;\n        padding: 1;\n    }\n\n    #visual-log {\n        height: 8;\n        border: solid gray;\n        margin-top: 1;\n    }\n\n    #diagnostics-tab {\n        layout: vertical;\n        height: 1fr;\n        border: solid gray;\n        padding: 0 1;\n    }\n\n    #diagnostics-controls-row1,\n    #diagnostics-controls-row2 {\n        layout: horizontal;\n        content-align: left middle;\n        margin-bottom: 1;\n        height: auto;\n        min-height: 6;\n    }\n\n    #diagnostics-path-input,\n    #diagnostics-rank-filter {\n        width: 1fr;\n        margin-right: 1;\n    }\n\n    #diagnostics-rank-table {\n        height: 12;\n        border: solid gray;\n    }\n\n    #diagnostics-timeline-canvas {\n        height: 12;\n        border: solid gray;\n        padding: 1;\n        margin-top: 1;\n    }\n\n    #diagnostics-anomaly-table {\n        height: 8;\n        border: solid gray;\n        margin-top: 1;\n    }\n\n    #diagnostics-log {\n        height: 8;\n        border: solid gray;\n        margin-top: 1;\n    }\n\n    #overview-welcome {\n        border: round $primary;\n        padding: 1;\n        margin: 0 0 1 0;\n        background: $panel;\n        text-align: center;\n        text-style: bold;\n        color: $accent;\n        min-height: 10;\n        content-align: center middle;\n    }\n\n    #welcome-info {\n        border: solid $primary;\n        padding: 2;\n        margin: 0 0 1 0;\n        background: $surface;\n        height: auto;\n        min-height: 15;\n    }\n\n    #welcome-info Markdown {\n        color: $text;\n    }\n\n    #pytorch-profile-controls,\n    #tensorflow-profile-controls {\n        layout: horizontal;\n        content-align: left middle;\n        margin-top: 1;\n        height: auto;\n        min-height: 6;\n    }\n\n    #pytorch-profile-table,\n    #tensorflow-profile-table {\n        height: 12;\n        border: solid gray;\n        margin-top: 1;\n    }\n'
BINDINGS = [('q', 'quit', 'Quit'), ('r', 'refresh_overview', 'Refresh Overview'), ('f', 'focus_log', 'Focus Log'), ('g', 'log_gpumemprof_help', 'gpumemprof info'), ('t', 'log_tfmemprof_help', 'tfmemprof info')]
compose()[source]
Return type:

textual.app.ComposeResult

async action_quit()[source]
Return type:

None

action_refresh_overview()[source]
Return type:

None

action_focus_log()[source]
Return type:

None

action_log_gpumemprof_help()[source]
Return type:

None

action_log_tfmemprof_help()[source]
Return type:

None

async on_button_pressed(event)[source]
Parameters:

event (textual.widgets.Button.Pressed)

Return type:

None

on_data_table_row_selected(event)[source]
Parameters:

event (textual.widgets.DataTable.RowSelected)

Return type:

None

async run_pytorch_sample()[source]
Return type:

None

async run_tensorflow_sample()[source]
Return type:

None

async start_live_tracking()[source]
Return type:

None

stop_live_tracking()[source]
Return type:

None

toggle_auto_cleanup()[source]
Return type:

None

force_cleanup(aggressive=False)[source]
Parameters:

aggressive (bool)

Return type:

None

clear_monitor_log()[source]
Return type:

None

async run_cli_command(command)[source]
Parameters:

command (str)

Return type:

None

async cancel_cli_command()[source]
Return type:

None

async on_input_submitted(event)[source]
Parameters:

event (textual.widgets.Input.Submitted)

Return type:

None

async export_tracker_events(format)[source]
Parameters:

format (str)

Return type:

None

apply_thresholds()[source]
Return type:

None

async refresh_pytorch_profiles()[source]
Return type:

None

async clear_pytorch_profiles()[source]
Return type:

None

async refresh_tensorflow_profiles()[source]
Return type:

None

async clear_tensorflow_profiles()[source]
Return type:

None

refresh_monitoring_panel()[source]
Return type:

None

async refresh_visualizations()[source]
Return type:

None

async generate_visual_plot(format)[source]
Parameters:

format (str)

Return type:

None

async load_diagnostics_live()[source]
Return type:

None

async load_diagnostics_artifacts()[source]
Return type:

None

async refresh_diagnostics()[source]
Return type:

None

async apply_diagnostics_session_selection()[source]
Return type:

None

apply_diagnostics_rank_filter()[source]
Return type:

None

reset_diagnostics_rank_filter()[source]
Return type:

None

log_monitor_message(title, content)[source]
Parameters:
  • title (str)

  • content (str)

Return type:

None

log_visual_message(title, content)[source]
Parameters:
  • title (str)

  • content (str)

Return type:

None

log_diagnostics_message(title, content)[source]
Parameters:
  • title (str)

  • content (str)

Return type:

None

log_message(title, content)[source]
Parameters:
  • title (str)

  • content (str)

Return type:

None

async on_mount()[source]
Return type:

None