Support non-numpy array backends#886
Conversation
ea348fa to
771a8a9
Compare
|
This is now ready for review. There are a lot of changes, but most of them are essentially Bilby can once again be installed without I've managed to keep test changes minimal:
|
mj-will
left a comment
There was a problem hiding this comment.
Some initial comments but I'll need to have another look.
ColmTalbot
left a comment
There was a problem hiding this comment.
Thanks for the initial comments @mj-will I'll take a pass at them ASAP.
GregoryAshton
left a comment
There was a problem hiding this comment.
Okay, I got through about 60% of the diff and I'm pausing here so will submit the questions so far.
| _cdf[val >= self.minimum] = 1. - np.exp(-val[val >= self.minimum] / self.mu) | ||
| return _cdf | ||
| with np.errstate(divide="ignore"): | ||
| return -val / self.mu - xp.log(xp.asarray(self.mu)) + xp.log(val >= self.minimum) |
There was a problem hiding this comment.
Ah okay - are the bounds being implemented here? But, I don't see the upper bound being implemented.
There was a problem hiding this comment.
I think this is carried over from the existing implementation.
|
Python 3.10 doesn't have support for a vmappable version of logsumexp through scipy leading to this job failing (https://github.com/bilby-dev/bilby/actions/runs/25883935510/job/76070707573?pr=886). How do people feel about dropping support for Python 3.10 in Bilby 3? Numpy dropped support about a year ago. |
This required making some changes to the tests for conditional dicts as I've changed the output types and the backend introspection doesn't work on dict_items for some reason
v0.1.0a6 and above now renames |
|
@ColmTalbot orng 0.1.0 is now on conda forge: https://anaconda.org/channels/conda-forge/packages/orng/overview |
GregoryAshton
left a comment
There was a problem hiding this comment.
I'm happy to approve and merge this with the idea to then ask all developers to test it and find the issues.
Co-authored-by: Michael J. Williams <michaeljw1@googlemail.com>
mj-will
left a comment
There was a problem hiding this comment.
Thanks again Colm for all your work on this!
Assuming the CI passes, I'm happy to approve this and we can continue to test it.
* Fixing #1047 Squeeze the output to one-dimension to fix incompatibility with numpy > 2.4 * Fix typo in interferometer.py to_pickle method (#1081) * REL: update changelog for 2.8.1 * MAINT: revert 4a92394 This reverts commit 4a92394. * BUG: apply from #886 for 1047 * REL: update changelog * Increase tolerance for log noise evidence comparison (#1087) closes #1086 * REL: add 1087 --------- Co-authored-by: Gregory Ashton <gregory.ashton@ligo.org> Co-authored-by: AlexandreGoettel <33029077+AlexandreGoettel@users.noreply.github.com> Co-authored-by: Matt Pitkin <m@ttpitk.in>
I've been working on this PR on and off for a few months, it isn't ready yet, but I wanted to share it in case other people had early opinions.
The goal is to make it easier to interface with models/samplers implemented in e.g., JAX, that support GPU/TPU acceleration and JIT compilation.
The general guiding principles are:
array-apispecification andscipyinteroperabilityThe primary changes so far are:
Changed behaviour:
Remaining issues:
bilby.gw.jaxstufffile should be removed and relevant functionality be moved elsewhere, it's currently just used for testing