Skip to content

[hipFile] Implement batch API. - #10430

Merged
jordan-turbofish merged 23 commits into
developfrom
users/jpatters/hipfile-batch-rest
Aug 31, 2026
Merged

jordan-turbofish merged 23 commits into
developfrom
users/jpatters/hipfile-batch-rest

Conversation

@jordan-turbofish

@jordan-turbofish jordan-turbofish commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

This PR implements the batch API.

Technical Details

  • Add a state machine to for the state of each operation. Encodes valid transitions. Invalid transitions throw an error.
  • Moves creation of BatchOperations to the hipFile API layer so that batch code doesn't grab DriverState lock. Avoids possible deadlock issue with future cleanup code called from DriverState.
  • Submits run function to thread pool to execute batch operations. Uses the existing synchronous IO calls.
  • Adds IBatchOperation to allow mocking of batch operations
  • Implements the retrieval of batch operation statuses for operations that have completed
  • Implements cancelation of batch operations
  • Implements destruction of batch contexts
  • Fix nullptr issue in hipFileBatchIOGetStatus
  • Cleanup batch_map when the driver is closed
  • Adds system tests for batch

Issue Tracking

Part of:

JIRA ID: AIHIPFILE-65

Test Plan

Unit tests added for new functionality and system tests added for batch.

Test Result

Tests pass.

Submission Checklist

@jordan-turbofish jordan-turbofish changed the title [hipFile] Implement cancelation and destruction of batch operations. [hipFile] Implement cancelation of batch operations and destruction of batch contexts. Aug 19, 2026
@therock-pr-bot

therock-pr-bot Bot commented Aug 19, 2026 •

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/include/hipfile.h, projects/hipfile/src/amd_detail/batch/batch.cpp, projects/hipfile/src/amd_detail/batch/batch.h, projects/hipfile/src/amd_detail/hipfile-private.h, projects/hipfile/src/amd_detail/hipfile.cpp (+9 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?

@github-advanced-security github-advanced-security 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.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-rest branch 3 times, most recently from 67267d5 to 0d0de55 Compare August 24, 2026 16:09

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

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

Comment thread projects/hipfile/include/hipfile.h Resolved
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-rest branch 4 times, most recently from e6478ed to 8f415ac Compare August 28, 2026 19:19
@github-actions github-actions Bot added the github actions Pull requests that update GitHub Actions code label Aug 28, 2026
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-rest branch 2 times, most recently from e6478ed to c89b5aa Compare August 31, 2026 16:05
@jordan-turbofish
jordan-turbofish marked this pull request as ready for review August 31, 2026 16:07
@jordan-turbofish
jordan-turbofish requested a review from a team as a code owner August 31, 2026 16:07

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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Comment thread projects/hipfile/test/system/batch.cpp Resolved
… versions

Batch operations acquire the IFile and IBuffer before performing the IO.
The IFile / IBuffer version rethrows the HipRuntime error.  We will
convert it to a hipFileDriverError in batch, since HIP errors would
overlap with POXIX errors.
Moves locking of DriverState out of the BatchContext, which could cause
ordering issues when cleanup is done during a hipFileDriverClose.
Consts are removed from the IFile and IBuffer to match usage in hipFileIo.
Enables mocking of the batch operations held by the context.
The mutex is not used in a shared capacity.
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-rest branch from 488afa7 to a4e0595 Compare August 31, 2026 22:15
@jordan-turbofish jordan-turbofish changed the title [hipFile] Implement cancelation of batch operations and destruction of batch contexts. [hipFile] Implement batch API. Aug 31, 2026
@jordan-turbofish
jordan-turbofish merged commit e2430bd into develop Aug 31, 2026
107 of 110 checks passed
@jordan-turbofish
jordan-turbofish deleted the users/jpatters/hipfile-batch-rest branch August 31, 2026 23:04
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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

Labels

github actions Pull requests that update GitHub Actions code organization: ROCm project: hipfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants