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

[pallas] Disallow capturing of consts by kernel functions #22746

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

gnecula
Copy link
Collaborator

@gnecula gnecula commented Jul 30, 2024

Previously this was allowed, but until recently (#22550) it was
not working correctly in many cases. Now we disallow const
capturing because it can lead to surprises. Instead, the
kernel function must receive all the arrays it needs as explicit
inputs, with proper block specs.

@gnecula gnecula self-assigned this Jul 30, 2024
@gnecula gnecula added the pull ready Ready for copybara import and testing label Jul 30, 2024
@gnecula gnecula force-pushed the pallas_consts branch 3 times, most recently from f06be19 to fc15da8 Compare July 30, 2024 13:45
@gnecula gnecula requested a review from superbobry July 30, 2024 13:45
Copy link
Collaborator

@superbobry superbobry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to also drop const hoisting from run_state, since we are moving towards making pallas_call a wrapper around run_state?

CC @sharadmv

Previously this was allowed, but until recently (jax-ml#22550) it was
not working correctly in many cases. Now we disallow const
capturing because it can lead to surprises. Instead, the
kernel function must receive all the arrays it needs as explicit
inputs, with proper block specs.
@copybara-service copybara-service bot merged commit d696813 into jax-ml:main Jul 31, 2024
13 of 14 checks passed
@gnecula gnecula deleted the pallas_consts branch August 1, 2024 05:28
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants