Skip to content

[UR][L0] Add initial USM alloc enqueue API #17112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

kswiecicki
Copy link
Contributor

No description provided.

@EwanC
Copy link
Contributor

EwanC commented Feb 21, 2025

Not sure if you are already collaborating to make sure the work doesn't conflict, but heads up that @Seanst98 is doing in oneapi-src/unified-runtime#2668 and #16900

@kswiecicki
Copy link
Contributor Author

Not sure if you are already collaborating to make sure the work doesn't conflict, but heads up that @Seanst98 is doing in oneapi-src/unified-runtime#2668 and #16900

Yeah, I'm planning on rebasing this PR on the spec changes added by @Seanst98 in #17117. Thanks for the heads up.

@kswiecicki kswiecicki force-pushed the l0-async branch 3 times, most recently from 65d6ceb to 4f128d3 Compare March 11, 2025 15:11
@kswiecicki kswiecicki force-pushed the l0-async branch 2 times, most recently from c7b5030 to c75c5d9 Compare March 12, 2025 11:30
ur_event_handle_t OriginAllocEvent = nullptr;
auto AsyncAlloc =
USMPool->allocateEnqueued(Queue, Device, nullptr, Type, Size);
if (!AsyncAlloc) {
Copy link
Member

Choose a reason for hiding this comment

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

Won't this bypass any limits specified for async pools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say that it's possible since we are caching memory from those pools without really releasing it back to the pool immediately. The implementation would probably need to introduce some restriction for caching based on the pool limits.

@kswiecicki
Copy link
Contributor Author

Since all the changes were reviewed and approved, I've squashed all the changes into a neat single commit.

TODO:
    - Limit the growth of the async freelist
    - Some better way to deallocate allocation events
    - Put a bucket-shaped limit on memory reuse
    (i.e., don't let async alloc reuse objects that are N times bigger
    than request)
    - Elide using inter-object events when possible, and deallocate them alongside
      async alloc output events instead of globally
    - Prune the async freelist if hitting OOM on normal allocations

Co-authored-by: Michał Staniewski <michal.staniewski@intel.com>
Co-authored-by: Piotr Balcer <piotr.balcer@intel.com>
@kswiecicki
Copy link
Contributor Author

@intel/llvm-gatekeepers merge this PR please

@uditagarwal97 uditagarwal97 merged commit 3a3bbe1 into intel:sycl Mar 21, 2025
41 of 43 checks passed
dm-vodopyanov pushed a commit that referenced this pull request May 27, 2025
This PR ports USM alloc enqueue API introduced to L0 adapter in
#17112 to L0 adapter v2.
KornevNikita pushed a commit that referenced this pull request May 27, 2025
Co-authored-by: Michał Staniewski <michal.staniewski@intel.com>
Co-authored-by: Piotr Balcer <piotr.balcer@intel.com>
github-actions bot pushed a commit to oneapi-src/unified-runtime that referenced this pull request May 28, 2025
This PR ports USM alloc enqueue API introduced to L0 adapter in
intel/llvm#17112 to L0 adapter v2.
kbenzie pushed a commit to oneapi-src/unified-runtime that referenced this pull request May 28, 2025
This PR ports USM alloc enqueue API introduced to L0 adapter in
intel/llvm#17112 to L0 adapter v2.
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.

6 participants