Repository navigation
Conversation
The closure that `zefunction` passed to `GPUCompiler.cached_lookup`, and the functions that lock and take ownership of the memory a launch uses, were specialized on types that depend on the kernel's, so every new kernel compiled them again. Link the kernel with a callable struct instead, and don't specialize `with_managed_locks` and `with_ownership` on the operation they perform. On an Arc A770 with Julia 1.13, this reduces launching a second new kernel from 85 to 57 ms.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
==========================================
- Coverage 86.79% 86.63% -0.17%
==========================================
Files 55 55
Lines 5068 5013 -55
==========================================
- Hits 4399 4343 -56
- Misses 669 670 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Launching a kernel with a new signature compiled host code that doesn't depend on the signature:
zefunctionpassed a closure toGPUCompiler.cached_lookupwhose type includes the kernel's function and argument types, andwith_managed_locks/with_ownershipwere specialized on the operation they run, which is a different closure for every kernel (and for every copy). This links kernels through a callable struct instead, and doesn't specialize the two memory helpers on the operation, using a struct rather than a closure for the ownership transfer.On an Arc A770 with Julia 1.13, launching a second new kernel takes 57-60 instead of 85 ms, without a measurable change in warm launch time. The launch specialization test now also covers these functions; it fails on main (their specializations go from 5 to 20 over six new kernels).