pyhf: iminuit v1.5.0 breaks optimization tests
Description
With the release of iminuit
v1.5.0
on 2020-09-17 the nightly tests are failing in test_optim.py
. Specifically
is failing with errors of
try:
assert result.success
except AssertionError:
log.error(result)
> raise exceptions.FailedMinimization(result)
E pyhf.exceptions.FailedMinimization: Optimization failed. Estimated distance to minimum too large.
src/pyhf/optimize/mixins.py:52: FailedMinimization
------------------------------ Captured log call -------------------------------
ERROR pyhf.optimize.mixins:mixins.py:51 fun: 15.5887451171875
hess_inv: array([[1., 1.],
[1., 1.]])
message: 'Optimization failed. Estimated distance to minimum too large.'
minuit: <iminuit._libiminuit.Minuit object at 0x5619c82f90a0>
nfev: 110
njev: 0
success: False
unc: None
x: array([0.97325551, 0.91712703])
where the pyhf.exceptions.FailedMinimization
being raised comes from the raise exceptions.FailedMinimization(result)
in
which are of course coming from
in
Steps to Reproduce
Run the tests using current master.
To show that this is definitley an issue with iminuit
v1.5.0+
$ python -m pip install --upgrade "iminuit<1.5.0"
$ pip list | grep iminuit
iminuit 1.4.9
$ python -m pytest -sx tests/test_optim.py
passes but
$ python -m pip install --upgrade iminuit
$ pip list | grep iminuit
iminuit 1.5.1
$ python -m pytest -sx tests/test_optim.py
fails.
Checklist
- Run
git fetch
to get the most up to date version ofmaster
- Searched through existing Issues to confirm this is not a duplicate issue
- Filled out the Description, Expected Behavior, Actual Behavior, and Steps to Reproduce sections above or have edited/removed them in a way that fully describes the issue
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 31 (31 by maintainers)
No it is fine. Glad to hear that fixed it.
We likely need to patch pyhf to set the 32b float mode when running over 32b. This may be the last piece needed on our side. I think 3 is enough, but not sure.
Since I referenced your issue in my PR, it was automatically closed. Please confirm that develop works again.
We would be happy to have this be a configurable option. At least to have a “try_harder=True” or something like this. Can you point to the code changes that were affecting this? I looked through the linked PR but had a hard time figuring out how it might have changed.
here’s a quick script that runs both precision values:
versus 1.5.0