Add support VHLO target versioning and serialization in export - #107
Merged
Merged
Conversation
ManfeiBai
marked this pull request as draft
September 10, 2026 20:28
ManfeiBai
commented
Sep 10, 2026
ManfeiBai
marked this pull request as ready for review
September 10, 2026 21:07
qihqi
approved these changes
Sep 10, 2026
Collaborator
Author
|
thanks, CI passed according to this local PR CI test: ManfeiBai#7 |
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.
Export/Copy @luis-marujo change from internal
Support VHLO target versioning and serialization in torchax export.
Extend
exported_program_to_stablehloin torchax withtarget_versionandoutput_formatparameters('stablehlo', 'bytecode', 'vhlo', 'portable_artifact', 'vhlo_bytecode', 'text', 'mlir_text', 'vhlo_text', 'mlir'), enabling direct legalization and bytecode serialization to Versioned StableHLO (VHLO) portable artifacts. Adddeserialize_vhlo_artifactandlegalize_stablehlo_to_vhlohelpers to enable version validation and round-trip execution for PyTorch exported models.skip
test_deserialize_vhlo_artifactandtest_dynamic_shapes_vhlo_target_versionwhile environment's JAX version is smaller than 0.11.1, and test passed locally while JAX version is 0.11.1: https://gist.github.com/ManfeiBai/dc502668fe76df3096b8dd564d0dd2f3