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

Ability to freeze compiled kernels #89

Merged
merged 12 commits into from
Oct 7, 2020
Merged

Ability to freeze compiled kernels #89

merged 12 commits into from
Oct 7, 2020

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Sep 29, 2020

I'm told Clima would appreciate this:

$ time jl examples/vadd.jl
julia --color=yes --quiet examples/vadd.jl  17,83s user 0,87s system 100% cpu 18,603 total

$ time JULIA_DEBUG=GPUCompiler JULIA_GPUCOMPILER_DISKCACHE=true jl examples/vadd.jl
JULIA_DEBUG=GPUCompiler JULIA_GPUCOMPILER_FROZEN=true julia --color=yes    19,01s user 0,88s system 98% cpu 20,185 total

$ time JULIA_DEBUG=GPUCompiler JULIA_GPUCOMPILER_DISKCACHE=true jl examples/vadd.jl
┌ Debug: Loading compiled kernel for kernel vadd(CuDeviceArray{Float32,2,1}, CuDeviceArray{Float32,2,1}, CuDeviceArray{Float32,2,1}) from /home/tim/Julia/depot/scratchspaces/61eb1bfa-7361-4325-ad38-22787b887f55/kernels/8468340805782850700.jls
└ @ GPUCompiler ~/Julia/pkg/GPUCompiler/src/cache.jl:51
JULIA_DEBUG=GPUCompiler JULIA_GPUCOMPILER_DISKCACHE=true julia --color=yes    14,57s user 0,98s system 99% cpu 15,630 total

@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #89 into master will decrease coverage by 2.72%.
The diff coverage is 2.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
- Coverage   66.89%   64.16%   -2.73%     
==========================================
  Files          31       20      -11     
  Lines        1637     1387     -250     
==========================================
- Hits         1095      890     -205     
+ Misses        542      497      -45     
Impacted Files Coverage Δ
src/cache.jl 0.00% <0.00%> (ø)
src/reflection.jl 6.38% <ø> (+0.06%) ⬆️
src/GPUCompiler.jl 100.00% <100.00%> (ø)
src/irgen.jl 60.83% <0.00%> (-25.88%) ⬇️
src/validation.jl 84.84% <0.00%> (-4.55%) ⬇️
src/runtime.jl 65.45% <0.00%> (-3.64%) ⬇️
src/precompile.jl 77.14% <0.00%> (-2.86%) ⬇️
src/gcn.jl 68.88% <0.00%> (-2.54%) ⬇️
test/spirv.jl
examples/kernel.jl
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0f686f...a90f7bb. Read the comment docs.

@maleadt
Copy link
Member Author

maleadt commented Sep 29, 2020

cc @jpsamaroo this would change cached_compilation and split the driver argument in two separate phases: compile, returning (serializable) assembly, and linked to perform the run-time link step (if objects are precompilable too, we should maybe rename this, but the fact remains that you only want to load those objects once too).

@jpsamaroo
Copy link
Member

I've implemented support in JuliaGPU/AMDGPU.jl#53, just waiting to see if it passes CI. Otherwise LGTM!

@jpsamaroo
Copy link
Member

This also needs a minor version bump due to API changes.

src/cache.jl Outdated Show resolved Hide resolved
@jpsamaroo
Copy link
Member

With or without kwargs, I'm cool with this.

@maleadt
Copy link
Member Author

maleadt commented Sep 30, 2020

I moved them over as you asked, so it should be fine now?

@maleadt maleadt changed the title RFC: Ability to freeze compiled kernels Ability to freeze compiled kernels Oct 7, 2020
@maleadt maleadt merged commit 4bb076f into master Oct 7, 2020
@maleadt maleadt deleted the tb/freeze branch October 7, 2020 06:25
@maleadt maleadt mentioned this pull request Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants