Skip to content

Metrix Updates for Omnipilot#161

Merged
mawad-amd merged 7 commits into
muhaawad/metrix-cleanfrom
colramos/metrix-for-omnipilot
Dec 2, 2025
Merged

Metrix Updates for Omnipilot#161
mawad-amd merged 7 commits into
muhaawad/metrix-cleanfrom
colramos/metrix-for-omnipilot

Conversation

@coleramos425

Copy link
Copy Markdown
Collaborator

This PR patches issues I encountered in the current Metrix implementation as well as adding new functionality for compatibility with the Omnipilot optimization pipeline.

Key Changes:

  • Adds compute metrics (i.e. Total FLOPs, Arithmetic Intensity, etc.) to support the kernel analysis in Omnipilot. New PyTest cases added to cover this new functionality.
  • Improves existing memory metrics (i.e. HBM BW, Utilization, bytes transferred, etc.) by differentiating 32B vs. 64B vs. 128B requests as well as adding new metrics for L1 and L2 Bytes Transferred for consistency with HBM. Added detailed PyTest cases to reflect this.
  • Improves the CLI interaction by querying "required hardware counters" directly from the backend arch file as opposed to stale catalog entries which change between architectures.
  • Fixes lingering issues in PyTest implementation (i.e. outdated CLI options) as well as tuning HBM and latency test thresholds to account for improved measurements

PyTest Results ✅

After integration, I ran the PyTest suite and now see 100% passing for MI300X - an improvement from baseline.

Results
(metrix) [colramos@TheraC16 metrix]$ python3 -m pytest tests/ -v
====================================================================================================================== test session starts =======================================================================================================================
platform linux -- Python 3.12.12, pytest-9.0.1, pluggy-1.6.0 -- /home/colramos/miniconda3/envs/metrix/bin/python3
cachedir: .pytest_cache
rootdir: /home/colramos/GitHub/intelliperf/src/metrix
configfile: pytest.ini
collected 87 items                                                                                                                                                                                                                                               

