Skip to content

SWDEV-551979 Fixing kernel filtering gui analyze mode.#2210

Closed
ggottipa-amd wants to merge 6 commits into
developfrom
users/ggottipa-amd/fix-kernel-filtering-gui
Closed

SWDEV-551979 Fixing kernel filtering gui analyze mode.#2210
ggottipa-amd wants to merge 6 commits into
developfrom
users/ggottipa-amd/fix-kernel-filtering-gui

Conversation

@ggottipa-amd

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

JIRA ID

Test Plan

Test Result

Submission Checklist

base_data[base_run].filter_kernel_ids = kernel_ids

base_data[base_run].filter_kernel_ids = (
[str(k) for k in kernel_filter] if kernel_filter else []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need if here

if kernel_filter is empty list it will be automatically handled

just make sure kernel_filter cannot be None

@@ -213,13 +185,24 @@ def generate_from_filter(
for key in base_data[base_run].dfs
if key in basic_dfs_keep
}
base_data[base_run].dfs = filtered_dfs
# base_data[base_run].dfs = filtered_dfs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments of unused code in production code

@vedithal-amd vedithal-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add in motivation section what change we are making and why.
Also let's add testing methodology and make sure we test properly.
We should also add screenshot of UI before and after making this change to better understand the PR

@ggottipa-amd ggottipa-amd force-pushed the users/ggottipa-amd/fix-kernel-filtering-gui branch 2 times, most recently from 68d1fb4 to af57f86 Compare December 11, 2025 12:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes kernel filtering functionality in GUI analyze mode by addressing issues with denominator handling, NaN value processing, and kernel filter type management.

Key Changes:

  • Fixed GRBM_GUI_ACTIVE_PER_XCD denominator reference by removing incorrect $ prefix
  • Enhanced NaN and "N/A" value handling throughout metric evaluation and GUI display
  • Modified kernel filtering to properly handle string kernel names from GUI dropdowns

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
projects/rocprofiler-compute/src/utils/parser.py Fixed denominator key, improved NaN handling in metric evaluation, added case-insensitive field comparison, and added error handling for unsupported normalization units
projects/rocprofiler-compute/src/utils/gui.py Extended filtering conditions to handle "N/A" and None values in chart generation
projects/rocprofiler-compute/src/roofline.py Added fallback figure creation when no kernel data is available
projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_webui.py Modified kernel filter handling to preserve string types from GUI and updated filtered dataframes logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +322 to +323
"""Evaluate a single expression with proper local context."""

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected at the end of this line. This should be removed to maintain clean code formatting.

Suggested change
"""Evaluate a single expression with proper local context."""
"""Evaluate a single expression with proper local context."""

Copilot uses AI. Check for mistakes.
Comment on lines +378 to +380
if 'denom' in expr:
console_warning(f"Evaluated expression '{expr}' with result: {eval_result}")

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console_warning statements should be removed before merging. These appear to be temporary debugging code left in the codebase.

Suggested change
if 'denom' in expr:
console_warning(f"Evaluated expression '{expr}' with result: {eval_result}")

Copilot uses AI. Check for mistakes.
else:
console_error(
f"Normalization unit '{normal_unit}' is not supported. "
"Skiped updating $denom."

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: 'Skiped' should be 'Skipped'.

Suggested change
"Skiped updating $denom."
"Skipped updating $denom."

Copilot uses AI. Check for mistakes.
Comment on lines +538 to +539
if 'denom' in equation_string:
console_error(f"Updated equation with denom:{equation} --> {equation_string}")

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console_error statement should be removed before merging. This appears to be temporary debugging code that logs every equation update with denom.

Suggested change
if 'denom' in equation_string:
console_error(f"Updated equation with denom:{equation} --> {equation_string}")

Copilot uses AI. Check for mistakes.
Comment on lines +156 to +158
console_warning('kernel_filter',kernel_filter)
console_warning('base_data[base_run].filter_kernel_ids',base_data[base_run].filter_kernel_ids)

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console_warning statements should be removed before merging. These appear to be temporary debugging code left to track kernel filter values.

Suggested change
console_warning('kernel_filter',kernel_filter)
console_warning('base_data[base_run].filter_kernel_ids',base_data[base_run].filter_kernel_ids)

Copilot uses AI. Check for mistakes.
if key in basic_dfs_keep
}
base_data[base_run].dfs = filtered_dfs
# base_data[base_run].dfs = filtered_dfs

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is commented out but filtered_dfs is still used later in the code. The assignment to filtered_dfs should either be uncommented or the variable should be renamed to avoid confusion about which dfs object is being used.

Suggested change
# base_data[base_run].dfs = filtered_dfs
base_data[base_run].dfs = filtered_dfs

Copilot uses AI. Check for mistakes.
Comment on lines +353 to +372
# console_warning("Local context keys:",local_expr_context)
# console_warning(f"=== EVAL DEBUG for: {expr} ===")

# if 'raw_pmc_df' in local_expr_context:
# pmc_df = local_expr_context['raw_pmc_df']
# console_warning(f"raw_pmc_df type: {type(pmc_df)}")

# grbm_col = pmc_df['pmc_perf']['GRBM_GUI_ACTIVE']
# console_warning(f"GRBM_GUI_ACTIVE type: {type(grbm_col)}")
# console_warning(f"GRBM_GUI_ACTIVE shape: {getattr(grbm_col, 'shape', 'No shape')}")
# console_warning(f"GRBM_GUI_ACTIVE values: {grbm_col}")
# console_warning("GRBM_GUI_ACTIVE index:",grbm_col.index)
# else:
# console_error("raw_pmc_df not found in local_expr_context.")

# # Print num_xcd
# num_xcd = local_expr_context.get('ammolite__num_xcd')
# console_warning(f"ammolite__num_xcd type: {type(num_xcd)}")
# console_warning(f"ammolite__num_xcd value: {num_xcd}")

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# console_warning("Local context keys:",local_expr_context)
# console_warning(f"=== EVAL DEBUG for: {expr} ===")
# if 'raw_pmc_df' in local_expr_context:
# pmc_df = local_expr_context['raw_pmc_df']
# console_warning(f"raw_pmc_df type: {type(pmc_df)}")
# grbm_col = pmc_df['pmc_perf']['GRBM_GUI_ACTIVE']
# console_warning(f"GRBM_GUI_ACTIVE type: {type(grbm_col)}")
# console_warning(f"GRBM_GUI_ACTIVE shape: {getattr(grbm_col, 'shape', 'No shape')}")
# console_warning(f"GRBM_GUI_ACTIVE values: {grbm_col}")
# console_warning("GRBM_GUI_ACTIVE index:",grbm_col.index)
# else:
# console_error("raw_pmc_df not found in local_expr_context.")
# # Print num_xcd
# num_xcd = local_expr_context.get('ammolite__num_xcd')
# console_warning(f"ammolite__num_xcd type: {type(num_xcd)}")
# console_warning(f"ammolite__num_xcd value: {num_xcd}")

Copilot uses AI. Check for mistakes.
@vedithal-amd

Copy link
Copy Markdown
Contributor

This PR can be closed against #2080

@ggottipa-amd

Copy link
Copy Markdown
Contributor Author

Closing this against #2479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants