Skip to content

[UR][L0V2] implement host-mediated buffer migration fallback#22152

Open
kweronsx wants to merge 1 commit into
intel:syclfrom
kweronsx:fix-pvc-unsupported-feature
Open

[UR][L0V2] implement host-mediated buffer migration fallback#22152
kweronsx wants to merge 1 commit into
intel:syclfrom
kweronsx:fix-pvc-unsupported-feature

Conversation

@kweronsx
Copy link
Copy Markdown
Contributor

@kweronsx kweronsx commented May 28, 2026

When two devices lack P2P access, getDevicePtr() was unconditionally throwing UR_RESULT_ERROR_UNSUPPORTED_FEATURE instead of migrating the buffer through a temporary host allocation. Implement the fallback: copy active-device -> host -> target device, then update activeAllocationDevice.

Issue: URT-1171

@kweronsx kweronsx requested a review from a team as a code owner May 28, 2026 12:34
@kweronsx kweronsx requested a review from Copilot May 28, 2026 12:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the UR_RESULT_ERROR_UNSUPPORTED_FEATURE failure in ur_discrete_buffer_handle_t::getDevicePtr (Level Zero v2 adapter) with a host-mediated migration fallback when peer-to-peer access between the active allocation device and the requested device is unavailable. The fallback allocates a temporary USM host buffer, copies device→host from the active allocation, then host→device into the target allocation via migrateBufferTo, and updates activeAllocationDevice.

Changes:

  • Removes the unconditional throw on the non-P2P path and downgrades the log to DEBUG with a migration message.
  • Adds a temporary USM host allocation (RAII-guarded via usm_unique_ptr_t) and performs source-device→host→target-device copies using synchronousZeCopy and migrateBufferTo.
  • Sets activeAllocationDevice to the target device and returns the offset pointer into the new active allocation.

Comment thread unified-runtime/source/adapters/level_zero/v2/memory.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/memory.cpp Outdated
@kweronsx kweronsx force-pushed the fix-pvc-unsupported-feature branch 2 times, most recently from 116faca to 75ea41d Compare May 29, 2026 10:01
@kweronsx kweronsx requested a review from a team as a code owner May 29, 2026 10:01
@kweronsx kweronsx requested a review from Copilot May 29, 2026 10:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ldorau
Copy link
Copy Markdown
Contributor

ldorau commented May 29, 2026

@kweronsx Rebase on the current sycl branch so that CI builds could start.

@kweronsx kweronsx force-pushed the fix-pvc-unsupported-feature branch from 75ea41d to 6fbeb9d Compare May 29, 2026 10:29
When two devices lack P2P access, getDevicePtr() was unconditionally
throwing UR_RESULT_ERROR_UNSUPPORTED_FEATURE instead of migrating the
buffer through a temporary host allocation. Implement the fallback:
copy active-device -> host -> target device, then update
activeAllocationDevice.

Resumes work on intel#22010
Issue: https://jira.devtools.intel.com/browse/URT-1171
@kweronsx kweronsx force-pushed the fix-pvc-unsupported-feature branch from 6fbeb9d to 1abfeb7 Compare May 29, 2026 10:46
@kweronsx kweronsx requested a review from Copilot May 29, 2026 10:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ldorau ldorau requested a review from Copilot May 29, 2026 11:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ldorau ldorau requested a review from Copilot May 29, 2026 11:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kswiecicki kswiecicki requested a review from Copilot May 29, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

3 participants