# How to make EvoTrees.jl more performant?

**URL:** <https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407>\
**Category:** Performance\
**Tags:** cuda\
**Created:** [August 14, 2021, 9:39pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407 "2021-08-14T21:39:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 14, 2021, 9:39pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/1 "2021-08-14T21:39:43Z")

</div>

Hello Folks:

Code Snippets obtained from Alan Turing Institute @ablaom

Using Pluto.jl, Windows, Julia v 1.6.x

I am using EvoTrees.jl Evaluation

First I am loading and Instantiating the Gradient Tree  
Boosting Model

```julia
Booster = @load EvoTreeRegressor

```

Second, I am wrapping the model to make it self-repeating

```julia
itr_boost = InteratedModel(model=Booster, resampling=Holdout(fraction_train=0.8)...)

```

Then I combine with the categorical feature encoder

```julia
pipe = @pipeline Continuous Encoder itr_boost

```

After, I define the hyperparameter range

```julia
max_depth_range = MLJIteration.range(pipe, :deterministic_iterated_model.model.max.depth),
                                  lower = 1, 
                                  upper = 30)

```

I wrap the model in a optimization container (for self-tuning)

```julia
self_tuning_pipe = MLJ.TunedModel(model=pipe, 
                                                           tuning = RandomSearch(), 
                                                           ranges = max_depth_range, 
                                                           resampling=CV(nfolds=3, rng=456),
                                                           measure=l1,
                                                           acceleration=CPUThreads(),
                                                           n=5)

```

I bind the data with

```julia
X, y = @load_reduced_ames

```

Wrap self\_tuning pipe in a machine

```julia
EVO = machine(self_tuning_pipe, X, y)

```

Lastly, when I attempt to evaluate wrapped self-tuning pipe

```julia
MLJ.evaluate!(EVO,
                 measures=[l1, l2],
                 resampling=CV(nfolds=5, rng=123),
                 acceleration=CPUThreads(),
                 verbosity=2)

```

I am returning the following error:

```julia
Distributed.ProcessExitedException(10)

```

I have attempted to decrease the folds and  
make other parameter adjustments, but am  
experiencing the same issue. The processes  
exit and my Pluto session terminates.

Is this a parameter issue or a performance  
issue? Or maybe something else? How  
would you approach a solution to this?

Thanks,

---

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [August 15, 2021, 3:38am UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/2 "2021-08-15T03:38:47Z")

</div>

@YummyPampers2 thanks for reporting!

Can you please post a full stack trace?

In the meantime, there is a known issue that popped up with EvoTreeRegressor fixed only this week in this version:

[https://github.com/Evovest/EvoTrees.jl/releases/tag/v0.8.3](https://github.com/Evovest/EvoTrees.jl/releases/tag/v0.8.3)

So make sure you’re using this version.

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 15, 2021, 4:44am UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/3 "2021-08-15T04:44:19Z")

</div>

@ablaom Thank you for sharing this! I saw about 2 days ago,  
you posted a similar response but I was not sure how to fix.

As for the stack-trace am attempting to copy it, but the browser  
freezes when I run that last block.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 15, 2021, 7:52am UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/4 "2021-08-15T07:52:14Z")

</div>

Can you try to reproduce the issue by executing your code in the Repl without using Pluto?

And paste the output of the command  
`]status`

?

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 15, 2021, 1:10pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/5 "2021-08-15T13:10:42Z")

</div>

@ablaom and @ufechner7

Good Day Professors:

The error-log reads:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/8/c8209926cdf4979ab740a292fc09acc6d64b51da.png)

This is with the v0.8.3 EvoTrees. When the EvoTrees version was  
0.8.2 the error message from the REPL was:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/5/b5d80d7e6049e21ceb32504412138f2f8cae4088.png)

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 15, 2021, 2:32pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/6 "2021-08-15T14:32:01Z")

</div>

As an alternative (for anyone observing using Pluto.jl):

1. select F12 OR right-click in the browser (select ‘Inspect Element’),
2. select ‘Console’ tab, then on the far right select either ‘Errors’ or ‘Log’,
3. screenshot the messages after executing the MLJ.evaluate! method

---

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [August 15, 2021, 9:52pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/7 "2021-08-15T21:52:46Z")

</div>

