Skip to content

fix(rdc): address CPX review feedback and SPX partition-count quirk#8531

Open
brichang wants to merge 1 commit into
ROCm:users/dgalants/rdc-cpx-and-profiler-sample-timefrom
brichang:brichang/rdc-8526-copilot-fixes
Open

fix(rdc): address CPX review feedback and SPX partition-count quirk#8531
brichang wants to merge 1 commit into
ROCm:users/dgalants/rdc-cpx-and-profiler-sample-timefrom
brichang:brichang/rdc-8526-copilot-fixes

Conversation

@brichang

Copy link
Copy Markdown

Targets users/dgalants/rdc-cpx-and-profiler-sample-time to fold into #8526.

Summary

Addresses the Copilot review comments on #8526 plus an amdsmi SPX quirk found while validating on MI308X:

  • SmiUtils::get_processor_handle_from_id: reject a null out-pointer (comment 1).
  • SmiUtils::get_num_partition: decode the entity index so both bare flat indices and CPX partition-instance entity indices resolve to the right socket; callers in RdcMetricFetcherImpl and RdcGroupSettingsImpl now pass the full entity index instead of info.device_index (comments 2/4/5).
  • RdcMetricFetcherImpl RDC_FI_GPU_COUNT: surface an SMI error instead of silently reporting 0 when the flat GPU table is empty (comment 3).
  • RdcRocpBase::map_entity_to_profiler: also register the encoded partition-instance entity index so CPX partition lookups resolve (comment 6).
  • RdcRocpBase.h: correct the stale "10ms default window" comment (low-confidence note).
  • get_num_partition robustness: some drivers return the current accelerator partition profile with num_partitions set to UINT32_MAX in SPX even on success; fall back to the flat-table socket count.

Test plan

Validated on MI308X (ROCm 7.2.1), built with -DBUILD_PROFILER=ON -DBUILD_TESTS=ON:

  • rdc_codec_tests: 5/5 pass.
  • rdc_unit_tests (hardware): 7/7 pass in SPX (get_num_partition=1/socket) and CPX (get_num_partition=4/socket).
  • rdci discovery: 8 GPUs in SPX, 32 in CPX.
  • rdci dmon FLOPS_32: attributes only to the loaded GPU (SPX, ~27.5 GFLOP/ms) / partition (CPX partition 0, ~6.8 GFLOP/ms), stable across samples, with no entity_to_prof_map lookup errors.

Fixes for #8529.

Signed-off-by: Brian Chang brichang@amd.com

Resolve the Copilot review comments on PR ROCm#8526:
- SmiUtils get_processor_handle_from_id: reject a null out-pointer.
- SmiUtils get_num_partition: decode the entity index so both bare flat
  indices and CPX partition-instance entity indices resolve to the right
  socket; pass the full entity index from RdcMetricFetcherImpl and
  RdcGroupSettingsImpl instead of info.device_index.
- RdcMetricFetcherImpl RDC_FI_GPU_COUNT: surface an SMI error instead of
  silently reporting 0 when the flat GPU table is empty.
- RdcRocpBase map_entity_to_profiler: also register the encoded
  partition-instance entity index so CPX partition lookups resolve.
- RdcRocpBase.h: correct the stale 10ms default-window comment.

Also make get_num_partition robust to drivers that return the current
accelerator partition profile with num_partitions set to an invalid
sentinel (UINT32_MAX) in SPX: fall back to the flat-table socket count.

Validated on MI308X (ROCm 7.2.1), SPX and CPX: rdc_unit_tests and
rdc_codec_tests pass; rdci discovery reports 8 (SPX) / 32 (CPX) GPUs;
FLOPS_32 attributes to the correct GPU/partition with no
entity_to_prof_map lookup errors.

Signed-off-by: Brian Chang <brichang@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant