Skip to content

[WIP] Prepare for pykeops ranges#53

Merged
Leguark merged 15 commits intomainfrom
optimize_eval_keops
Mar 20, 2026
Merged

[WIP] Prepare for pykeops ranges#53
Leguark merged 15 commits intomainfrom
optimize_eval_keops

Conversation

@Leguark
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Leguark commented Mar 13, 2026

@Leguark Leguark marked this pull request as ready for review March 18, 2026 14:26
@Leguark Leguark force-pushed the optimize_evaluation branch from f3de5d0 to be4c916 Compare March 18, 2026 14:45
@Leguark Leguark force-pushed the optimize_eval_keops branch 2 times, most recently from 27415eb to 5e404d9 Compare March 18, 2026 15:53
@Leguark Leguark changed the base branch from optimize_evaluation to graphite-base/53 March 20, 2026 09:14
@Leguark Leguark force-pushed the optimize_eval_keops branch from e117d96 to 3fd95b3 Compare March 20, 2026 10:10
Copy link
Copy Markdown
Member Author

Leguark commented Mar 20, 2026

Merge activity

  • Mar 20, 10:28 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 20, 10:48 AM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 20, 10:53 AM UTC: @Leguark merged this pull request with Graphite.

@Leguark Leguark changed the base branch from graphite-base/53 to main March 20, 2026 10:47
Leguark added 15 commits March 20, 2026 10:48
- 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.
… 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.

# Conflicts:
#	gempy_engine/API/interp_single/_multi_scalar_field_manager.py
@Leguark Leguark force-pushed the optimize_eval_keops branch from 3fd95b3 to 5643c97 Compare March 20, 2026 10:48
@Leguark Leguark merged commit f9cda85 into main Mar 20, 2026
2 checks passed
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