Skip to content

[UR][L0] Fix allocation lookup in EnqueuedPool #19638

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

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

staniewzki
Copy link
Contributor

This PR updates the allocation management algorithm to address cases where it fails to find suitable allocations due to how it performs lower bound searches.

Example:

Freelist {
    Allocation(align=64, size=128),
    Allocation(align=64, size=256),
    Allocation(align=4096, size=128),
    Allocation(align=4096, size=1024),
}

If we request align=64, size=512, the current code looks at Allocation(align=4096, size=128) and skips the rest, even though Allocation(align=4096, size=1024) would work.

This PR introduces grouping the allocations by queue and alignment.

@staniewzki staniewzki requested a review from a team as a code owner July 30, 2025 07:22
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

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

lgtm, just one nit.

@@ -43,25 +44,40 @@ class EnqueuedPool {
bool cleanup();
bool cleanupForQueue(void *Queue);

private:
// Allocations are grouped by queue and alignment.
struct AllocationGroupKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be consistent, either use a custom comparator or implement operator< in the key for both types.

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