Skip to content
Merged
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion kernel_perf_agent/kernel_opt/profiler/ncu_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,18 @@ def load_ncu_metrics(
if not csv_path.exists():
raise FileNotFoundError(f"CSV not found: {csv_path}")

df = pd.read_csv(csv_path, comment="=", low_memory=False)
# Nsight Compute may prepend warnings before the CSV header, for example
# when it cannot deploy section files under HOME. Find the real CSV header
# instead of letting pandas treat a warning line as the column list.
skiprows = 0
with csv_path.open() as f:
for line in f:
stripped = line.lstrip()
if stripped.startswith('"ID",') or stripped.startswith("ID,"):
break
skiprows += 1

df = pd.read_csv(csv_path, skiprows=skiprows, low_memory=False)

metric_cols = list(columns) if columns is not None else METRIC_COLUMNS
keep_cols: List[str] = []
Expand Down
Loading