Skip to content

Update tensorflow and xprof constraints in collect-profile-requiremen… - #40299

Merged
copybara-service[bot] merged 1 commit into
jax-ml:mainfrom
hawkinsp:deps
Aug 28, 2026
Merged

Update tensorflow and xprof constraints in collect-profile-requiremen…#40299
copybara-service[bot] merged 1 commit into
jax-ml:mainfrom
hawkinsp:deps

Conversation

@hawkinsp

Copy link
Copy Markdown
Collaborator

…nts.txt

  • Update tensorflow constraint from <3.13 to <3.14 now that 3.13 wheels are available.
  • Guard xprof with python_version < 3.15 to avoid pulling in cryptography on Python 3.15t where wheels are not yet available.
…ts.txt

- Update tensorflow constraint from <3.13 to <3.14 now that 3.13 wheels are available.
- Guard xprof with python_version < 3.15 to avoid pulling in cryptography on Python 3.15t where wheels are not yet available.
@hawkinsp hawkinsp added the pull ready Ready for copybara import and testing label Aug 28, 2026
@copybara-service
copybara-service Bot merged commit 00894c5 into jax-ml:main Aug 28, 2026
57 of 60 checks passed
copybara-service Bot pushed a commit that referenced this pull request Aug 28, 2026
**Why?**

program_order(enforce=True) traverses the jaxpr and adds opt_barrier of the form `opt_barrier((prev_outs, cur_inputs))`. It does not recurse into HOPs though.

One consequence of adding opt_barriers (other than disallowing all kinds of optimizations) is that it also alters the lifetime of some arrays (I'll give an example below).

So what `exclude_argnames` on `program_order(enforce=False)` does is it allows us to skip some `cur_inps` from the `opt_barrier((prev_outs, cur_inps))`. This opt_barrier is inserted by an outer program_order(enforce=True), so `enforce=False` is nested. Note that exclude_argnames only works when `enforce=False`. Also, if some arrays are closed over, then those can't be excluded. To exclude, arrays should be inputs and added to `exclude_argnames` (maybe we can support closed over inputs somehow but not today).

To make this work, we added a `program_order` primitive but it's very lightweight since it piggybacks on `eval_jaxpr_p`!

**Example of opt_barrier altering lifetimes**

```
x, y = opt_barrier((x, y)  # Will force both x and y to be ready here!
f(x)
g(y)
```

Without the opt_barrier:

```
f(x)  # x can be ready here
g(y)  # y can be ready here
```

FUTURE_COPYBARA_INTEGRATE_REVIEW=#40299 from hawkinsp:deps 067ddf0
PiperOrigin-RevId: 972232723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull ready Ready for copybara import and testing

1 participant