Skip to content

Future of for_loop? #26297

Answered by mattjj
lockwo asked this question in General
Feb 4, 2025 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Thanks for asking!

As you may know, we added array references and effectful operations on them to JAX for the purpose of decomposing scan into something more flexible. Then that machinery turned into the basis of Pallas, and Pallas has basically sidetracked us ever since. We kept meaning to get back to landing for_loop...

Now the plan is to unbundle things further: where for_loop builds in the introduction of array references (in the sense that they are introduced as lambda-binders in the body function), we plan to separate that out into top-level mutable array creation. With that, the loop construct itself gets even simpler. (See this test file to get a flavor.)

That further unbundling r…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lockwo
Comment options

Answer selected by lockwo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants