Repository navigation
Conversation
- Add DistributedArray._like to build result arrays without checks or collectives (the sub-communicator is reused, so masked arrays no longer call Comm.Split for every result), and cache local_shapes after the first allgather. Use it in __neg__, add, multiply, conj, copy, zeros_like and empty_like, and in StackedDistributedArray.zeros_like/empty_like. - Add out= to add and multiply, add subtract, and make __iadd__, __isub__ and the new __imul__ true in-place operators (single pass, no temporary). An out= that needs an unsafe cast falls back to assignment as before. - Use ravel instead of flatten in dot and norm, add _local_dot and _local_sqnorm, and add a 2-norm fast path with one float64 allreduce and no float64 temporaries (complex data is reduced through a real view). - Add tests (CPU, cupy and NCCL). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rray - add, subtract and multiply accept out= (and scalars); each allocates its result once with empty_like (or uses out/self) and the children write directly into it, recursing into nested stacks. Add subtract and __imul__, make __isub__ in-place and __neg__ a single multiply. - dot and norm (2-norm) sum the local partial results of all the leaves and run a single allreduce when every leaf is SCATTER, unmasked and shares the communicators; otherwise they use the per-child loop as before. - Add tests (CPU, cupy and NCCL) for nested out=/in-place arithmetic and for fused versus fallback reductions, including the number of allreduces. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- CG and CGLS update x, r, s, c and q in place using the in-place operators of DistributedArray and StackedDistributedArray (Opc, and the previous r in CGLS, are reused as scratch space), and use vdot=True instead of conj() for the dot products of a vector with itself. - CGLS skips the damping work (x * damp, x.dot(x)) when damp is zero, and needs 3 allreduces per iteration (2 for CG) instead of 5-10. - The residual in the setup of CG and CGLS is written into the output of the matvec instead of allocating a new array. - Add tests (CPU, cupy and NCCL): CGLS with and without damping compared to serial pylops (also checking that y and x0 are not modified) and the number of allreduces per iteration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #215 - see Issue for details.
NOT READY FOR REVIEW