Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
742e572
rever previous changes.
xuchen-amd Nov 19, 2025
a841a3a
revert previous changes
xuchen-amd Nov 19, 2025
54bf0ed
use custom file picker
xuchen-amd Nov 19, 2025
4c6f2fe
Update projects/rocprofiler-compute/src/rocprof_compute_tui/widgets/r…
xuchen-amd Nov 21, 2025
e09bcb6
fix redundancy
xuchen-amd Nov 21, 2025
6b76c49
fix css
xuchen-amd Nov 21, 2025
30089d2
improve tui notify messages
xuchen-amd Nov 24, 2025
c6e3787
fix button press WIP
xuchen-amd Nov 25, 2025
af2bdd5
fix recent directories selection
xuchen-amd Nov 25, 2025
dd388fb
account for the odering of widget mounting
xuchen-amd Dec 2, 2025
f23d018
add review changes
xuchen-amd Dec 9, 2025
c001986
Merge branch 'develop' into users/xuchen-amd/tui_lag_fix
xuchen-amd Dec 9, 2025
2b3190b
Merge branch 'develop' into users/xuchen-amd/tui_lag_fix
xuchen-amd Dec 11, 2025
d182572
remove outdated content per review
xuchen-amd Dec 11, 2025
a3a31fd
[SWDEV-488296] Implemented API Performance test case (#1903)
systems-assistant[bot] Dec 11, 2025
bf533c5
[SWDEV-354749] Added CPU Performance Tests (#2173)
SakaSitharammurthy Dec 11, 2025
022b88a
[SWDEV-564696] Structure size mismatch in SOC pstate/XGMI PLPD (#2207)
koushikbillakanti-amd Dec 11, 2025
040cdae
[hip] Docs: Overhaul HW implementation page (#1994)
adeljo-amd Dec 11, 2025
d64eede
SWDEV-548892 - Make declaration of __ockl_fdot2 always available (#2229)
arsenm Dec 11, 2025
f238560
clr: Fix packet batch write logic (#2236)
saleelk Dec 11, 2025
13dc0af
update build rccl-tests infrastructure and add getAlgoProtoChannels s…
habajpai-amd Dec 11, 2025
d59e03a
Revert correcting the VGPR size for GFX 11.5.1 (#2268)
superm1 Dec 11, 2025
fd72235
Handle cpu name having colons (#2155)
mcrnobrn-amd Dec 11, 2025
64f6902
update changelog
xuchen-amd Dec 16, 2025
4ce07b4
move imports as needed
xuchen-amd Dec 16, 2025
872e7df
Merge branch 'develop' into users/xuchen-amd/tui_lag_fix
xuchen-amd Dec 16, 2025
1bcadd7
fix formatting
xuchen-amd Dec 16, 2025
f25d7e8
fix formatting.
xuchen-amd Dec 16, 2025
d4c49bb
Merge branch 'develop' into users/xuchen-amd/tui_lag_fix
xuchen-amd Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/rocprofiler-compute/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs.

* Removed "VL1 Lat" metric for AMD Instinct MI300 series GPUs, due to MI300 series not supporting TCP_TCP_LATENCY_sum counter.

### Optimized

* Improved the responsiveness of menu and dropdown buttons in TUI analyze mode for a smoother user experience.

## ROCm Compute Profiler 3.4.0 for ROCm 7.2.0

### Added
Expand Down
1 change: 0 additions & 1 deletion projects/rocprofiler-compute/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ setuptools python library: MIT
tabulate python library: MIT
textual python library: MIT
textual_plotext python library: MIT
textual-fspicker python library: MIT
tqdm python library: MIT
1 change: 0 additions & 1 deletion projects/rocprofiler-compute/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ sqlalchemy>=2.0.42
tabulate
textual
textual_plotext
textual-fspicker>=0.4.3
Comment thread
xuchen-amd marked this conversation as resolved.
Resolved
Comment thread
xuchen-amd marked this conversation as resolved.
Resolved
tqdm
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Collapsible {
width: 100%;
}

Collapsible>.collapsible--title {
Collapsible >.collapsible--title {
background: $surface-darken-2;
text-style: bold;
}

Collapsible>.collapsible--content {
Collapsible >.collapsible--content {
background: $surface;
}

Expand Down Expand Up @@ -197,26 +197,27 @@ RocprofTUIApp {
}
}

Button {
background: $surface;
color: $text;
min-width: 10;
height: 1;
margin: 0;
padding: 0 1;
Button.menu-item {
background: $accent;
width: 25;
height: 2;
padding: 0 2;
border: none;
width: auto;
align: center middle;
content-align: center middle;
}

Button:hover {
background: $primary-background-lighten-1;
Button.menu-item:hover {
background: $accent-lighten-1;
color: $text-accent;
}

Button.selected {
background: $primary-background;
color: $text-accent;
text-style: bold;
Button.menu-item:focus {
background: $accent-darken-1;
}

Button.menu-item.-active {
background: $accent-darken-2;
}

MenuBar {
Expand All @@ -236,21 +237,56 @@ MenuButton {
background: $surface;
color: $text;
min-width: 10;
height: 1;
height: auto;
padding: 0 1;
border: none;
width: auto;
align: center middle;
content-align: center middle;
}

MenuButton:hover {
background: $primary-background-lighten-1;
color: $text-accent;
}

MenuButton:focus {
background: $primary-background;
}

MenuButton.-active {
background: $primary-background-darken-1;
}

MenuButton.selected {
background: $primary-background;
color: $text-accent;
}

/* InstantButton replacements for menu items */
InstantButton.menu-item {
background: $accent;
width: 25;
height: 2;
padding: 0 2;
border: none;
align: center middle;
content-align: center middle;
}

InstantButton.menu-item:hover {
background: $accent-lighten-1;
color: $text-accent;
}

InstantButton.menu-item:focus {
background: $accent-darken-1;
}

InstantButton.menu-item.-active {
background: $accent-darken-2;
}

#dropdown-container {
width: 100%;
height: auto;
Expand All @@ -260,28 +296,29 @@ DropdownMenu {
background: $accent;
width: auto;
min-width: 20;
padding-top: 1;
padding: 0;
height: auto;
overflow: hidden;
layout: grid;
grid-size: 1 3;
}

#file-dropdown {
margin-left: 0;
}

.menu-item {
background: $accent;
DropdownMenu > * {
width: 1fr;
height: 2; /* makes the widget claim vertical space */
align: center middle; /* makes the widget fill that space */
content-align: center middle; /* centers the label inside the widget */
}

.menu-item:hover {
background: $primary-background-lighten-1;
color: $text-accent;
#file-dropdown {
margin-left: 0;
}

.hidden {
display: none;
}

Terimnal {
Terminal {
layout: vertical;
width: 100%;
height: 100%;
Expand Down Expand Up @@ -312,4 +349,4 @@ Terimnal {
border-title-color: $foreground;
border-title-style: b;
}
}
}
47 changes: 29 additions & 18 deletions projects/rocprofiler-compute/src/rocprof_compute_tui/tui_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

##############################################################################
"""
ROCm Compute Profiler TUI - Main Application with Analysis Methods
Expand All @@ -33,16 +32,13 @@
from pathlib import Path
from typing import Any, Optional

from textual import on, work
from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.widgets import Button, Footer, Header
from textual_fspicker import SelectDirectory
from textual.widgets import Footer, Header

import config
from rocprof_compute_tui.config import APP_TITLE
from rocprof_compute_tui.views.main_view import MainView
from rocprof_compute_tui.widgets.menu_bar.menu_bar import DropdownMenu
from utils.specs import generate_machine_specs
from utils.utils import get_version

Expand Down Expand Up @@ -76,6 +72,7 @@ def __init__(
self.supported_archs = supported_archs or {}
self.soc: dict[str, Any] = {}
self.mspec: Optional[Any] = None
self.mouse = True

def compose(self) -> ComposeResult:
yield Header()
Expand All @@ -84,14 +81,26 @@ def compose(self) -> ComposeResult:

def action_refresh(self) -> None:
self.main_view.refresh_view()
self.notify("View refreshed", severity="information")

def load_soc_specs(self, sysinfo: Optional[dict] = None) -> None:
self.mspec = generate_machine_specs(self.args, sysinfo)
arch = self.mspec.gpu_arch
soc_module = importlib.import_module(f"rocprof_compute_soc.soc_{arch}")
soc_class = getattr(soc_module, f"{arch}_soc")
self.soc[arch] = soc_class(self.args, self.mspec)
try:
self.mspec = generate_machine_specs(self.args, sysinfo)
arch = self.mspec.gpu_arch

soc_module = importlib.import_module(f"rocprof_compute_soc.soc_{arch}")
soc_class = getattr(soc_module, f"{arch}_soc")
self.soc[arch] = soc_class(self.args, self.mspec)

self.notify(f"Loaded system specs for {arch}", severity="information")

except Exception as e:
self.notify(f"Failed to load system specs: {e}", severity="error")
raise

# -------------------------------------------------------------------------
# Recent directories management
# -------------------------------------------------------------------------
def _load_recent_dirs(self) -> list[str]:
recent_file = Path.home() / ".textual_browser_recent.json"
if recent_file.exists():
Expand All @@ -114,14 +123,16 @@ def add_recent_dir(self, directory: str) -> None:
self.recent_dirs = self.recent_dirs[:5]
self._save_recent_dirs()

@on(Button.Pressed, "#menu-open-workload")
@work
async def pick_directory(self) -> None:
if opened := await self.push_screen_wait(SelectDirectory()):
self.add_recent_dir(str(opened))
self.main_view.selected_path = opened
self.query_one("#file-dropdown", DropdownMenu).add_class("hidden")
self.main_view.run_analysis()
def on_recent_selected(self, selected_dir: Optional[str]) -> None:
if not selected_dir:
self.notify("Directory selection cancelled", severity="information")
return

if Path(selected_dir) != self.main_view.selected_path:
self.main_view.selected_path = Path(selected_dir)

self.notify(f"Selected: {selected_dir}", severity="information")
self.main_view.run_analysis()


def run_tui(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
# THE SOFTWARE.

##############################################################################

import argparse
import logging
import threading
from collections.abc import Hashable
from datetime import datetime
from enum import Enum
Expand Down Expand Up @@ -74,16 +76,40 @@ def log(
}
self.logger.log(level_map[log_level], message)

if update_ui and self.output_area and hasattr(self.output_area, "text"):
timestamp = datetime.now().strftime("%H:%M:%S")
formatted_msg = f"[{timestamp}] [{log_level}] {message}"
self.output_area.text = (
f"{self.output_area.text}\n{formatted_msg}"
if self.output_area.text
else formatted_msg
)
if (
not update_ui
or not self.output_area
or not hasattr(self.output_area, "text")
):
return

timestamp = datetime.now().strftime("%H:%M:%S")
formatted_msg = f"[{timestamp}] [{log_level}] {message}"
app = getattr(self.output_area, "app", None)

if app is None or not hasattr(app, "_thread_id"):
# app not ready yet — update immediately (safe during compose)
if self.output_area.text:
self.output_area.text += "\n" + formatted_msg
else:
self.output_area.text = formatted_msg
return

# Detect if we are on UI thread
in_ui_thread = threading.get_ident() == app._thread_id
Comment thread
xuchen-amd marked this conversation as resolved.
Resolved
Comment thread
xuchen-amd marked this conversation as resolved.
Resolved
Comment thread
xuchen-amd marked this conversation as resolved.
Resolved

def _apply() -> None:
if self.output_area.text:
self.output_area.text += "\n" + formatted_msg
else:
self.output_area.text = formatted_msg
self.output_area.cursor_location = (999999, 0)

if in_ui_thread:
_apply()
else:
app.call_from_thread(_apply)

def info(self, message: str, update_ui: bool = True) -> None:
self.log(message, "INFO", update_ui)

Expand Down
Loading
Loading