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

Threading issue #248

Closed
olivierlabayle opened this issue Aug 11, 2023 · 3 comments · Fixed by #250
Closed

Threading issue #248

olivierlabayle opened this issue Aug 11, 2023 · 3 comments · Fixed by #250

Comments

@olivierlabayle
Copy link

Hi there,

I think a threading issue was introduced in 0.15. The following works on 0.14 but raises @threads :static cannot be used concurrently or nested in 0.15:

using MLJ
using EvoTrees
using MLJLinearModels
X, y = make_regression()
model = Stack(
    metalearner = LinearRegressor(),
    resampling  = CV(nfolds=2),
    tree        = EvoTreeRegressor()
)
mach = machine(model, X, y)
fit!(mach)

Not sure if it is platform specific, I am on MAC M1 with MLJ v0.19.2.

@jeremiedb
Copy link
Member

The move to the :static threads scheduling was made in the context of several discussions arising around some race conditions:

But the caveat with :static is what you just experienced, where MLJ apparently uses threading for some of its routines.
I'll have a second look at the above mentionned caveats as I don't think the code was subject to those. If such is the case, then I should be ably to reinstate the dynamic mode which allows for nested parallelism.

@jeremiedb
Copy link
Member

@olivierlabayle Could you give a try at https://github.com/Evovest/EvoTrees.jl/tree/threading?
I've removed the :static to use :dynamic threading. The above MLJ test ran fine on my end (Windows).
I should then be able to make a fix release by tomorrow.

@olivierlabayle
Copy link
Author

@olivierlabayle Could you give a try at https://github.com/Evovest/EvoTrees.jl/tree/threading? I've removed the :static to use :dynamic threading. The above MLJ test ran fine on my end (Windows). I should then be able to make a fix release by tomorrow.

Since you've closed this, I've just tried the new 0.16 which works just fine. Thank you for solving it so fast! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants