Skip to content

[ENH] Add per-stack interpolation options override support#69

Open
Leguark wants to merge 3 commits intocheck_inputfrom
interpolation_options_per_stack
Open

[ENH] Add per-stack interpolation options override support#69
Leguark wants to merge 3 commits intocheck_inputfrom
interpolation_options_per_stack

Conversation

@Leguark
Copy link
Copy Markdown
Member

@Leguark Leguark commented Apr 7, 2026

Add stack-specific interpolation options and override support

Enhanced Stack Configuration

  • Introduced interpolation_options_per_stack in StacksStructure to allow custom interpolation parameters for individual stacks
  • Added interpolation_options property to access stack-specific options based on current stack number
  • Updated _multi_scalar_field_manager and _stack_ops modules to handle stack-specific overrides when computing scalar fields and weights

Refactored Stack Operation Workflow

  • Simplified _stack_ops by extracting _segment_stack and _prepare_solver_input helper functions for better modularity
  • Modified _compute_weights_for_stacks and _segment to use per-stack options instead of global options
  • Updated _evaluate_optimized to collect and pass options per stack to the symbolic evaluator

Enhanced Symbolic Evaluator

  • Modified symbolic_evaluator_optimized_stacked to accept options_list parameter for per-stack interpolation options
  • Improved PyKeOps integration with dynamic enabling/disabling and proper backend handling
  • Enhanced tensor conversion logic to handle LazyTensor objects and ensure proper data types across backends
  • Added CUDA availability checks for conditional GPU stream usage

Improved Kernel Constructor

  • Updated _upgrade_kernel_input_to_keops_tensor_numpy and _upgrade_kernel_input_to_keops_tensor_pytorch to handle axis specification for 2D tensors
  • Simplified _cast_tensors function to use backend-specific upgrade functions
  • Enhanced tensor stacking logic in _build_stacked_kernel_data with better type handling and GPU memory management

Testing and Validation

  • Added comprehensive tests for stack-specific interpolation options in both serial and flat execution modes
  • Included backward compatibility tests to ensure existing workflows remain functional
  • Verified different interpolation ranges produce distinct scalar field results per stack

Leguark added 3 commits April 7, 2026 15:38
- Introduced `interpolation_options_per_stack` in `StacksStructure` to allow custom interpolation parameters for individual stacks.
- Updated `_multi_scalar_field_manager` and `_stack_ops` modules to handle stack-specific overrides when computing scalar fields and weights.
- Added tests to verify the behavior of stack-specific interpolation (serial and flat execution modes) and backward compatibility with global options.
…in symbolic evaluator

- Simplified `_stack_ops` by introducing helper functions for segmentation and preprocessing.
- Allowed `symbolic_evaluator_optimized_stacked` to accept per-stack interpolation options.
- Ensured compatibility with GPU support and batch execution workflows.
- Updated tests to validate new behavior under different execution modes.
…workflows

- Enabled `pykeops` dynamically for scalar and gradient kernel computations with fallback mechanisms.
- Standardized tensor conversions to ensure compatibility across backends.
- Improved support for `LazyTensor` in evaluation workflows and fault data processing.
- Refactored kernel input upgrades to handle backend-specific logic cleanly.
@Leguark Leguark changed the title [ENH] Add stack-specific interpolation options and override support [ENH] Add per-stack interpolation options override support Apr 7, 2026
Copy link
Copy Markdown
Member Author

Leguark commented Apr 7, 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.

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