Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

support parallel MinTrace optimization #249

Merged
merged 4 commits into from
Nov 16, 2023
Merged

support parallel MinTrace optimization #249

merged 4 commits into from
Nov 16, 2023

Conversation

jmoralez
Copy link
Member

@jmoralez jmoralez commented Nov 10, 2023

Since the solve_qp function uses the nogil context manager it's possible to parallelize the optimization problems using a thread pool, which will solve the optimization problems for each horizon in parallel.

This adds the num_threads argument to MinTrace, which if set to a number greater than 1 will spawn a thread pool and submit the work there.

Also removes deprecation warnings about the sparse argument in the OneHotEncoder.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jmoralez jmoralez changed the title parallelize MinTrace optimization support parallel MinTrace optimization Nov 15, 2023
@jmoralez jmoralez marked this pull request as ready for review November 15, 2023 23:26
@jmoralez jmoralez requested a review from AzulGarza November 15, 2023 23:26
Copy link
Member

@AzulGarza AzulGarza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @jmoralez! Could we test that the same results can be recovered using num_threads=1 and num_threads>1? We could add the test in a cell with #| eval: false, just to test it while developing.

I just saw the tests, and approved. Thank you!

@AzulGarza AzulGarza self-requested a review November 16, 2023 18:08
@jmoralez jmoralez merged commit 2067699 into main Nov 16, 2023
17 checks passed
@jmoralez jmoralez deleted the parallelize-mintrace branch November 16, 2023 18:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants