Skip to content

Commit

Permalink
Merge pull request #176 from Evovest/dev
Browse files Browse the repository at this point in the history
fix GC GPU & docs typo
  • Loading branch information
jeremiedb authored Oct 26, 2022
2 parents a786e19 + fb41ee7 commit 689a01e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
authors = ["jeremiedb <[email protected]>"]
name = "EvoTrees"
uuid = "f6006082-12f8-11e9-0c9c-0d5d367ab1e5"
version = "0.12.3"
version = "0.12.4"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [EvoTress.jl](https://github.com/Evovest/EvoTrees.jl)
# [EvoTrees.jl](https://github.com/Evovest/EvoTrees.jl)

A Julia implementation of boosted trees with CPU and GPU support. Efficient histogram based algorithms with support for multiple loss functions, including various regressions, multi-classification and Gaussian max likelihood.

Expand Down
41 changes: 41 additions & 0 deletions experiments/benchmarks_v2-gpu.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Revise
using Statistics
using StatsBase: sample
using EvoTrees
using BenchmarkTools
using CUDA

nrounds = 200
nthread = Base.Threads.nthreads()

@info nthread

# EvoTrees params
params_evo = EvoTreeRegressor(
T=Float32,
loss="linear",
nrounds=nrounds,
alpha=0.5,
lambda=0.0,
gamma=0.0,
eta=0.05,
max_depth=6,
min_weight=1.0,
rowsample=1.0,
colsample=1.0,
nbins=64,
device = "gpu"
)

nobs = Int(11_664_400)
num_feat = Int(36)
@info "testing with: $nobs observations | $num_feat features."
x_train = rand(nobs, num_feat)
y_train = rand(size(x_train, 1))

@info "evotrees train GPU:"
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
for i in 1:5
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
end
# @time m_evo = fit_evotree(params_evo; x_train, y_train, x_eval=x_train, y_eval=y_train, metric=metric_evo, print_every_n=100);
4 changes: 4 additions & 0 deletions src/fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ function fit_evotree(
model.metric.iter = metric_best.iter
model.metric.metric = metric_best.metric
end
if params.device == "gpu"
GC.gc(true)
CUDA.reclaim()
end
params.nrounds = nrounds_max
return model
end
1 change: 0 additions & 1 deletion src/gpu/fit_gpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ function grow_evotree!(evotree::GBTreeGPU{L,T,S}, cache) where {L,T,S}
predict!(cache.pred, tree, cache.x, cache.K)
end # end of nrounds
cache.params.nrounds = params.nrounds
CUDA.reclaim()
return evotree
end

Expand Down

2 comments on commit 689a01e

@jeremiedb
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/71077

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.4 -m "<description of version>" 689a01e90d4e2bc71a062084c921596a683b7730
git push origin v0.12.4

Please sign in to comment.