Skip to content

Add docs on interfacing with surrogates#804

Merged
copybara-service[bot] merged 1 commit intomainfrom
onnx-docs
May 19, 2025
Merged

Add docs on interfacing with surrogates#804
copybara-service[bot] merged 1 commit intomainfrom
onnx-docs

Conversation

@theo-brown
Copy link
Collaborator

@theo-brown theo-brown commented Mar 6, 2025

Includes:

  1. Manually reimplementing the model in JAX
  2. Converting a Pytorch model to a JAX model using torch_xla2
  3. Using an ONNX model with jaxonnxruntime

Potentially closes #538

@theo-brown theo-brown mentioned this pull request Mar 6, 2025
Copy link
Collaborator

@jcitrin jcitrin left a comment

Choose a reason for hiding this comment

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

Thanks for this! Really awesome and appreciated that you are writing documentation.

Made a few comments. @hamelphi , @sbodenstein , @ernoc could you also take a look at this?

@jcitrin
Copy link
Collaborator

jcitrin commented Mar 7, 2025

When fusion_transport_surrogates matures more it will hopefully help abstract away some of this and we can supplement/modify these docs with examples using that library

@hamelphi
Copy link
Collaborator

Nice! LGTM. Thanks for the contribution Theo.

@jcitrin jcitrin added copybara:import-manual Set when ready for copybara manual import and removed copybara:import-manual Set when ready for copybara manual import labels Mar 18, 2025
@theo-brown theo-brown requested a review from jcitrin March 21, 2025 10:59
@theo-brown
Copy link
Collaborator Author

Thanks for the comments, sorry for the delay in responding!

@theo-brown
Copy link
Collaborator Author

Following some of the suggestions made by @sbodenstein, I've added a bit on saving/loading models in HLO format, which is the one backed by OpenXLA.

@theo-brown theo-brown requested a review from sbodenstein March 25, 2025 15:47
@theo-brown
Copy link
Collaborator Author

theo-brown commented May 19, 2025

I've just made the changes @sbodenstein requested. However, after rebasing onto main I've discovered that the relevant docs page has changed to no longer contain information on how to integrate new models into TORAX - I imagine because a specific API/framework for doing so is to be developed, and you guys are currently crunching for v1.0.0. Is this PR dead, then, or will this info be useful somewhere sometime in the future?

@jcitrin
Copy link
Collaborator

jcitrin commented May 19, 2025

Hi Theo. I think it's still useful to include and if done right now can be part of the v1.0.0 docs (release planned imminently). Best would be to not include all of interfacing_with_surrogates.rst into the near-empty model_integration.rst, but to add instead a link with some text like "For information on JAX-friendly interfacing with ML-surrogates of physics models, see <your_new_link>".

@theo-brown
Copy link
Collaborator Author

Super, can do. Give me a couple of mins

@theo-brown
Copy link
Collaborator Author

Done!

@jcitrin jcitrin added the copybara:import-manual Set when ready for copybara manual import label May 19, 2025
@copybara-service copybara-service bot merged commit 54bacbe into main May 19, 2025
19 checks passed
@theo-brown theo-brown deleted the onnx-docs branch May 28, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara:import-manual Set when ready for copybara manual import

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide ONNX converter

4 participants

Comments