Porting Bessel kv function implementation to reduce dependency on tfp#159
Conversation
|
You won't be able to use the new Jax constraints until we fix the rng |
beckermr
left a comment
There was a problem hiding this comment.
I'd be careful directly porting the functions from galsim. Tensorflow has some special casing of derivatives for some special functions to maintain numerical stability.
|
Yes, very fair, this is a WIP, I'm relearning a bit how everything works |
Merging this PR will degrade performance by 36.81%
Performance Changes
Comparing |
|
loool, not really an improvement in efficiency |
|
I wouldn't worry about the benchmarks. There is a lot of variability even for the same code version and compile times are not as critical. |
|
Ok, looks like these modifications are on par with the main branch in terms of speed, and this removes entirely the dependency on TFP. |
beckermr
left a comment
There was a problem hiding this comment.
Can you clarify relative to TFP what happens for orders 0 and 1?
Do they use special branches for those too? If so, do they use the same algorithms as the galsim code you ported?
|
In TFP there are no special cases for integer order: Here, we don't actually need the _bessel_k0 and _bessel_k1 functions for bessel |
|
ok, I cleaned things up. Only adding the ported code from TFP, remove additional implementation on kn functions. It's cleaner, we'll add them back when and if they are needed |
This pull request introduces a new contributor guide for Claude, updates dependencies, and improves test coverage for JAX-GalSim. The most significant changes include adding a detailed
CLAUDE.mdfile to help contributors and AI code assistants, updating the JAX dependency version, and enabling tests for thebessel.knfunction by removing it from the list of allowed failures.Contributor documentation and onboarding:
CLAUDE.mdfile with project overview, installation instructions, code formatting guidelines, architecture notes, testing infrastructure, and contribution workflow. This file is designed to help both human contributors and Claude code assistant understand and contribute to the project efficiently.Dependency updates:
pyproject.tomlto require version>=0.7.0instead of<0.7.0, ensuring compatibility with newer JAX releases.Testing improvements:
bessel.knfunction by removing it from theallowed_failureslist intests/galsim_tests_config.yaml, indicating that this function is now implemented and expected to pass its tests.