There is a version of the code you are running [here](https://github.com/alan-turing-institute/MLJ.jl/tree/dev/examples/lightning_tour), which also includes a set of environment files Project.tom and Manifest.toml, for reproducing the same environment. (If you just run the script there as is, in the same folder as these files, it should use that environment automatically). I’m unable to reproduce your problems with that script/env. I also updated the environment there with `using Pkg.update()` and again, no problems. In this case I have these versions installed:

```julia
Pkg.status()
      Status `~/Google Drive/Julia/MLJ/MLJ/examples/lightning_tour/Project.toml`
  [f6006082] EvoTrees v0.8.3
  [98b081ad] Literate v2.9.1
  [add582a8] MLJ v0.16.7
  [614be32b] MLJIteration v0.3.1

```

Does this match your status?

Also, is your stack trace complete? It does not appear to be.

BTW, You may want to drop the `acceleration=...` option to simplify diagnosis.

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 16, 2021, 3:18pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/8 "2021-08-16T15:18:33Z")

</div>

Hello Dr. Blaom:

The full log reads:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/e/4ecb85195ec9185addaa8d8e497890bada88433a.png)

Currently testing without the acceleration parameter and different  
workspace combinations. Will post results soon.

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 17, 2021, 11:48am UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/9 "2021-08-17T11:48:05Z")

</div>

Hello: This is the full error log:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/e/9e52a539afc0600cbb51fd3d644ff20239c457a3.png)

---

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [August 25, 2021, 12:47am UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/10 "2021-08-25T00:47:39Z")

</div>

Can you please report the output of `using Pkg; Pkg.status()`?

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 25, 2021, 12:04pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/11 "2021-08-25T12:04:46Z")

</div>

From the REPL or with in a Pluto process?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 25, 2021, 12:24pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/12 "2021-08-25T12:24:54Z")

</div>

should they be the same? wherever you’re running this. The point is to know the versions of packages that lead you to this error

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 25, 2021, 12:39pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/14 "2021-08-25T12:39:06Z")

</div>

@ablaom and @jling

First,  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/9/99c9a5f52e988a3d136683fad805870ac5719335.png)

Second,  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/5/15f01771b89dd09bf0905bbbebbb07d60ac86639.png)

Third,  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/b/3b15a8c1cf4cfe597bfd23f94be8b174126baf16.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/1/e1821eb5ad2eb9abb27d15397858f90b256e20c8.png)

Fourth: I resolved the packages

Fifth: I instantiated all the changes

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 25, 2021, 2:03pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/15 "2021-08-25T14:03:25Z")

</div>

EvoTrees is not the only package in play here is it? Are you not using MLJ? Please list all the package versions

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 25, 2021, 2:09pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/16 "2021-08-25T14:09:18Z")

</div>

Also note that if you use the current Pluto version, the package versions in your notebook might be different from those in your default (or any other) environment, as Pluto’s built-in package manager will create a notebook-specific environment once you put `using` somewhere in your notebook.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 25, 2021, 2:12pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/17 "2021-08-25T14:12:50Z")

</div>

> [@nilshg](#):
>
> Pluto’s built-in package manager will create a notebook-specific environment once you put `using` somewhere in your notebook.

not confusing at all… yeah

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 25, 2021, 2:20pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/18 "2021-08-25T14:20:19Z")

</div>

I think it’s nice for reproducibility and mitigates compat issues especially for new users which might not use environments otherwise, but I agree it can be surprising for people that do `] st` or other package operations in the REPL to find that they have no effect on the code in their notebooks…

More details here: [🎁 Package management · fonsp/Pluto.jl Wiki · GitHub](https://github.com/fonsp/Pluto.jl/wiki/%F0%9F%8E%81-Package-management)

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 25, 2021, 2:43pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/19 "2021-08-25T14:43:28Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/2/0/206275cb3d27500971d3120087b370359f9e3c77.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/4/7/473ce9b7367095c52f844377c52e0704a548e9cf.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/9/1/91d9868efb342bd486bfe36ecc294f46bf533c7d.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/1/8/1850f7e1e52273379731b2376808744fa05851cd.png)

![image](https://global.discourse-cdn.com/julialang/original/3X/9/5/95f5fd383bcf4c2fa72a60172a9699ca535174f4.png)

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [August 25, 2021, 3:24pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/20 "2021-08-25T15:24:51Z")

</div>

By the way, it’s usually more convenient if you can copy and paste code snippets into code blocks, rather than posting screenshots. See here for more info:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [August 25, 2021, 3:27pm UTC](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407/21 "2021-08-25T15:27:49Z")

</div>

Thanks Cameron.

The original post had the format that was convenient for you.  
The follow-up posts had screen shots simply for QA not  
reproducibility.

[Next page](https://discourse.julialang.org/t/how-to-make-evotrees-jl-more-performant/66407.md?page=2)
