Skip to content
Open
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
5 changes: 4 additions & 1 deletion kernel_perf_agent/kernel_opt/profiler/ncu_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def load_ncu_metrics(

# Drop the units row (first row often contains units like "%", "inst", etc.)
if len(sub) > 0:
first_row_str = sub.iloc[0].astype(str).str.lower()
# ``.str.lower()`` propagates NaN/pd.NA cells back to float NaN, which
# would crash the ``tok in x`` substring check below. ``fillna("")``
# makes the detection NaN-safe without changing the matching logic.
first_row_str = sub.iloc[0].astype(str).str.lower().fillna("")
unit_tokens = ("%", "inst", "cycle", "block", "register", "register/thread")
if first_row_str.apply(lambda x: any(tok in x for tok in unit_tokens)).any():
sub = sub.iloc[1:].reset_index(drop=True)
Expand Down
Loading