Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omnistaging experiment: print partial eval stats #4271

Closed
wants to merge 1 commit into from

Conversation

mattjj
Copy link
Collaborator

@mattjj mattjj commented Sep 12, 2020

The idea here is that we can add a useful debugging tool for omnistaging (#3370, #4038) by printing out expressions that would have been constant-folded with pre-omnistaging behavior.

import jax.numpy as jnp
from jax.lax import scan

from jax.config import config
config.enable_omnistaging()

def cumsum(xs):
  _, ys = scan(lambda c, x: (c + x, c + x + jnp.add(1, 1)), 0., xs)
  return ys

cumsum(jnp.arange(10))
from tracing <lambda> at example.py:8, this was not constant folded:

{ lambda  ; _ _.
  let c = add 1 1
      d = convert_element_type[ new_dtype=float32
                                old_dtype=int32 ] c
  in (*, *, d) }

@google-cla google-cla bot added the cla: yes label Sep 12, 2020
@hawkinsp
Copy link
Collaborator

Closing, because I doubt many folks need this particular debugging facility any more...

@hawkinsp hawkinsp closed this Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants