Skip to content

[WIP] Prepare for pykeops ranges#53

Open
Leguark wants to merge 15 commits intooptimize_evaluationfrom
optimize_eval_keops
Open

[WIP] Prepare for pykeops ranges#53
Leguark wants to merge 15 commits intooptimize_evaluationfrom
optimize_eval_keops

Conversation

@Leguark
Copy link
Member

@Leguark Leguark commented Mar 13, 2026

[WIP] Prepare for pykeops ranges

[WIP] foo

[ENH] Replace _evaluate with _evaluate_optimized in _stack_ops for improved performance

[ENH] Implement kernel stacking and enable PyKeOps backend

  • Added _build_stacked_kernel_data to concatenate kernel inputs across fields for efficient evaluation.
  • Integrated scalar kernel creation logic with create_scalar_kernel.
  • Enabled PyKeOps backend by default in _stack_ops and tests configuration.
  • Refactored kernel evaluation logic in symbolic_evaluator to support stacked kernel inputs.

[ENH] Ranges working

[CLN] Remove unused symbolic_evaluator_optimized and outdated helper functions

  • Deleted the symbolic_evaluator_optimized function and redundant block-sparse range builders to streamline the codebase.
  • Cleaned up unused logic and comments for better maintainability and clarity.

[CLN] Simplify field concatenation logic in symbolic_evaluator

[WIP]

[ENH] Improve symbolic evaluator handling and update test configuration

  • Added None check in symbolic_evaluator to prevent unnecessary processing of empty inputs.
  • Enhanced field concatenation logic to handle non-ndarray values gracefully.
  • Updated test configuration to enable mesh_extraction by default for better test coverage.

[ENH] Integrate torch backend into symbolic evaluator and improve tensor handling

  • Added torch for enhanced tensor operations within symbolic_evaluator.
  • Replaced numpy operations with BackendTensor.t for compatibility with PyTorch.
  • Enhanced exception handling for lazy tensor operations with PyKeOps.
  • Improved splitting and concatenation logic for flexibility across tensor backends.

[CLN] Inline backend string retrieval in symbolic evaluator

[ENH] Parallelize stacking

[ENH] Parallelize gradient preparation and enhance GPU tensor handling

  • Implemented parallelization for gradient preparation using ThreadPoolExecutor.
  • Improved tensor handling by enforcing contiguity and moving tensors to GPU asynchronously where applicable.
  • Refactored _stack_sub_struct for cleaner GPU and backend support.
  • Replaced redundant logic with generalized and scalable approaches for efficiency.

Copy link
Member Author

Leguark commented Mar 13, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Leguark added 13 commits March 18, 2026 16:53
- Added `_build_stacked_kernel_data` to concatenate kernel inputs across fields for efficient evaluation.
- Integrated scalar kernel creation logic with `create_scalar_kernel`.
- Enabled PyKeOps backend by default in `_stack_ops` and tests configuration.
- Refactored kernel evaluation logic in `symbolic_evaluator` to support stacked kernel inputs.
…r functions

- Deleted the `symbolic_evaluator_optimized` function and redundant block-sparse range builders to streamline the codebase.
- Cleaned up unused logic and comments for better maintainability and clarity.
- Added `None` check in `symbolic_evaluator` to prevent unnecessary processing of empty inputs.
- Enhanced field concatenation logic to handle non-ndarray values gracefully.
- Updated test configuration to enable `mesh_extraction` by default for better test coverage.
…sor handling

- Added `torch` for enhanced tensor operations within `symbolic_evaluator`.
- Replaced `numpy` operations with `BackendTensor.t` for compatibility with PyTorch.
- Enhanced exception handling for lazy tensor operations with PyKeOps.
- Improved splitting and concatenation logic for flexibility across tensor backends.
- Implemented parallelization for gradient preparation using `ThreadPoolExecutor`.
- Improved tensor handling by enforcing contiguity and moving tensors to GPU asynchronously where applicable.
- Refactored `_stack_sub_struct` for cleaner GPU and backend support.
- Replaced redundant logic with generalized and scalable approaches for efficiency.
@Leguark Leguark force-pushed the optimize_eval_keops branch from 27415eb to 5e404d9 Compare March 18, 2026 15:53
Leguark added 2 commits March 19, 2026 17:25
… interpolation

- Introduced a new `GEMPY_FLAT_STACKS` environment variable to control the interpolation strategy dynamically.
- Updated `_multi_scalar_field_manager` to support conditional stack selection based on the environment variable.
- Removed unused commented code in `_stack_ops` for improved readability.
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.

1 participant