Faster GMM1_lpdf#940
Open
antoine-galataud wants to merge 4 commits into
hyperopt:masterhyperopt/hyperopt:masterfrom
antoine-galataud:faster_GMM1_lpdfantoine-galataud/hyperopt:faster_GMM1_lpdfCopy head branch name to clipboard
Open
Faster GMM1_lpdf#940antoine-galataud wants to merge 4 commits intohyperopt:masterhyperopt/hyperopt:masterfrom antoine-galataud:faster_GMM1_lpdfantoine-galataud/hyperopt:faster_GMM1_lpdfCopy head branch name to clipboard
antoine-galataud wants to merge 4 commits into
hyperopt:masterhyperopt/hyperopt:masterfrom
antoine-galataud:faster_GMM1_lpdfantoine-galataud/hyperopt:faster_GMM1_lpdfCopy head branch name to clipboard
Conversation
Author
|
Comparison of performance between the 2 versions of the code:
While testing with my scenarios, I encountered only case number 1. But that may not cover all use cases. |
jvwknzn6p2-spec
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there,
While running hyperopt in Ray Tune with large number of samples, I noticed that performance was dropping quite fast after a few hundreds of them.
I did some profiling using
cProfileand noticed thatGMM1_lpdfhad a important total time of execution. See below an example of profiling results sorted by total time2 things to notice:
GMM1_lpdftotal time is largenormal_cdftotal time is large too, and its number of calls is quite important.Looking at
GMM1_lpdfcode, the code block that callsnormal_cdfmost is the following:hyperopt/hyperopt/tpe.py
Lines 153 to 166 in 0658f68
Several observations here:
lboundandubounddon't depend on for loop parametersnormal_cdfdepends on length of given arrays, which grows with number of samples.After analyzing the impact, I drafted a "vectorized" version of the code, which doesn't rely on for loop anymore but executes the computation in one pass.
Tests are passing, and I've been able to validate the results with in-house experiments too.
Feedback appreciated!