Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedb committed Oct 18, 2022
1 parent e352808 commit a3c2d78
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions experiments/benchmarks_v2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,28 @@ num_feat = Int(100)
x_train = rand(nobs, num_feat)
y_train = rand(size(x_train, 1))

# @info "xgboost train:"
# @time m_xgb = xgboost(x_train, nrounds, label=y_train, param=params_xgb, metrics=metrics, nthread=nthread, silent=1);
# @btime xgboost($x_train, $nrounds, label=$y_train, param=$params_xgb, metrics=$metrics, nthread=$nthread, silent=1);
# @info "xgboost predict:"
# @time pred_xgb = XGBoost.predict(m_xgb, x_train);
# @btime XGBoost.predict($m_xgb, $x_train);
@info "xgboost train:"
@time m_xgb = xgboost(x_train, nrounds, label=y_train, param=params_xgb, metrics=metrics, nthread=nthread, silent=1);
@btime xgboost($x_train, $nrounds, label=$y_train, param=$params_xgb, metrics=$metrics, nthread=$nthread, silent=1);
@info "xgboost predict:"
@time pred_xgb = XGBoost.predict(m_xgb, x_train);
@btime XGBoost.predict($m_xgb, $x_train);

# @info "evotrees train CPU:"
# params_evo.device = "cpu"
# @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);
# @btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train, x_eval=$x_train, y_eval=$y_train, metric=metric_evo);
# @btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train);
# @info "evotrees predict CPU:"
# @time pred_evo = EvoTrees.predict(m_evo, x_train);
# @btime EvoTrees.predict($m_evo, $x_train);
@info "evotrees train CPU:"
params_evo.device = "cpu"
@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);
@btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train, x_eval=$x_train, y_eval=$y_train, metric=metric_evo);
@btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train);
@info "evotrees predict 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);
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
@time m_evo_gpu = fit_evotree(params_evo; x_train, y_train);
@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);
# @btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train, x_eval=$x_train, y_eval=$y_train, metric=metric_evo);
# @info "evotrees predict GPU:"
# @time pred_evo = EvoTrees.predict(m_evo_gpu, x_train);
# @btime EvoTrees.predict($m_evo_gpu, $x_train);
@btime fit_evotree($params_evo; x_train=$x_train, y_train=$y_train, x_eval=$x_train, y_eval=$y_train, metric=metric_evo);
@info "evotrees predict GPU:"
@time pred_evo = EvoTrees.predict(m_evo_gpu, x_train);
@btime EvoTrees.predict($m_evo_gpu, $x_train);

0 comments on commit a3c2d78

Please sign in to comment.