EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
422 stars 58 forks source link

Very long compilation times of big kernels #1532

Open jakubMitura14 opened 3 weeks ago

jakubMitura14 commented 3 weeks ago

As suggested by @wsmoses [1] I am adding here the code for executing my kernels where compilation takes a long time. there are two kernels - first takes around 15 minutes, second 54 minutes (earlier I reported couple hours, but current version is faster than what I thought would be the case based on earlier versions) . In the code, kernels are at the very beginning and enzyme definitions at the very end. Kernels are fully unrolled, all functions are copied... as my initial experiments shown that it make compilation faster. If it will be helpful I will supply not unrolled code. I have also tests to check weather kernels are giving correct results. All functions apart from first 2 and last two are just helper functions that are not important for the problem are just needed to get the data for running the kernels. Code is too long to paste it here, Hovewer I prepared a single file with executable code that is available in link below.

https://github.com/jakubMitura14/superVoxelJuliaCode/blob/master/superVoxelJuliaCode/src/old/long_compilation_issue.jl

1)https://discourse.julialang.org/t/ahead-of-time-compilation-in-1-11/115423/3

jakubMitura14 commented 1 week ago

@wsmoses just to keeep track on things , is the code sample I had given is also giving similar compilation times in your case ? Thanks for your time!