From a3c2d78934faf40ec5b9d2d2688b35eba6b18e79 Mon Sep 17 00:00:00 2001 From: "jeremie.desgagne.bouchard" Date: Tue, 18 Oct 2022 01:22:52 -0400 Subject: [PATCH] up --- experiments/benchmarks_v2.jl | 40 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/experiments/benchmarks_v2.jl b/experiments/benchmarks_v2.jl index 79a74c33..14f66020 100644 --- a/experiments/benchmarks_v2.jl +++ b/experiments/benchmarks_v2.jl @@ -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); \ No newline at end of file +@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); \ No newline at end of file