SymPy integration#502
Open
DoeringChristian wants to merge 1 commit into
Open
Conversation
Member
|
Hi Christian, thank you for the PR, this looks like a very useful feature. My suggestion would be to do another crunching pass over the code. 1.5K is .. a lot! I feel like this code has some of the fluffiness of partly AI-generated and could do with some simplification passes to reduce it to a more minimal form (matching also the documented API surface). Thanks, |
b4f991e to
9e8f222
Compare
9e8f222 to
0075a6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds integration to sympy using the
dr.wrapdecorator.SymPy is a symbolic expressions engine. This PR adds it as a target for
dr.wrap, allowing us to compute higher order derivatives (hessians) etc in Dr.Jit. In contrast to other targets for this decorator the SymPy target does not exchange data between the libraries at runtime, but rather traces the symbolic expressions generated by the wrapped function, and compiles it to Dr.Jit. The wrapped function therefore acts like an ordinary Dr.Jit function, while we can use the complicated symbolic operations supported by SymPy. The wrapped functions are restricted to per-lane operations. Inverting aMatrix4finside of this wrapper will generate the necessary code for Dr.Jit to invert the matrix. Calling the function with a Matrix array in Dr.Jit will therefore invert each matrix per SIMD lane.