Skip to content

fix(hipfile): Attribute IO stats to the GPU associated with the buffer instead of the currently configured device. - #13657

Merged
zbyrne merged 1 commit into
developfrom
users/zbyrne/hipfile/stats-device-id-fix
Oct 16, 2026
Merged

zbyrne merged 1 commit into
developfrom
users/zbyrne/hipfile/stats-device-id-fix

Conversation

@zbyrne

@zbyrne zbyrne commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

Stats collection for IO ops used the current hip device instead of the one associated with the buffer. This fixes that.

Technical Details

StatsIoTracker passes a device ID down to StatsCollection instead of addIo() and error() calling hipGetDevice()

Issue Tracking

JIRA ID: AIHIPFILE-301

Test Plan

Run unit tests.

Test Result

Tests all pass.

Submission Checklist

Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:16
@zbyrne
zbyrne requested a review from a team as a code owner October 16, 2026 18:16
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/hipfile/src/amd_detail/backend/fallback.cpp, projects/hipfile/src/amd_detail/backend/fastpath.cpp, projects/hipfile/src/amd_detail/stats.cpp, projects/hipfile/src/amd_detail/stats.h, projects/hipfile/test/amd_detail/fastpath.cpp (+2 more); no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

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.

🟡 Changes recommended

Regression tests need to verify device forwarding and counter attribution when the buffer’s GPU differs from the current device.

1 open finding
What changed in this PR

This PR attributes hipfile I/O statistics to the buffer’s GPU rather than the currently selected device.

Changes:

  • Pass explicit device IDs through statistics tracking and collection.
  • Update backend error reporting, mocks, and existing tests.
File Description
projects/​hipfile/​test/​amd_detail/​stats.cpp Pass explicit device IDs in collection tests.
projects/​hipfile/​test/​amd_detail/​mstats.h Update mock statistics signatures.
projects/​hipfile/​test/​amd_detail/​fastpath.cpp Mock the buffer’s GPU ID.
projects/​hipfile/​src/​amd_detail/​stats.h Store and accept device IDs.
projects/​hipfile/​src/​amd_detail/​stats.cpp Record statistics using the supplied device.
projects/​hipfile/​src/​amd_detail/​backend/​fastpath.cpp Attribute completion and errors to the buffer’s GPU.
projects/​hipfile/​src/​amd_detail/​backend/​fallback.cpp Attribute errors to the buffer’s GPU.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…r instead of the currently configured device.
@zbyrne
zbyrne force-pushed the users/zbyrne/hipfile/stats-device-id-fix branch from 8c346c7 to d26e4e3 Compare October 16, 2026 18:29
@zbyrne
zbyrne merged commit 1aa15c3 into develop Oct 16, 2026
207 of 208 checks passed
@zbyrne
zbyrne deleted the users/zbyrne/hipfile/stats-device-id-fix branch October 16, 2026 21:46
systems-assistant Bot pushed a commit to ROCm/hipFile that referenced this pull request Oct 16, 2026
 the buffer instead of the currently configured device.
[rocm-systems] ROCm/rocm-systems#13657 (commit 1aa15c3)
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

pmoutsias-amd added a commit that referenced this pull request Nov 5, 2026
…branch to the (Unreleased) hipFile 0.7.0 section (#14918)

These 4 CHANGELOG entries sit in release sections, but the code was
merged to develop after the `rocm-systems` commit that TheRock
`release/therock-10.2` pins (`ded49fd`), and is not in that commit. This
moves them into `## (Unreleased) hipFile 0.7.0`, under the matching
subsections.

- #13473 (merged 2026-10-15,
and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0
for ROCm 10.2.0` section:
> * MD and LVM software RAID arrays running pass-through personalities
whose member devices are all local NVMe are now fastpath capable, and
`ais-check` reports them as such.
- #13473 (merged 2026-10-15,
and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0
for ROCm 10.2.0` section:
> * `ais-check` no longer reports an LVM parity RAID logical volume
(`raid4`, `raid5`, `raid6`) as fastpath capable.
- #13657 (merged 2026-10-16,
and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0
for ROCm 10.2.0` section:
> * Per-GPU I/O statistics are now attributed to the GPU that owns the
I/O buffer instead of the caller's active HIP device. Previously,
`hipFileGetStatsL3()` and `ais-stats` could report counters against the
wrong GPU when the active device differed from the buffer's device.
- #13862 (merged 2026-10-21,
and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0
for ROCm 10.2.0` section:
> * `hipfile.h` now includes `<time.h>`, which declares the `struct
timespec` used by `hipFileBatchIOGetStatus()`. Previously, C code that
included `<time.h>` after `hipfile.h` got an incompatible pointer type
error or warning when passing a `struct timespec *` to
`hipFileBatchIOGetStatus()`.

Only the CHANGELOG is changed. Version macros are left to the component
owners.

JIRA ID : AIROCDOC-4467
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.

4 participants