Skip to content

Add support VHLO target versioning and serialization in export - #107

Merged
qihqi merged 2 commits into
google:mainfrom
ManfeiBai:patch-1
Sep 11, 2026
Merged

qihqi merged 2 commits into
google:mainfrom
ManfeiBai:patch-1

Conversation

@ManfeiBai

@ManfeiBai ManfeiBai commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Export/Copy @luis-marujo change from internal

Support VHLO target versioning and serialization in torchax export.

Extend exported_program_to_stablehlo in torchax with target_version and output_format parameters('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. Add deserialize_vhlo_artifact and legalize_stablehlo_to_vhlo helpers to enable version validation and round-trip execution for PyTorch exported models.

skip test_deserialize_vhlo_artifact and test_dynamic_shapes_vhlo_target_version while 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

@ManfeiBai
ManfeiBai marked this pull request as draft September 10, 2026 20:28
Comment thread torchax/export.py
@ManfeiBai
ManfeiBai marked this pull request as ready for review September 10, 2026 21:07
@ManfeiBai

Copy link
Copy Markdown
Collaborator Author

thanks, CI passed according to this local PR CI test: ManfeiBai#7

@qihqi
qihqi merged commit 1205739 into google:main Sep 11, 2026
11 checks passed
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.

2 participants