feat: add Vlasov 2D distributed initialization#285
Merged
Conversation
…rd_to_partitioned - helpers.py: compute each component's density profile once and reuse for both n_prof_species and the unsharded f_one path (previously evaluated twice on the host path). - distributed.py: docstring note on reshard_for_global_axis_fft warning that declaring shardings on jax.jit lets XLA's SPMD partitioner do this work automatically. Add symmetric reshard_to_partitioned helper that restores the canonical partitioned layout (typically used after an inverse FFT). - tests: round-trip test for reshard_for_global_axis_fft + reshard_to_partitioned. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
grid.distribution-shardingconfig for Vlasov-2D distribution initializationNamedShardinghelpers andmake_array_from_callbackmachinery to initialize globalf(x, y, vx, vy)arrays shard-by-shardNotes
grid.distribution-sharding.enabledis truenoise_type: noneornoise_val: 0.0) because the existing noise profile is shape-seeded and would otherwise repeat per shardreshard_for_global_axis_ffthelperVerification
uvx ruff format adept/_vlasov2d tests/test_vlasov2d/test_distributed_init.pyuvx ruff check adept/_vlasov2d tests/test_vlasov2d/test_distributed_init.pyuv run pytest tests/test_vlasov2d/test_distributed_init.py -q→ 4 passeduv run pytest tests/test_vlasov2d -q; existing long solver case was still CPU-bound after ~20 minutes, so I stopped it after the targeted tests had passed