Skip to content

Jax backend#757

Merged
janden merged 23 commits into
kymatio:devfrom
eickenberg:jax_backend
Jun 23, 2022
Merged

Jax backend#757
janden merged 23 commits into
kymatio:devfrom
eickenberg:jax_backend

Conversation

@eickenberg

Copy link
Copy Markdown
Collaborator

Here is the jax backend for 1D. Tests pass.

I will add 2D and 3D here in the next days.

Please start reviewing this when you get a chance.

@janden janden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work! Some things do discuss here. Mainly clarifying the triple inheritance stuff which scare me a bit.

Comment thread kymatio/scattering1d/backend/jax_backend.py
from .numpy_frontend import ScatteringNumPy1D
from .base_frontend import ScatteringBase1D

class ScatteringJax1D(ScatteringJax, ScatteringNumPy1D, ScatteringBase1D):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again, slightly terrifying and definitely deserving of a comment if not a rewrite.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Explanation:

  1. Multiple inheritance generally looks for methods/attributes in the order of the classes specified above. Hence ScatteringJax goes first in order to have priority adding its attributes in.
  2. Apart from the inheritance of ScatteringNumpPy1D this class and its __init__ look exactly like the one in ScatteringNumPy1D itself.
  3. I had to include ScatteringBase1D because I needed to overwrite the __init__, basically copying and pasting the __init__ from ScatteringNumPy1D but with the backend changed. I had to do that because otherwise it was doing something numpy-specific from the ScatteringNumPy1D.__init__. In order to do that overwriting I needed access to ScatteringBase1D (from which ScatteringNumPy1D also inherits and which it uses in its __init__)
  4. I initially tried switching positions 2 and 3 and I got a multiple inheritance error (because ScatteringNumPy1D derives from ScatteringBase1D) and so not all permutations are actually allowed.

Will add some comments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added some comments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For 3. I don't know that you need to include ScatteringBase1D in the inheritance list just to call its constructor. It is a super-super-class of the current one, so there's no issue calling its constructor like you're doing. I tried removing this locally and tests pass.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ScatteringBase1D is already inherited via ScatteringNumpy1D. Its redundant here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@MuawizChaudhary update inheritance?

Comment thread tests/scattering1d/test_jax_backend_1d.py Outdated
Comment thread tests/general/test_jnp_vs_np.py Outdated
Comment thread tests/general/test_jnp_vs_np.py
Comment thread tests/general/test_jnp_vs_np.py Outdated
assert np.allclose(jax_result, numpy_result)


def test_jnp_multiplication():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How is this different from the previous test?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

don't know! I copied and pasted from the previous PR :D Will check

@@ -0,0 +1,36 @@
import pytest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rename test_jax_scattering1d.py per convention.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thanks!

T = x.shape[-1]
scattering = Scattering1D(J, T, Q, backend=backend, frontend='jax')

Sx = scattering(x)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we know that Jax is actually being used here (as opposed to NP)? There should be a way to find out using the mock package, I think. Conversely, it would be good to make sure that NP is not being used (except for filter generation) so that a call doesn't slip through by accident.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

image

Here is another pictorial proof.

You mean build a fake numpy or something that errors on all/most methods? With https://docs.python.org/dev/library/unittest.mock.html ?

@janden janden Jul 2, 2021

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You mean build a fake numpy or something that errors on all/most methods?

Yeah or is that overkill, do you think? I don't know that you need to replace numpy (you could do that with monkeypatch, I think). You can just do things like .called on various methods. Maybe NP will crash already if you give it Jax arrays.

@eickenberg eickenberg left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the review!

I left some comments about your questions.

Going to address them code-side now

Comment thread kymatio/scattering1d/backend/jax_backend.py
from .numpy_frontend import ScatteringNumPy1D
from .base_frontend import ScatteringBase1D

class ScatteringJax1D(ScatteringJax, ScatteringNumPy1D, ScatteringBase1D):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Explanation:

  1. Multiple inheritance generally looks for methods/attributes in the order of the classes specified above. Hence ScatteringJax goes first in order to have priority adding its attributes in.
  2. Apart from the inheritance of ScatteringNumpPy1D this class and its __init__ look exactly like the one in ScatteringNumPy1D itself.
  3. I had to include ScatteringBase1D because I needed to overwrite the __init__, basically copying and pasting the __init__ from ScatteringNumPy1D but with the backend changed. I had to do that because otherwise it was doing something numpy-specific from the ScatteringNumPy1D.__init__. In order to do that overwriting I needed access to ScatteringBase1D (from which ScatteringNumPy1D also inherits and which it uses in its __init__)
  4. I initially tried switching positions 2 and 3 and I got a multiple inheritance error (because ScatteringNumPy1D derives from ScatteringBase1D) and so not all permutations are actually allowed.

Will add some comments

Comment thread tests/general/test_jnp_vs_np.py
Comment thread tests/general/test_jnp_vs_np.py Outdated
Comment thread tests/general/test_jnp_vs_np.py Outdated
assert np.allclose(jax_result, numpy_result)


def test_jnp_multiplication():

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

don't know! I copied and pasted from the previous PR :D Will check

@@ -0,0 +1,36 @@
import pytest

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thanks!

T = x.shape[-1]
scattering = Scattering1D(J, T, Q, backend=backend, frontend='jax')

Sx = scattering(x)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

image

Here is another pictorial proof.

You mean build a fake numpy or something that errors on all/most methods? With https://docs.python.org/dev/library/unittest.mock.html ?

Comment thread tests/scattering1d/test_jax_backend_1d.py Outdated
test_data_dir = os.path.dirname(__file__)

with open(os.path.join(test_data_dir, 'test_data_1d.npz'), 'rb') as f:
buffer = io.BytesIO(f.read())

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

huh, why were we doing this? Instead of np.load?

Comment thread tests/scattering1d/test_jax_scattering1d.py
@eickenberg

Copy link
Copy Markdown
Collaborator Author

Added 2D jax backend with passing tests. This required moving some of the numpy input checks from the scattering function to the numpy backend

@eickenberg

Copy link
Copy Markdown
Collaborator Author

Added 3D backend.

Another quick review and discussion of the inheritance situation would be great!

@janden

janden commented Jul 2, 2021

Copy link
Copy Markdown
Collaborator

Ok I'll review 2D and 3D once we've converged on 1D.

@eickenberg

Copy link
Copy Markdown
Collaborator Author

@janden could we touch base on this one soon-ish and try to converge on a design decision?

@MuawizChaudhary

Copy link
Copy Markdown
Collaborator

Whats the current state of this PR @janden @eickenberg ? I can jump in and help. Sorry I never finished this during my internship!

@lostanlen

Copy link
Copy Markdown
Collaborator

I don't have the relevant background in JAX but i heartily support this: JAX looks really easy to use as a drop-in replacement for NumPy !

@MuawizChaudhary MuawizChaudhary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tests error out on the numpy 3d. Why did the input checks have to be changed for numpy again?

from .numpy_frontend import ScatteringNumPy1D
from .base_frontend import ScatteringBase1D

class ScatteringJax1D(ScatteringJax, ScatteringNumPy1D, ScatteringBase1D):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ScatteringBase1D is already inherited via ScatteringNumpy1D. Its redundant here.

Comment thread kymatio/scattering2d/frontend/jax_frontend.py Outdated
Comment thread kymatio/scattering3d/backend/numpy_backend.py Outdated
Comment thread kymatio/scattering3d/frontend/jax_frontend.py Outdated
Comment on lines -14 to -15
self.backend.input_checks(x)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why this removal?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i'll look into it later

Comment thread kymatio/scattering3d/frontend/numpy_frontend.py Outdated

@MuawizChaudhary MuawizChaudhary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can fix some of this up for y'all if thats fine with yall.

@MuawizChaudhary
MuawizChaudhary requested a review from janden June 16, 2022 05:35
@MuawizChaudhary

Copy link
Copy Markdown
Collaborator

@janden I fixed up various things in the jax front/backends. So this PR is ready for your review. Unfortunately, it appears that Jenkins does not have Jax installed. So that needs fixing.

@MuawizChaudhary MuawizChaudhary changed the title [WIP] Jax backend Jax backend Jun 17, 2022

@MuawizChaudhary MuawizChaudhary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we could merge this in at any time. Unsure if we wanna do it soon tho, ot later closer to release.

@MuawizChaudhary MuawizChaudhary self-assigned this Jun 17, 2022
@lostanlen

Copy link
Copy Markdown
Collaborator

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.

shall we remove py35 from Pip CI ?

@MuawizChaudhary

MuawizChaudhary commented Jun 19, 2022

Copy link
Copy Markdown
Collaborator

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.

shall we remove py35 from Pip CI ?

I vote yes, can you make an issue.

@lostanlen

Copy link
Copy Markdown
Collaborator

I have attempted to update the GitHub worfklow in a recent PR (#892 )
I would say that JAX is next in line after this

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

I agree. We'll rebase this once #892 is merged, then get back to reviewing it.

@MuawizChaudhary

Copy link
Copy Markdown
Collaborator

@janden i think you have the ability to reset tests for a pr?

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

@janden i think you have the ability to reset tests for a pr?

Yes but it won't make a difference until we've rebased.

@lostanlen

Copy link
Copy Markdown
Collaborator

Alright, i'm rebasing. Everyone stand back

@lostanlen

lostanlen commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

Jenkins is failing ... Torch 2D ?

tests/scattering2d/test_torch_scattering2d.py ...............sSending interrupt signal to process
Terminated
script returned exit code 143

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

Jenkins is failing ... Torch 2D ?

tests/scattering2d/test_torch_scattering2d.py ...............sSending interrupt signal to process
Terminated
script returned exit code 143

My guess is that rebuilding the docker image took too much time and there wasn't enough time to run the tests. I could be wrong though. Re-running to check.

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

Something happened with the rebase. There are lots of old commits that shouldn't be here. Do you have access to the original tree?

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

Ok looks like I was able to restore it (see #898). Is it ok if I force-push that branch on here so that we can continue the review in the same place?

@janden

janden commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

Ok looks like I was able to restore it (see #898). Is it ok if I force-push that branch on here so that we can continue the review in the same place?

Ping @lostanlen

@lostanlen

Copy link
Copy Markdown
Collaborator

@janden yes, it's all good to me. apologies for the mishap in rebase

@janden janden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Mostly comments and questions about testing here, which I think can be streamlined. Since the implementation so closely mirrors the NP frontend, I think we can get away with a simple test against sample data for each dimension and be done (perhaps checking on host and on device to be safe). This will ensure that Jax is doing the correct thing. All the other tests basically reproduce the tests we have for the NP frontend.

Comment thread .github/workflows/conda.yml Outdated
Comment thread tests/scattering2d/test_jax_scattering2d.py
buffer = io.BytesIO(f.read())
data = np.load(buffer)

x = data['x']

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we be casting to JNP arrays or doing device_put or something here (like in 1D)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should also be parameterizing Jax with cpu and gpu device in that instance then...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree.

Comment thread tests/scattering2d/test_jax_scattering2d.py Outdated
Comment thread tests/scattering3d/test_jax_scattering3d.py Outdated
@codecov-commenter

codecov-commenter commented Jun 21, 2022

Copy link
Copy Markdown

Codecov Report

Merging #757 (fa1a0df) into dev (6fc8547) will increase coverage by 0.20%.
The diff coverage is 90.75%.

@@            Coverage Diff             @@
##              dev     #757      +/-   ##
==========================================
+ Coverage   87.86%   88.07%   +0.20%     
==========================================
  Files          64       73       +9     
  Lines        2250     2297      +47     
==========================================
+ Hits         1977     2023      +46     
- Misses        273      274       +1     
Flag Coverage Δ
jenkins_main 88.07% <90.75%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
kymatio/frontend/numpy_frontend.py 93.33% <ø> (-0.42%) ⬇️
kymatio/jax.py 0.00% <0.00%> (ø)
kymatio/backend/numpy_backend.py 97.56% <50.00%> (-2.44%) ⬇️
kymatio/scattering2d/frontend/base_frontend.py 92.15% <69.23%> (-7.85%) ⬇️
kymatio/scattering1d/frontend/base_frontend.py 93.26% <83.33%> (-4.17%) ⬇️
kymatio/backend/jax_backend.py 90.00% <90.00%> (ø)
kymatio/frontend/base_frontend.py 84.00% <100.00%> (+6.22%) ⬆️
kymatio/frontend/entry.py 100.00% <100.00%> (ø)
kymatio/frontend/jax_frontend.py 100.00% <100.00%> (ø)
kymatio/scattering1d/backend/jax_backend.py 100.00% <100.00%> (ø)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2a627f...fa1a0df. Read the comment docs.

@lostanlen

Copy link
Copy Markdown
Collaborator

@MuawizChaudhary we're almost there. would you like to help us with simplifying the tests here?

@MuawizChaudhary

Copy link
Copy Markdown
Collaborator

yeah, I'm at CVPR rn but I'll get to it tonight

@MuawizChaudhary

Copy link
Copy Markdown
Collaborator

... i fucked up

@janden

janden commented Jun 22, 2022

Copy link
Copy Markdown
Collaborator

Cherry-picked your commits onto the cleaned-up branch. Just remember to rebase your branch before you commit and push next time.

@eickenberg eickenberg left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks great to me.

I had some questions wherever numpy files were modified, wondering whether that was from some previous PR or whether it pertained to making the structure jax compatible. I don't think any changes need to be made, but I'd like to understand the instances where the numpy files are modified in terms of this question, so comments appreciated.

I would also add an "Approve" to this PR, but it's grayed out for me, because I am the original author of this PR 😹

Comment thread kymatio/backend/numpy_backend.py Outdated
def __call__(self, x):
"""This method is an alias for `scattering`."""

self.backend.input_checks(x)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is this also from another PR or added during this one?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also from here

ScatteringBase2D.create_filters(self)

def scattering(self, input):
if not type(input) is np.ndarray:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

again the question whether this numpy file modification is an integral part of this PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From here

integrals = []
for i_q, q in enumerate(integral_powers):
integrals[:, i_q] = (input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1)
integrals.append((input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

is this modification to accommodate jax, because jax doesnt allow setting subarrays?
this will likely double the memory usage - worth considering whether to override this only in jax and keep numpy as it was?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, we have to do some .set and one additional operation.

for i_q, q in enumerate(integral_powers):
integrals[:, i_q] = (input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1)
integrals.append((input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1))
integrals = cls._np.float32(cls._np.stack(integrals, axis=-1))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

why is the cast to float32 necessary? isn't the input also float32?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it could be float64, so tests fail in that instance when we expect float32. Also, previously in this code integrals was defined as a float32 array.

def scattering(self, input_array):
if not type(input_array) is np.ndarray:
raise TypeError('The input should be a NumPy array.')
self.backend.input_checks(input_array)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is to let jax arrays through as well?
I like the change, just need to understand the motivation. I would have assumed that since in the jax case, np = jax.numpy, it should all be transparent

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes. I would have assumed so too. But I think np.array should be valid. perhaps we should add a special check for numpy or jax in the jax backend, overriding input_checks?

Comment thread tests/scattering2d/test_jax_scattering2d.py
Comment thread kymatio/backend/numpy_backend.py Outdated
def __call__(self, x):
"""This method is an alias for `scattering`."""

self.backend.input_checks(x)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also from here

ScatteringBase2D.create_filters(self)

def scattering(self, input):
if not type(input) is np.ndarray:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From here

Comment thread kymatio/backend/numpy_backend.py Outdated
Comment on lines +14 to +16
def input_checks(x):
if x is None:
raise TypeError('The input should be not empty.')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@eickenberg you added this here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

perhaps we should check that its a jax array?

for i_q, q in enumerate(integral_powers):
integrals[:, i_q] = (input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1)
integrals.append((input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1))
integrals = cls._np.float32(cls._np.stack(integrals, axis=-1))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it could be float64, so tests fail in that instance when we expect float32. Also, previously in this code integrals was defined as a float32 array.

integrals = []
for i_q, q in enumerate(integral_powers):
integrals[:, i_q] = (input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1)
integrals.append((input_array ** q).reshape((input_array.shape[0], -1)).sum(axis=1))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, we have to do some .set and one additional operation.

def scattering(self, input_array):
if not type(input_array) is np.ndarray:
raise TypeError('The input should be a NumPy array.')
self.backend.input_checks(input_array)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes. I would have assumed so too. But I think np.array should be valid. perhaps we should add a special check for numpy or jax in the jax backend, overriding input_checks?

Comment thread tests/scattering2d/test_jax_scattering2d.py
Comment thread tests/scattering2d/test_jax_scattering2d.py

@janden janden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work!

@lostanlen
lostanlen self-requested a review June 23, 2022 15:53
@janden
janden merged commit ee5fdcc into kymatio:dev Jun 23, 2022
janden added a commit that referenced this pull request Jun 23, 2022
* ENH jax base backend and frontend

* ENH jax backend and frontend for 1D

* TST general jax.numpy - numpy correspondence tests

* TST test for jax 1d backend

* WIP address Joakim's comments

* WIP jax 2d

* WIP typo in jax 2d

* ENH add 2D jax backend

* ENH jax backend 3d

* ENH jax entry point

* MAINT fix 3d numpy frontend test

* MAINT remove uneeded inheritances

* STY change script names to be more inline with current script naming convention

* TST edited workflows to account for jax and jaxlib

* TST adding jax to jenkins

* MAINT fix jaxbackend not complying with numpy backend after mergeal

* MAINT cast to float32

* update JAX tests (tuple Q)

* TST Fix seed for 2D FFT test (Jax)

* MAINT removed lonely jax import

* TST just have one test

* TST removed unneeded test

* MAINT make sure that we check for numpy ndarrays in addition to numpy-like ndarrays

Co-authored-by: Muawiz Chaudhary <muawizc@gmail.com>
Co-authored-by: Vincent Lostanlen <vincent.lostanlen@ls2n.fr>
Co-authored-by: Joakim Andén <janden@kth.se>
eickenberg added a commit that referenced this pull request Jul 5, 2022
* ENH jax base backend and frontend

* ENH jax backend and frontend for 1D

* TST general jax.numpy - numpy correspondence tests

* TST test for jax 1d backend

* WIP address Joakim's comments

* WIP jax 2d

* WIP typo in jax 2d

* ENH add 2D jax backend

* ENH jax backend 3d

* ENH jax entry point

* MAINT fix 3d numpy frontend test

* MAINT remove uneeded inheritances

* STY change script names to be more inline with current script naming convention

* TST edited workflows to account for jax and jaxlib

* TST adding jax to jenkins

* MAINT fix jaxbackend not complying with numpy backend after mergeal

* MAINT cast to float32

* update JAX tests (tuple Q)

* TST Fix seed for 2D FFT test (Jax)

* MAINT removed lonely jax import

* TST just have one test

* TST removed unneeded test

* MAINT make sure that we check for numpy ndarrays in addition to numpy-like ndarrays

Co-authored-by: Muawiz Chaudhary <muawizc@gmail.com>
Co-authored-by: Vincent Lostanlen <vincent.lostanlen@ls2n.fr>
Co-authored-by: Joakim Andén <janden@kth.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants