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

Dev #173

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Dev #173

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.1"
version = "0.12.2"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
1 change: 0 additions & 1 deletion experiments/benchmarks_v2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ params_evo.device = "cpu"
@time pred_evo = EvoTrees.predict(m_evo, x_train);
@btime EvoTrees.predict($m_evo, $x_train);

CUDA.allowscalar(true)
@info "evotrees train GPU:"
params_evo.device = "gpu"
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/fit_gpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function grow_tree_gpu!(
depth = 1

# reset nodes
@threads for n in eachindex(nodes)
for n in eachindex(nodes)
nodes[n].h .= 0
nodes[n].∑ .= 0
nodes[n].gain = -Inf
Expand Down
6 changes: 0 additions & 6 deletions src/gpu/predict_gpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,10 @@ function pred_leaf_gpu!(p::AbstractMatrix{T}, n, ∑::AbstractVector{T}, params:
@allowscalar(p[1, n] = -params.eta * ∑[1] / (∑[2] + params.lambda * ∑[3]))
return nothing
end
function pred_scalar_gpu!(∑::AbstractVector{T}, lambda) where {L<:GradientRegression,T,S}
@allowscalar(-∑[1] / (∑[2] + lambda * ∑[3]))
end

# prediction in Leaf - MLE2P
function pred_leaf_gpu!(p::AbstractMatrix{T}, n, ∑::AbstractVector{T}, params::EvoTypes{L,T,S}) where {L<:MLE2P,T,S}
@allowscalar(p[1, n] = -params.eta * ∑[1] / (∑[3] + params.lambda * ∑[5]))
@allowscalar(p[2, n] = -params.eta * ∑[2] / (∑[4] + params.lambda * ∑[5]))
return nothing
end
function pred_scalar_gpu!(∑::AbstractVector{T}, params::EvoTypes{L,T,S}) where {L<:MLE2P,T,S}
@allowscalar(-params.eta * ∑[1] / (∑[3] + params.lambda * ∑[5]))
end
2 changes: 1 addition & 1 deletion src/predict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function pred_leaf_cpu!(
end
function pred_scalar_cpu!(
∑::AbstractVector{T},
params::EvoTypes,
params::EvoTypes{L,T,S},
K,
) where {L<:GradientRegression,T,S}
-params.eta * ∑[1] / (∑[2] + params.lambda * ∑[3])
Expand Down