Commit c63ed28
fix: Memory leak (#282)
* test: Add reproducing test
* fix: Make sampling neighbors form uniform Int stable
* fix: Memory leak with UniformIntegerHyperparameter
When querying a large range for a UniformIntegerHyperparameter with a
small std.deviation and log scale, this could cause an infinite loop as
the reachable neighbors would be quickly exhausted, yet rejection
sampling will continue sampling until some arbitrary termination
criterion. Why this was causing a memory leak, I'm not entirely sure.
The solution now is that is we have seen a sampled value before, we
simply take the one "next to it".
* fix: Memory issues with Normal and Beta dists
Replaced usages of arange with a chunked version to prevent memory
blowup. However this is still incredibly slow and needs a more refined
solution as a huge amount of values are required to be computed for what
can possibly be analytically derived.
* chore: Update flake8
* fix: flake8 version compatible with Python 3.7
* fix: Name generators properly
* fix: Test numbers
* doc: typo fixes
* perf: Generate all possible neighbors at once
* test: Add test for center_range and arange_chunked
* perf: Call transform on np vector from rvs
* perf: Use numpy `.astype(int)` instead of `int`
* doc: Document how to get flamegraphs for optimizing
* fix: Allow for negatives in arange_chunked again
* fix: Change build back to raw Extensions
* build: Properly set compiler_directives
* ci: Update makefile with helpful commands
* ci: Fix docs to install build
* perf: cython optimizations
* perf: Fix possible memory leak with UniformIntegerHyperparam
* fix: Duplicates as `list` instead of set
* fix: Convert to `long long` vector
* perf: Revert clip to truncnorm
This truncnorm has some slight overhead due to however
scipy generates its truncnorm distribution, however this
overhead is considered worth it for the sake of readability
and understanding
* test: Test values not match implementation
* Intermediate commit
* INtermediate commit 2
* Update neighborhood generation for UniformIntegerHyperparameter
* Update tests
* Make the benchmark sampling script more robust
* Revert small change in util function
* Improve readability
Co-authored-by: Matthias Feurer <[email protected]>1 parent 7f1ac3b commit c63ed28
File tree
20 files changed
+397
-153
lines changed- .github/workflows
- ConfigSpace
- scripts
- test
20 files changed
+397
-153
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
0 commit comments