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

Introducing partial discharge rules and implementations for cond_p #23947

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Sep 26, 2024

Introducing partial discharge rules and implementations for cond_p

As things stand you can partially discharge a jaxpr with
discharge_state(should_discharge=[...]) but each equation is discharges all
its arguments. This means that primitives like scan_p and cond_p discharge
all references they refer to (no pun intended) regardless of whether the user
asked for it. We provide a special discharge rule that is preferred to the
normal one when present that allows the op to discharge only some of the
references.

This feature is especially useful for pallas kernels because contrary to all
other contexts where jaxprs are expected to eventually be fully discharged,
pallas kernels lower references all the way to the runtime as pointers or
MLIR memrefs.

Here we implement the partial discharge rule for cond_p and will implement it
for others in due course.

@copybara-service copybara-service bot force-pushed the test_678665716 branch 3 times, most recently from 4f6e21b to f8c8630 Compare September 30, 2024 14:19
@copybara-service copybara-service bot changed the title Introducing partial discharge rules and implementations for cond_p and for_p Introducing partial discharge rules and implementations for cond_p Sep 30, 2024
@copybara-service copybara-service bot force-pushed the test_678665716 branch 12 times, most recently from 3512936 to 795aebd Compare October 1, 2024 14:37
@copybara-service copybara-service bot closed this Oct 1, 2024
@copybara-service copybara-service bot deleted the test_678665716 branch October 1, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants