Repository navigation
Call the device kernel bodies from the host loops of the imports and movement pullbacks - #994
Merged
Merged
Conversation
…movement pullbacks The host pullback of an Allocate with imports restated the per-group body the device kernel runs, and the frame around it; the Redistribute pullbacks restated two per-stratum bodies. Each host loop now calls the shared body. Claude-Session: https://claude.ai/code/session_01WwC7iyvV6w2KCcCWrZ46QL
7 tasks
Contributor
Try this Pull Request!Option 1: Julia Package ManagerOpen Julia and type: import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableRecurrences.jl", rev="claude/host-loops-share-bodies")
using ComposableRecurrencesOption 2: Local CheckoutIf you have the repo locally: git checkout claude/host-loops-share-bodies
julia --project=. -e "using Pkg; Pkg.instantiate()" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #959 (finding 3).
The host pullback of an
Allocatewith imports restated, line for line, the per-group body the device kernel runs (_import_back!) and the frame around it (_device_imports_pullback!).The two
Redistributepullbacks restated two per-stratum bodies (_redistribute_back_body!,_movement_swap!).Each host loop now calls the shared body, as the forward steps of the same modifiers already do.
src/modifiers/allocate.jl: one_imports_pullback!holds the frame; the host and device methods pass it their pass over the groups. The host method still holds no device code.src/modifiers/builtin.jl: the two host loops call the bodies.19 lines added, 57 removed.
No public name changes; the arithmetic and its order are unchanged.
The bodies index under
@inboundswhere the host loops did not; the loops run overeachindex(v, v̄, s̄), so the indices are in bounds either way.What was run
test/unit/allocate.jl,builtin_modifiers.jl,pool_moves.jl: 1361 pass.test/unit/device_rules.jl(1063 pass) andgpu_arrays.jl(524 pass), on JLArrays.test/unit/adjoints.jl: 600 pass.benchmark/ab.jl, 3 rounds, 1 s per cell) againstorigin/mainat 89b8989, Mooncake reverse and Enzyme reverse:cibvd_patch,bvd_patches_callrealisticbvd_zones,zone_allocateThe
rulearm, minimum-time ratio of candidate to base, median over rounds:bvd_patchbvd_patches_callbvd_zoneszone_allocatebvd_patchbvd_patches_callbvd_zoneszone_allocateThe noise bands were ±15% to ±21% for Mooncake on the
citier and wider elsewhere (±18% to ±57%), so these say "no change seen", not "equal".What was not run
The full unit suite, the AD job items under
test/ad, the Runic check, JET, the docs build, and any real GPU.CI covers the first five.
Other work in flight
None of #922, #928, #954 or #955 touches
src/modifiers/allocate.jlorsrc/modifiers/builtin.jl.Generated by Claude Code