Skip to content

[hipFile] Implement execution of submitted batch operations. - #9991

Closed
jordan-turbofish wants to merge 12 commits into
developfrom
users/jpatters/hipfile-batch-submit
Closed

jordan-turbofish wants to merge 12 commits into
developfrom
users/jpatters/hipfile-batch-submit

Conversation

@jordan-turbofish

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

Copy link
Copy Markdown
Contributor

Motivation

This PR implements execution of the submitted batch operations on the thread pool, with some prior cleanup.

Depends on: #9659
Starts at commit: Use camel case for BatchContext methods.

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.

Issue Tracking

Part of:

JIRA ID: AIHIPFILE-65

Test Plan

Unit tests added for new functionality.

Test Result

Tests pass.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Aug 11, 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 (+3 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.

@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-submit branch 3 times, most recently from 82ff617 to 9db5202 Compare August 18, 2026 20:09
@jordan-turbofish
jordan-turbofish marked this pull request as ready for review August 18, 2026 20:10
@jordan-turbofish
jordan-turbofish requested a review from a team as a code owner August 18, 2026 20:10
Copilot AI lite review requested due to automatic review settings August 18, 2026 20:10

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-submit branch from 9db5202 to 6f1caf2 Compare August 19, 2026 19:09
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-submit branch 3 times, most recently from bd8b945 to 5cd0771 Compare August 20, 2026 20:44
… 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.
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-submit branch from 5cd0771 to e4ee53c Compare August 24, 2026 16:07
@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-submit branch from e4ee53c to c6d034f Compare August 25, 2026 20:43

@riley-dixon riley-dixon 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.

Only thing I can think of is adding some system tests if it is not premature.

{
}

namespace batchOperationState {

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.

I don't really think it's necessary, but an idea I thought of here is asking an agent to document a graph here to visualize permissible state transitions. (Feel free to decline and resolve.)

@jordan-turbofish
jordan-turbofish force-pushed the users/jpatters/hipfile-batch-submit branch from c6d034f to 6442cc1 Compare August 31, 2026 16:03
outstanding_ops.insert(pending_ops.begin(), pending_ops.end());

pending_ops.push_back(std::move(op));
for (const auto &op : pending_ops) {
@jordan-turbofish

Copy link
Copy Markdown
Contributor Author

Closed in favor of merging all batch functionality at once in #10430

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.

5 participants