Repository navigation
Keep the PTX compilation and pool creation concretely typed - #3445
Merged
Merged
Conversation
`invoke_frozen` isn't inferred, so inspecting the IR it returned was compiled with edges to generic methods (e.g. `setdiff` of an abstract collection), and `ntuple` with a literal count above 10 returns a tuple of unknown length, so the reserved fields of memory pool and texture descriptors were converted with generic `ntuple`/comparison methods. Packages loaded before CUDA.jl that extend those (e.g. ForwardDiff's comparisons) made Julia discard large parts of CUDACore's precompiled code, as memory pools are created on the first allocation. Assert the IR's type and pass the counts as `Val`s.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## tb/invalidations #3445 +/- ##
=====================================================
+ Coverage 28.28% 85.58% +57.30%
=====================================================
Files 190 191 +1
Lines 19229 19468 +239
=====================================================
+ Hits 5438 16661 +11223
+ Misses 13791 2807 -10984 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
CUDA.jl BenchmarksDetails
This comment was automatically generated by workflow using github-action-benchmark. |
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.
Follow-up to #3440. Two more chains that made Julia discard large parts of CUDACore's precompiled code when packages were loaded before CUDA.jl:
invoke_frozen(GPUCompiler.compile, :asm, job)isn't inferred, so inspecting the IR it returns (to determine whether the device runtime is needed) was compiled with edges to generic methods likesetdiffof an abstract collection. This asserts the module's type.ntuple(f, 53)returns a tuple of unknown length (ntupleonly unrolls up to 10 elements), so the reserved bytes ofCUmemPoolPropswere converted toNTuple{53, UInt8}with genericntuple/comparison methods, which ForwardDiff and others invalidate. Memory pools are created on the first allocation, so with ~1500 method instances this was the biggest remaining chain in CUDACore. The same applies to the texture descriptors. This passes the counts asVals.Tested with the core codegen, execution, exceptions, KernelAbstractions, broadcast, array, pool, texture and driver tests. Together with JuliaLLVM/LLVM.jl#703 and the other follow-ups, the first
@cudakernel (plus a broadcast andsum) with DataFrames loaded first goes from 6.42 s on main to 2.76 s, and with ChainRulesCore from 4.02 s to 2.22 s (2.12 s with nothing loaded first), on Julia 1.13 and an RTX 5080.