[L0] share one immediate CL per hardware queue to eliminate dispatch overhead#1293
Draft
pvelesko wants to merge 1 commit into
Draft
[L0] share one immediate CL per hardware queue to eliminate dispatch overhead#1293pvelesko wants to merge 1 commit into
pvelesko wants to merge 1 commit into
Conversation
1903fa8 to
7b713bf
Compare
…overhead Intel Arc B570 (numQueues=1): zeCommandListAppendLaunchKernel takes ~0.45ms when switching between different immediate CL handles, but only ~0.013ms when reusing the same handle. With N HIP streams each owning a private CL, launching N kernels cost N×0.45ms = 14.4ms at N=32 — identical to OCL's 3.3ms. Fix: CHIPDeviceLevel0 now maintains a SharedImmCLs_ pool keyed by (ordinal<<32|index). All streams that map to the same hardware queue share one CL handle via getOrCreateSharedImmCL(). On B570 (numQueues=1) all streams share one CL → dispatch falls to 32×0.013ms = 0.4ms → perlin-hip N=32: 3.13ms (was 13.97ms), matching OCL at 3.28ms. On multi-queue devices (e.g. PVC numQueues=4) streams get distinct shared CLs per slot, preserving current parallelism behavior. Also fix: - finish() two-flag skip (IsEmptyQueue_ && CmdListInitialized_) to avoid the ~0.4ms zeCommandListHostSynchronize overhead on never-synced CLs - Lazy checkEvents() in getEventFromPool(): only call when pool is exhausted, not on every kernel dispatch
7b713bf to
3cae92f
Compare
Collaborator
Author
|
/run-aurora-ci |
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.
Reduce Level Zero kernel dispatch overhead by sharing a single immediate command list per hardware queue instead of allocating one per submission.