Skip to content

[HAL] Add runtime support for command_buffer.flush_buffer - #24962

Draft
l0r3m1psum wants to merge 2 commits into
iree-org:mainfrom
l0r3m1psum:hal-command-buffer-flush
Draft

l0r3m1psum wants to merge 2 commits into
iree-org:mainfrom
l0r3m1psum:hal-command-buffer-flush

Conversation

@l0r3m1psum

Copy link
Copy Markdown

This PR adds a new hal.command_buffer.flush_buffer operation together with its implementation as a NOP in all backends. This operation is lowered from stream.cmd.flush which before was simply deleted.

cmd_ops.mlir fails in @cmdFillOnQueue/@cmdCopyOnQueue: an execute region with one fill or copy plus a stream.cmd.flush no longer becomes hal.device.queue.fill/copy, because matchSingleTransferOp no longer ignores flushes. It now records a command buffer (fill, barrier, flush_buffer, barrier). We do not know what is the correct way to rewrite the test.

This PR is in preparation for the real implementation since right now flushing is done implicitly by the runtime future work will remove it and make hal.command_buffer.flush_buffer behave properly.

Part of #24930

Assisted-by: Claude

A new hal.command_buffer.flush_buffer operation has been introduced together with some tests
and transformations for it. Lowering to VM has also bee implemented but the operation is not
exported so some test for the VM fail.

Signed-off-by: Diego Bellani <[email protected]>
…L driver

Now a command_buffer.flush_buffer is exported by the HAL so that the
VM can call this funciton and tests can succed once again.

Add a CTS flush_buffer_test run in direct and indirect modes on all
drivers, and cover recording/replay in the replay execute test.

Signed-off-by: Diego Bellani <[email protected]>
@github-actions

Copy link
Copy Markdown

Hello @l0r3m1psum 👋

Thank you for submitting a Pull Request to IREE! It looks like this is your first one. We have one ask, and you can also find some general tips below.


Action required: acknowledge IREE project policies

IREE is a Linux Foundation project. All participants are expected to follow the LF Projects Code of Conduct.

All contributions to IREE must follow our IREE AI Tool Use Policy. In particular:

  • Contributors must fully understand, and vouch for, all submitted changes and the intent behind them.
  • Substantial use of LLM/generative AI tools must be noted in the PR description, e.g. via Assisted-by: tool-name or Co-authored-by: tool-name tool@email trailers.
  • Contributors must write PR descriptions themselves. There must always be a human in the loop: contributors must respond to reviews and questions by themselves.
    If a response includes LLM-assisted segments (e.g. reproducers, LLM agent analysis excerpts), the segment should be clearly marked as "assisted", same as for PR contents.
  • GitHub issues labeled as "Good first issue" are explicitly designated as learning opportunities for newcomers to the project. With exceptions for boilerplate edits, AI tool usage for resolutions to such issues is forbidden.

We kindly ask you to reply to this message and confirm that you understand and accept the cited policies, particularly the AI Tool Use Policy.


General guidance

Our general Contributing guide contains information and links to detailed guides on code quality, testing, commit summaries and our CI system.

A common point for new PRs: if a DCO signing check fails for you, check out the section on Developer Certificate of Origin.
In these cases, it should suffice to amend your commit signature(s) per the guide and force-push the PR branch.

If you have any questions, feel free to leave a comment here, or ask away on IREE Discord.

Thank you,
The IREE Community

This branch has not been deployed

No deployments
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.

1 participant