Repository navigation
[HAL] Fix host copies on non-coherent memory - #25342
noahcoolboy wants to merge 1 commit into
Conversation
Several runtime helpers copy through host mappings without the cache maintenance that iree_hal_buffer_map_range requires for memory that is not IREE_HAL_MEMORY_TYPE_HOST_COHERENT: * iree_hal_buffer_map_read did not invalidate its source, unlike iree_hal_buffer_map_write, which flushes its target. * iree_hal_buffer_map_copy flushed its target but did not invalidate its source. * iree_hal_device_transfer_range did not invalidate a mappable source buffer before reading it. * iree_hal_buffer_view_generate_buffer did not flush after its callback wrote through the mapping. The RapidCopySubmit CTS test wrote through a mapping without flushing, so it now flushes as the API requires. Mesa's Vulkan driver for Intel GPUs (ANV) exposes host-visible memory that is cached but not coherent, and the Vulkan HAL allocator picks it for device-local, host-visible buffers. On an Arrow Lake iGPU, six Vulkan CTS tests fail before this change (two intermittently) and pass after it. Assisted-by: Claude Code Signed-off-by: noahcoolboy <46800081+noahcoolboy@users.noreply.github.com>
|
Hello @noahcoolboy 👋 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 policiesIREE 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:
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 guidanceOur 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. If you have any questions, feel free to leave a comment here, or ask away on IREE Discord. Thank you, |
|
@github-actions I understand and accept |
Several runtime helpers copy through host mappings without the cache maintenance that
iree_hal_buffer_map_rangerequires for memory that is notIREE_HAL_MEMORY_TYPE_HOST_COHERENT:iree_hal_buffer_map_readdid not invalidate its source, unlikeiree_hal_buffer_map_write, which flushes its target.iree_hal_buffer_map_copyflushed its target but did not invalidate its source.iree_hal_device_transfer_rangedid not invalidate a mappable source buffer before reading it.iree_hal_buffer_view_generate_bufferdid not flush after its callback wrote through the mapping.The
RapidCopySubmitCTS test wrote through a mapping without flushing, so it now flushes as the API requires.Mesa's Vulkan driver for Intel GPUs (ANV) exposes host-visible memory that is cached but not coherent (
DEVICE_LOCAL | HOST_VISIBLE | HOST_CACHED), and the Vulkan HAL allocator picks it for device-local, host-visible buffers. The GPUs in CI expose coherent host-visible memory, where these paths are no-ops, which is likely why this hasn't shown up there.Tested on an Intel Arrow Lake-H iGPU (device 0x7dd1, Mesa 26.3, Linux 6.18)
CommandBufferCopyBufferTest.CopySubBufferCommandBufferCopyBufferTest.CopyAlignedDisjointRangesWithinSameBufferCommandBufferStressTest.RapidCopySubmitBdaRawSpirvReplayCacheTest.CommandBufferSkipsUnchangedBdaPublicationDispatchReuseTest.MultiDispatchMultiResubmit(BDA)QueueTransferTest.ChainedFillCopyFillAssisted-by: Claude Code