-
Notifications
You must be signed in to change notification settings - Fork 22
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
Create CUDA extension #259
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8a42cef
Create CUDA extension
devmotion 3a3fc7f
Add note about loading CUDA.jl to the docs
devmotion fd64c3f
Add missing name qualifications
devmotion 437b27d
More fixes
devmotion 1c391a8
Make Documenter happy
devmotion adfacca
Apply suggestions from code review
devmotion c76e1e3
Fix another `predict!`
devmotion 6d33c71
Change order of sections in Project.toml
devmotion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module EvoTreesCUDAExt | ||
|
||
using EvoTrees | ||
using CUDA | ||
|
||
# This should be different on CPUs and GPUs | ||
EvoTrees.device_ones(::Type{<:EvoTrees.GPU}, ::Type{T}, n::Int) where {T} = CUDA.ones(T, n) | ||
EvoTrees.device_array_type(::Type{<:EvoTrees.GPU}) = CuArray | ||
function EvoTrees.post_fit_gc(::Type{<:EvoTrees.GPU}) | ||
GC.gc(true) | ||
CUDA.reclaim() | ||
end | ||
|
||
include("loss.jl") | ||
include("eval.jl") | ||
include("predict.jl") | ||
include("init.jl") | ||
include("subsample.jl") | ||
include("fit-utils.jl") | ||
include("fit.jl") | ||
|
||
end # module |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Julia's formatter, it appears that expected order of project keys to be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on the Julia version you use: On Julia 1.6, the order Pkg uses is
whereas on Julia 1.7, 1.8, and 1.9 it is
See eg the discussion in JuliaTesting/Aqua.jl#105 and in particular JuliaTesting/Aqua.jl#105 (comment)
I guess you were referring to the order in Julia > 1.6 and accidentally included the compat section twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I meant to refer to Julia > 1.6, sorry about the confusion for the duplicated
compat
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the order to the convention in Julia > 1.6.