SWDEV-551979 Fixing kernel filtering gui analyze mode.#2210
SWDEV-551979 Fixing kernel filtering gui analyze mode.#2210ggottipa-amd wants to merge 6 commits into
Conversation
| 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 [] |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
remove comments of unused code in production code
vedithal-amd
left a comment
There was a problem hiding this comment.
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
68d1fb4 to
af57f86
Compare
cba5c4b to
76c5be2
Compare
There was a problem hiding this comment.
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.
| """Evaluate a single expression with proper local context.""" | ||
|
|
There was a problem hiding this comment.
Trailing whitespace detected at the end of this line. This should be removed to maintain clean code formatting.
| """Evaluate a single expression with proper local context.""" | |
| """Evaluate a single expression with proper local context.""" |
| if 'denom' in expr: | ||
| console_warning(f"Evaluated expression '{expr}' with result: {eval_result}") | ||
|
|
There was a problem hiding this comment.
Debug console_warning statements should be removed before merging. These appear to be temporary debugging code left in the codebase.
| if 'denom' in expr: | |
| console_warning(f"Evaluated expression '{expr}' with result: {eval_result}") | |
| else: | ||
| console_error( | ||
| f"Normalization unit '{normal_unit}' is not supported. " | ||
| "Skiped updating $denom." |
There was a problem hiding this comment.
Typo in error message: 'Skiped' should be 'Skipped'.
| "Skiped updating $denom." | |
| "Skipped updating $denom." |
| if 'denom' in equation_string: | ||
| console_error(f"Updated equation with denom:{equation} --> {equation_string}") |
There was a problem hiding this comment.
Debug console_error statement should be removed before merging. This appears to be temporary debugging code that logs every equation update with denom.
| if 'denom' in equation_string: | |
| console_error(f"Updated equation with denom:{equation} --> {equation_string}") |
| console_warning('kernel_filter',kernel_filter) | ||
| console_warning('base_data[base_run].filter_kernel_ids',base_data[base_run].filter_kernel_ids) | ||
|
|
There was a problem hiding this comment.
Debug console_warning statements should be removed before merging. These appear to be temporary debugging code left to track kernel filter values.
| console_warning('kernel_filter',kernel_filter) | |
| console_warning('base_data[base_run].filter_kernel_ids',base_data[base_run].filter_kernel_ids) | |
| if key in basic_dfs_keep | ||
| } | ||
| base_data[base_run].dfs = filtered_dfs | ||
| # base_data[base_run].dfs = filtered_dfs |
There was a problem hiding this comment.
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.
| # base_data[base_run].dfs = filtered_dfs | |
| base_data[base_run].dfs = filtered_dfs |
| # 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}") | ||
|
|
There was a problem hiding this comment.
This comment appears to contain commented-out code.
| # 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}") | |
|
This PR can be closed against #2080 |
|
Closing this against #2479 |
Motivation
Technical Details
JIRA ID
Test Plan
Test Result
Submission Checklist