Skip to content

Update JAX export example to use new functionality#1602

Closed
google-labs-jules[bot] wants to merge 3 commits intomainfrom
docs/update-jax-export-example-12932745014009605670
Closed

Update JAX export example to use new functionality#1602
google-labs-jules[bot] wants to merge 3 commits intomainfrom
docs/update-jax-export-example-12932745014009605670

Conversation

@google-labs-jules
Copy link

The "Exporting to JAX" documentation has been updated to use the new Reactant.Serialization.export_to_enzymejax function. This simplifies the process by automating the generation of the StableHLO, the Python wrapper, and the input files.

Fixes #1588


PR created automatically by Jules for task 12932745014009605670 started by @avik-pal

The "Exporting to JAX" documentation has been updated to use the new `Reactant.Serialization.export_to_enzymejax` function. This simplifies the process by automating the generation of the StableHLO, the Python wrapper, and the input files.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.


```@example exporting_to_stablehlo
using Lux, Reactant, Random
using Lux, Reactant, Random, NPZ
Copy link
Member

Choose a reason for hiding this comment

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

We need to add NPZ to the project dependencies in docs/. activate the project and add it using Pkg.add("NPZ")

Copy link
Member

@avik-pal avik-pal Dec 18, 2025

Choose a reason for hiding this comment

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

@jules We need to add NPZ to the project dependencies in docs/. activate the project and add it using Pkg.add("NPZ")

Comment on lines 53 to 56
The generated files will be in the `output_dir`. You can now run the model in Python.

```python
from enzyme_ad.jax import hlo_call

# This is a sample python script. The actual generated script can be run directly.
Copy link
Member

Choose a reason for hiding this comment

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

instead of manually writing the python script, print the contents of the script generated

Copy link
Member

Choose a reason for hiding this comment

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

@jules instead of manually writing the python script, print the contents of the script generated

The "Exporting to JAX" documentation has been updated to use the new `Reactant.Serialization.export_to_enzymejax` function. This simplifies the process by automating the generation of the StableHLO, the Python wrapper, and the input files.
Addresses feedback on the pull request to print the content of the
generated Python script directly in the documentation. This ensures
the documentation is always in sync with the generated output.
@avik-pal avik-pal closed this Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update exporting to jax example to directly use new export functionality

1 participant