Skip to content

Conversation

@zhangqiaorjc
Copy link
Collaborator

No description provided.

@zhangqiaorjc zhangqiaorjc marked this pull request as draft September 16, 2022 21:37
JaxCustomCallStatus* status;
};

void JaxCustomCallStatusSetSuccess(JaxCustomCallStatus* status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, linkage may be hard here. My suggestion to Sharad was that we pass function pointers for all API entry points a custom call might need (i.e., like a c++ class implemented in C).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use runtime linkage instead of link-time linkage a la Numpy import_array() style.

@zhangqiaorjc zhangqiaorjc marked this pull request as ready for review October 26, 2022 21:59
@sharadmv sharadmv added the pull ready Ready for copybara import and testing label Oct 26, 2022
@zhangqiaorjc zhangqiaorjc force-pushed the jax_custom_call branch 2 times, most recently from a18f38c to 17fb10c Compare October 26, 2022 22:36
@zhangqiaorjc
Copy link
Collaborator Author

We are importing this to explore some things. @hawkinsp hold off on reviews. Thanks!

@jlu-spins
Copy link

Hi! This looks really useful. Is anyone still committed to making this happen?

@zhangqiaorjc
Copy link
Collaborator Author

@jlu-spins yes, we are making an improved version with better C++ typed argument support. But it creates a new dependency on some XLA component that's still WIP. We are actively working on this, and will hopefully have a version in a few weeks.

In the meanwhile, https://github.com/dfm/extending-jax is still a good guide for doing JAX custom call at head.

@jlu-spins
Copy link

@zhangqiaorjc Thank you!

@MoFHeka
Copy link

MoFHeka commented Jul 23, 2024

How create a custom class instance with several call method and its own stateful resource. Something like Extending TorchScript with Custom C++ Classes

@dfm
Copy link
Contributor

dfm commented Jul 24, 2024

I'm going to close this PR since this work has been superseded by XLA's FFI API which is documented in #22095.

@MoFHeka — Please feel free to open a new discussion topic with more details about your specific use case if it would be useful to continue the conversation.

@dfm dfm closed this Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull ready Ready for copybara import and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants