feat(python): add differentiable PyTorch gravity interface#54
Conversation
|
The CI is failing on two pipelines:
|
|
My last commit definitely fixes the build on Windows. This time I tested it on my fork (See here). Sorry if I did not think about doing it before. PyTorch tests are still going to fail, though. For those, we should do one of the things I proposed before:
|
Adds `polyhedral_gravity.torch`. Includes tests, notebooks, and CI coverage.
c431d2d to
9e6201e
Compare
|
@sasso-effe Thanks for the contribution. The idea to add some implementation that allows us to determine gradients w.r.t. position is great! Though I do have some comments (see below) for future reference. I would love to hear if this is interesting to you. Also, thanks a lot (!) for reporting the runtimes in the notebook AND specifying the hardware (CPU <=> GPU comparisons are in other places way too often reduced to unfair speedup without mentioning the hardware in other places 😢) @darioizzo Currently, this breaks existing functionality/ is not 100% compliant with code standard/ docs:
I know that I am not always super-quick here, but I was on vacation, and I am mostly maintaining this in my free time, so things can proceed a bit slower. If a feature is urgent, one can always leave it on a branch for a while or inside a fork, but making @sasso-effe If you could fix the above-mentioned things, we can make it a release to simplify installation via @sasso-effe We do have a proper GPU implementation lying around (actually multiple 😄- that is my current research work) and are currently undergoing testing on Nvidia, AMD, and Intel GPU hardware to have the polyhedral model portable and fast on any hardware (https://github.com/schuhmaj/performance-portability-benchmark/tree/main/src/polyhedralGravity). So the way to go would be to update the current build process and use Plug in the above-mentioned GPU implementations, and we have a model that can run anywhere within any Python framework and on any hardware, fast and optimized to our needs. Now my question: @sasso-effe, I think the speed gain on GPUs is probably good to take, but I presume you also require the autodiff for your current work? Or is it just the GPU acceleration? |
|
@schuhmaj, first of all, sorry for having left Regarding your question, I did this implementation because I needed the autodiff for my research project; the GPU acceleration was just a nice side effect. I've paused my efforts on the mentioned project because I realized it was not leading anywhere, but I had already done all the implementation, and I thought it was nice to contribute it to this repo to not lose it. Maybe it can be helpful to someone else. I will have a look at the repo you linked! |
Cool! No worries, as long as the release is fine, we're good ;)
But good to have it in. For the PyPI, we can enable the torch dependency somewhere in the build process in the
Mostly experimental, at least from the SE side of things; it's more a performance study. Most likely the Kokkos implementation will come to this repository at some point (and replace the current |
Adds
polyhedral_gravity.torch. Includes tests, notebooks, and CI coverage.Closes #53