tests/integration/test_all_metrics_displayed.py::test_all_memory_metrics_are_displayed PASSED                                                                                                                                                              [  1%]
tests/integration/test_all_metrics_displayed.py::test_bandwidth_metrics_have_values PASSED                                                                                                                                                                 [  2%]
tests/integration/test_all_metrics_displayed.py::test_all_compute_metrics_are_displayed PASSED                                                                                                                                                             [  3%]
tests/integration/test_all_metrics_displayed.py::test_json_output_has_memory_metrics PASSED                                                                                                                                                                [  4%]
tests/integration/test_all_metrics_displayed.py::test_json_output_has_compute_metrics PASSED                                                                                                                                                               [  5%]
tests/integration/test_cli_integration.py::test_cli_time_only PASSED                                                                                                                                                                                       [  6%]
tests/integration/test_cli_integration.py::test_cli_time_only_aggregated PASSED                                                                                                                                                                            [  8%]
tests/integration/test_cli_integration.py::test_cli_with_metric PASSED                                                                                                                                                                                     [  9%]
tests/integration/test_cli_integration.py::test_cli_with_metric_aggregated PASSED                                                                                                                                                                          [ 10%]
tests/integration/test_cli_integration.py::test_cli_list_metrics PASSED                                                                                                                                                                                    [ 11%]
tests/integration/test_cli_integration.py::test_cli_list_metrics_includes_compute PASSED                                                                                                                                                                   [ 12%]
tests/integration/test_cli_integration.py::test_cli_list_profiles_includes_compute PASSED                                                                                                                                                                  [ 13%]
tests/integration/test_cli_integration.py::test_cli_compute_profile PASSED                                                                                                                                                                                 [ 14%]
tests/integration/test_cli_integration.py::test_cli_compute_metric_directly PASSED                                                                                                                                                                         [ 16%]
tests/unit/backends/test_decorator.py::test_metric_decorator_extracts_counters PASSED                                                                                                                                                                      [ 17%]
tests/unit/backends/test_decorator.py::test_metric_decorator_skips_self PASSED                                                                                                                                                                             [ 18%]
tests/unit/backends/test_decorator.py::test_metric_decorator_wrapper_extracts_from_raw_data PASSED                                                                                                                                                         [ 19%]
tests/unit/backends/test_decorator.py::test_metric_decorator_handles_missing_counters PASSED                                                                                                                                                               [ 20%]
tests/unit/backends/test_decorator.py::test_metric_decorator_preserves_original_function PASSED                                                                                                                                                            [ 21%]
tests/unit/backends/test_gfx942_metrics.py::TestL2HitRate::test_perfect_hit_rate PASSED                                                                                                                                                                    [ 22%]
tests/unit/backends/test_gfx942_metrics.py::TestL2HitRate::test_zero_hit_rate PASSED                                                                                                                                                                       [ 24%]
tests/unit/backends/test_gfx942_metrics.py::TestL2HitRate::test_fifty_percent_hit_rate PASSED                                                                                                                                                              [ 25%]
tests/unit/backends/test_gfx942_metrics.py::TestL2HitRate::test_no_accesses PASSED                                                                                                                                                                         [ 26%]
tests/unit/backends/test_gfx942_metrics.py::TestCoalescingEfficiency::test_perfect_coalescing PASSED                                                                                                                                                       [ 27%]
tests/unit/backends/test_gfx942_metrics.py::TestCoalescingEfficiency::test_poor_coalescing PASSED                                                                                                                                                          [ 28%]
tests/unit/backends/test_gfx942_metrics.py::TestCoalescingEfficiency::test_mixed_read_write PASSED                                                                                                                                                         [ 29%]
tests/unit/backends/test_gfx942_metrics.py::TestCoalescingEfficiency::test_no_memory_instructions PASSED                                                                                                                                                   [ 31%]
tests/unit/backends/test_gfx942_metrics.py::TestLDSBankConflicts::test_no_conflicts PASSED                                                                                                                                                                 [ 32%]
tests/unit/backends/test_gfx942_metrics.py::TestLDSBankConflicts::test_high_conflicts PASSED                                                                                                                                                               [ 33%]
tests/unit/backends/test_gfx942_metrics.py::TestLDSBankConflicts::test_no_lds_instructions PASSED                                                                                                                                                          [ 34%]
tests/unit/backends/test_gfx942_metrics.py::TestBandwidthMetrics::test_hbm_read_bandwidth_64b_only PASSED                                                                                                                                                  [ 35%]
tests/unit/backends/test_gfx942_metrics.py::TestBandwidthMetrics::test_hbm_read_bandwidth_mixed_sizes PASSED                                                                                                                                               [ 36%]
tests/unit/backends/test_gfx942_metrics.py::TestBandwidthMetrics::test_hbm_write_bandwidth_64b_only PASSED                                                                                                                                                 [ 37%]
tests/unit/backends/test_gfx942_metrics.py::TestBandwidthMetrics::test_hbm_write_bandwidth_mixed_sizes PASSED                                                                                                                                              [ 39%]
tests/unit/backends/test_gfx942_metrics.py::TestBandwidthMetrics::test_zero_active_cycles PASSED                                                                                                                                                           [ 40%]
tests/unit/backends/test_gfx942_metrics.py::TestAtomicLatency::test_low_latency PASSED                                                                                                                                                                     [ 41%]
tests/unit/backends/test_gfx942_metrics.py::TestAtomicLatency::test_high_latency PASSED                                                                                                                                                                    [ 42%]
tests/unit/backends/test_gfx942_metrics.py::TestAtomicLatency::test_no_atomics PASSED                                                                                                                                                                      [ 43%]
tests/unit/backends/test_gfx942_metrics.py::TestMetricDiscovery::test_discovers_all_metrics PASSED                                                                                                                                                         [ 44%]
tests/unit/backends/test_gfx942_metrics.py::TestMetricDiscovery::test_get_required_counters PASSED                                                                                                                                                         [ 45%]
tests/unit/backends/test_gfx942_metrics.py::TestMetricDiscovery::test_discovers_compute_metrics PASSED                                                                                                                                                     [ 47%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_total_flops_fp32_add PASSED                                                                                                                                                           [ 48%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_total_flops_fma_counts_double PASSED                                                                                                                                                  [ 49%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_total_flops_mfma_high_throughput PASSED                                                                                                                                               [ 50%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_total_flops_mixed_precision PASSED                                                                                                                                                    [ 51%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_total_flops_zero PASSED                                                                                                                                                               [ 52%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_hbm_gflops_calculation PASSED                                                                                                                                                         [ 54%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_hbm_gflops_zero_time PASSED                                                                                                                                                           [ 55%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_hbm_arithmetic_intensity PASSED                                                                                                                                                       [ 56%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_hbm_arithmetic_intensity_zero_bytes PASSED                                                                                                                                            [ 57%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_l2_arithmetic_intensity PASSED                                                                                                                                                        [ 58%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_l2_arithmetic_intensity_zero_bytes PASSED                                                                                                                                             [ 59%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_l1_arithmetic_intensity PASSED                                                                                                                                                        [ 60%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_l1_arithmetic_intensity_zero_bytes PASSED                                                                                                                                             [ 62%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_high_arithmetic_intensity_compute_bound PASSED                                                                                                                                        [ 63%]
tests/unit/backends/test_gfx942_metrics.py::TestComputeMetrics::test_low_arithmetic_intensity_memory_bound PASSED                                                                                                                                          [ 64%]
tests/unit/test_api.py::TestMetrixInit::test_init_default PASSED                                                                                                                                                                                           [ 65%]
tests/unit/test_api.py::TestMetrixInit::test_init_custom_arch PASSED                                                                                                                                                                                       [ 66%]
tests/unit/test_api.py::TestMetrixMetricListing::test_list_metrics PASSED                                                                                                                                                                                  [ 67%]
tests/unit/test_api.py::TestMetrixMetricListing::test_list_metrics_includes_compute PASSED                                                                                                                                                                 [ 68%]
tests/unit/test_api.py::TestMetrixMetricListing::test_list_profiles PASSED                                                                                                                                                                                 [ 70%]
tests/unit/test_api.py::TestMetrixMetricListing::test_list_profiles_includes_compute PASSED                                                                                                                                                                [ 71%]
tests/unit/test_api.py::TestMetrixMetricListing::test_get_metric_info PASSED                                                                                                                                                                               [ 72%]
tests/unit/test_api.py::TestMetrixMetricListing::test_get_compute_metric_info PASSED                                                                                                                                                                       [ 73%]
tests/unit/test_api.py::TestMetrixMetricListing::test_get_arithmetic_intensity_info PASSED                                                                                                                                                                 [ 74%]
tests/unit/test_api.py::TestMetrixMetricListing::test_get_unknown_metric_raises PASSED                                                                                                                                                                     [ 75%]
tests/unit/test_api.py::TestKernelResults::test_create_kernel_results PASSED                                                                                                                                                                               [ 77%]
tests/unit/test_api.py::TestProfilingResults::test_create_profiling_results PASSED                                                                                                                                                                         [ 78%]
tests/unit/test_error_handling.py::TestMissingExecutable::test_missing_executable_error_message PASSED                                                                                                                                                     [ 79%]
tests/unit/test_error_handling.py::TestMissingExecutable::test_wrong_path_error_message PASSED                                                                                                                                                             [ 80%]
tests/unit/test_error_handling.py::TestInvalidArguments::test_invalid_metric_name PASSED                                                                                                                                                                   [ 81%]
tests/unit/test_error_handling.py::TestInvalidArguments::test_invalid_architecture PASSED                                                                                                                                                                  [ 82%]
tests/unit/test_error_handling.py::TestTimeoutHandling::test_respects_timeout_setting PASSED                                                                                                                                                               [ 83%]
tests/unit/test_error_handling.py::TestTimeoutHandling::test_default_timeout PASSED                                                                                                                                                                        [ 85%]
tests/unit/test_error_handling.py::TestBackendValidation::test_get_available_metrics PASSED                                                                                                                                                                [ 86%]
tests/unit/test_error_handling.py::TestBackendValidation::test_get_required_counters PASSED                                                                                                                                                                [ 87%]
tests/unit/test_error_handling.py::TestMetricComputation::test_division_by_zero_handling PASSED                                                                                                                                                            [ 88%]
tests/unit/test_error_handling.py::TestMetricComputation::test_negative_values_handling PASSED                                                                                                                                                             [ 89%]
tests/unit/test_rocprof_wrapper.py::TestProfileResult::test_create_profile_result PASSED                                                                                                                                                                   [ 90%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_wrapper_creation PASSED                                                                                                                                                                     [ 91%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_create_input_file PASSED                                                                                                                                                                    [ 93%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_parse_csv_row PASSED                                                                                                                                                                        [ 94%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_parse_csv_row_with_3d_grid PASSED                                                                                                                                                           [ 95%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_parse_output_csv SKIPPED (rocprofv3 format changed - covered by integration tests)                                                                                                          [ 96%]
tests/unit/test_rocprof_wrapper.py::TestROCProfV3Wrapper::test_parse_missing_optional_fields PASSED                                                                                                                                                        [ 97%]
tests/unit/test_rocprof_wrapper.py::TestCSVParsingRobustness::test_handle_non_numeric_counter_values PASSED                                                                                                                                                [ 98%]
tests/unit/test_rocprof_wrapper.py::TestCSVParsingRobustness::test_grid_size_formats PASSED                                                                                                                                                                [100%]

===================================================================================================== 86 passed, 1 skipped, 12 warnings in 64.77s (0:01:04) ======================================================================================================

Signed-off-by: coleramos425 <colramos@amd.com>
Signed-off-by: coleramos425 <colramos@amd.com>
…B requests (Note: 128B is a new addition for Mi300 HBM Rd)

Signed-off-by: coleramos425 <colramos@amd.com>
…backend arch file, not the stale derived_from property in catalog

Signed-off-by: coleramos425 <colramos@amd.com>
Signed-off-by: coleramos425 <colramos@amd.com>
- timing-only should return an empty list for perfmon collection
- The --verbose option is no longer used
- Use --num-replays instead of --runs

Signed-off-by: coleramos425 <colramos@amd.com>
…ore detailed HBM tests

Signed-off-by: coleramos425 <colramos@amd.com>

@mawad-amd mawad-amd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Compute was on my TODOs, thanks for adding it! I noticed there are some inconsistencies in naming e.g., _hbm_gflops and _bytes_transferred_l2. I think it should be _LEVEL_METRIC_ everywhere but that's from before. I will fix it later. Just FYI, I may break some of these APIs naming-wise when I merge in main/move this somewhere else.

@mawad-amd mawad-amd merged commit 3815316 into muhaawad/metrix-clean Dec 2, 2025
4 of 6 checks passed
@mawad-amd mawad-amd deleted the colramos/metrix-for-omnipilot branch December 2, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants