Skip to content

Add to_lojax rules for oryx FlatPrimitive and stablehlo_odx_composite. - #154

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_999158778
Oct 14, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_999158778

Conversation

@copybara-service

Copy link
Copy Markdown

Add to_lojax rules for oryx FlatPrimitive and stablehlo_odx_composite.

  • Define FlatPrimitive.to_lojax(self, *args, **params) in third_party/py/oryx/core/primitive.py delegating to self.impl(*args, **params), which handles bijector, softplus, logit, expit, and layer_cau when their staged jaxprs contain high-level primitives under jax_remat3, jax_custom_vjp3, and jax_custom_jvp3.
  • Register _COMPOSITE_PRIMITIVE.to_lojax in third_party/stablehlo_odx/model_import/jax/rewrite/utils.py to lower the fallback decomposition ClosedJaxpr via pe.lower_jaxpr2(jaxpr) while preserving stablehlo_odx_composite.

- Define `FlatPrimitive.to_lojax(self, *args, **params)` in `third_party/py/oryx/core/primitive.py` delegating to `self.impl(*args, **params)`, which handles `bijector`, `softplus`, `logit`, `expit`, and `layer_cau` when their staged jaxprs contain high-level primitives under `jax_remat3`, `jax_custom_vjp3`, and `jax_custom_jvp3`.
- Register `_COMPOSITE_PRIMITIVE.to_lojax` in `third_party/stablehlo_odx/model_import/jax/rewrite/utils.py` to lower the fallback decomposition `ClosedJaxpr` via `pe.lower_jaxpr2(jaxpr)` while preserving `stablehlo_odx_composite`.

PiperOrigin-RevId: 999507065
@copybara-service
copybara-service Bot merged commit 3684ad8 into main Oct 14, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the test_999158778 branch October 14, 2026 18:41
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.

1 participant