Skip to content
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

Add tryAcquire to GpuSemaphore #10330

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Conversation

revans2
Copy link
Collaborator

@revans2 revans2 commented Jan 30, 2024

This fixes #10261

Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
@revans2
Copy link
Collaborator Author

revans2 commented Jan 30, 2024

build

@@ -245,6 +259,30 @@ private final class SemaphoreTaskInfo() extends Logging {
}
}

def tryAcquire(semaphore: Semaphore): Boolean = synchronized {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think there are some smarter heuristics to be had if we return the number of waiters when the semaphore cannot be acquired via Either[Int,Boolean] ?

@revans2
Copy link
Collaborator Author

revans2 commented Jan 30, 2024

build

@revans2
Copy link
Collaborator Author

revans2 commented Jan 30, 2024

@jlowe and @gerashegalov please take another look

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

LGTM

@revans2 revans2 merged commit 803e498 into NVIDIA:branch-24.04 Jan 31, 2024
40 checks passed
@revans2 revans2 deleted the GpuSem_try_acquire branch January 31, 2024 15:27
@sameerz sameerz added the performance A performance related task/issue label Jan 31, 2024
sperlingxx pushed a commit to sperlingxx/spark-rapids that referenced this pull request Feb 2, 2024
Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A performance related task/issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants