Giter Site home page Giter Site logo

Comments (14)

astanziola avatar astanziola commented on July 26, 2024 1

Thanks for pointing it out @talfanoutlook .
This repo needs a bit of love which I wasn't able to give recently, so there's a good chance that the problem is outdated jax dependencies, I will look into it!

from jwave.

talfanoutlook avatar talfanoutlook commented on July 26, 2024

Great let me know - I'll try to take a look myself also.

from jwave.

astanziola avatar astanziola commented on July 26, 2024

I have a feeling that the library behind jwave (jaxdf) needs to be upgraded to the most recent jax versions, so maybe give me a bit to check that out before getting lost in the code :)

from jwave.

talfanoutlook avatar talfanoutlook commented on July 26, 2024

from jwave.

astanziola avatar astanziola commented on July 26, 2024

Hi @talfanoutlook , I might need another couple of days on this sorry.
I'm fixing a few issues with jaxdf first that arised with the new jax version, and then will jump on it.
If you find anything meanwhile feel very free to update here or PR!

from jwave.

astanziola avatar astanziola commented on July 26, 2024

@talfanoutlook Just to let you know that I haven't forgot about this, but the problem is weirder than I expected.

What is happening is that if I run twice the same exact (jitted!) function, in this case single_source_simulation, with the same arguments, sometimes I get two different results. It seems that there's something stored in memory that is affecting the results, which is definetely something unexpected from a funcional programming language like jax, so it's not immediately obvious to me what the issue is.

from jwave.

astanziola avatar astanziola commented on July 26, 2024

Interestingly enough, if one disables GPUs and runs the code on CPU, the issue does not appear.
That explains why the tests that run against k-Wave do not fail.

I'll try to setup an MRE and raise it to the jax team.

from jwave.

talfanoutlook avatar talfanoutlook commented on July 26, 2024

from jwave.

astanziola avatar astanziola commented on July 26, 2024

Made a MRE and raised to the jax team: google/jax#16129
For reference, the pure jax MRE is here https://github.com/ucl-bug/jwave/blob/gpu-error-mre/error.py

from jwave.

talfanoutlook avatar talfanoutlook commented on July 26, 2024

from jwave.

talfanoutlook avatar talfanoutlook commented on July 26, 2024

from jwave.

astanziola avatar astanziola commented on July 26, 2024

from jwave.

astanziola avatar astanziola commented on July 26, 2024

Seems like this is solved in jax 0.4.11 (and I have absolutely no idea why that's the case). Do you mind giving it a try with the latest jax version @talfanoutlook ?

For some reason, I do get an OOM error in my RTX 4000, so you may want to try with a beefier one. The fix for the OOM error is trivial, that is: passing the simulation parameters to the solver directly instead of having them internally calculated.

I will update the example notebook accordingly soon, while I move the time-stepping method to diffrax :)

from jwave.

astanziola avatar astanziola commented on July 26, 2024

I will close it for now, as in my tests this seems to be consistently fixed. Feel free to reopen it or open a new one if the problem still arises!

from jwave.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.