Repository navigation
GPU on Intel: launches on GPU-resident arrays do not wait (4.6x for small launches) - #1110
Open
ASDAlexander77 wants to merge 1 commit into
Open
ASDAlexander77 wants to merge 1 commit into
ASDAlexander77 wants to merge 1 commit into
Conversation
…DA and HIP (4.6x for small launches) Level Zero's immediate command list was synchronous, so every Intel launch waited for its kernel, where CUDA and HIP queue a launch whose arrays all stay on the GPU (GpuArrays, gpuBatch) and wait where its results are needed. The list is now asynchronous: - each launch is followed by a barrier, as the list runs its commands in any order unless told: what comes after a kernel (another kernel on its arrays, a copy back) waits for it, as on a stream; - a free waits for the list first: zeMemFree does not wait for a kernel still on the memory (cuMemFree and hipFree do), and a GpuArray collected after a launch not waited for would be freed under it; - copies still wait for the list, as before. 2000 small launches on GpuArrays (Core Ultra 9 285K's iGPU): 13 ms, against 63 ms waiting after each. All 26 GPU programs (JIT and exe) and the 11 fault cases pass on Intel. docs/gpu.md says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Intel, a launch whose arrays all stay on the GPU (
GpuArrays, or arrays insidegpuBatch) no longer waits for its kernel, as on CUDA and HIP. Small launches get 4.6x faster.What changes
Before, Level Zero's immediate command list was synchronous, so every Intel launch blocked until its kernel finished. The list is now asynchronous, with these changes in
GpuRuntime.c:cuMemFreeandhipFree,zeMemFreedoes not wait for a kernel still using the memory. Without the wait, aGpuArraycollected right after an un-waited launch would be freed while its kernel ran.docs/gpu.mdno longer says that Intel launches always wait, and it gives the Intel timing below.Measured
2000 small launches on
GpuArrays, on the integrated GPU of a Core Ultra 9 285K:Tests
This branch is cut from
mainand is independent of #1109.🤖 Generated with Claude Code