jax-ml / jax-ml/oryx

Const sows dropped in transformations

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
328
Forks
13
Avg merge
49m
Merged PRs (30d)
2

Description

Here's an example:

```py
def f(x):
harvest.sow(0, name='x', tag='tag')
return x

print(harvest.reap(f, tag='tag')(1))
print(harvest.reap(lambda x: jax.remat(f), tag='tag')(1))
print(harvest.reap(lambda x: jax.jit(f), tag='tag')(1))
print(harvest.reap(lambda x: jax.lax.cond(x == 1, f, f, x), tag='tag')(1))
print(
harvest.reap(
lambda x: jax.lax.fori_loop(0, 1, lambda i, xx: f(xx), x), tag='tag'
)(1)
)
print(
harvest.reap(
lambda x: jax.lax.fori_loop(0, x, lambda i, xx: f(xx), x), tag='tag'
)(1)
)
```

The first of these reaps contains `'x': 0`, but the others don't.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the Python example using harvest.sow, harvest.reap, and the listed JAX transformations to reproduce the missing constant. Trace how the reaped value is handled through remat, jit, cond, and fori_loop; done means each transformed call preserves the expected 'x': 0 result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.