Skip to content

[ENH] Parallelize solver input preparation using ThreadPoolExecutor#55

Merged
Leguark merged 4 commits intomainfrom
optimize_yield_cov
Mar 20, 2026
Merged

[ENH] Parallelize solver input preparation using ThreadPoolExecutor#55
Leguark merged 4 commits intomainfrom
optimize_yield_cov

Conversation

@Leguark
Copy link
Copy Markdown
Member

@Leguark Leguark commented Mar 13, 2026

[ENH] Parallelize solver input preparation using ThreadPoolExecutor

  • Refactored stack operations to enable parallel preparation of solver inputs.
  • Introduced thread-safe handling of stack_structure to avoid race conditions.
  • Improved efficiency and scalability by replacing sequential loops with concurrent execution.

[ENH] Refactor GPU tensor handling and evaluator logic

  • Added conditionals for GPU usage to streamline tensor preparation and movement.
  • Improved contiguity enforcement and asynchronous GPU transfers in evaluator workflows.
  • Enhanced backend configuration logic by refining BackendTensor methods for modularity.
  • Fixed minor formatting and consistency issues across backend and evaluator modules.

[ENH] Add optimized stack weight computation and improve GPU synchronization

  • Implemented _compute_weights_for_stacks_single_thread to support stack weight calculations.
  • Added explicit GPU synchronization for enhanced eGPU stability.
  • Resolved minor formatting inconsistencies across evaluator and stack modules.

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:27
@Leguark Leguark force-pushed the optimize_yield_cov branch from b246cfc to 93929d4 Compare March 18, 2026 14:45
@Leguark Leguark force-pushed the optimize_grad_vs_scalar branch 2 times, most recently from 29a2e9a to b45b42e Compare March 18, 2026 15:53
@Leguark Leguark force-pushed the optimize_yield_cov branch 2 times, most recently from 641cb34 to ef940ad Compare March 19, 2026 16:26
@Leguark Leguark force-pushed the optimize_grad_vs_scalar branch from b45b42e to 03da7bd Compare March 19, 2026 16:26
@Leguark Leguark force-pushed the optimize_yield_cov branch from ef940ad to c4b6af1 Compare March 19, 2026 16:58
@Leguark Leguark force-pushed the optimize_grad_vs_scalar branch 2 times, most recently from 5887561 to d8df52f Compare March 20, 2026 10:10
@Leguark Leguark force-pushed the optimize_yield_cov branch from c4b6af1 to 1dcf3fb 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, 11:00 AM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 20, 11:05 AM UTC: @Leguark merged this pull request with Graphite.

@Leguark Leguark changed the base branch from optimize_grad_vs_scalar to graphite-base/55 March 20, 2026 10:54
@Leguark Leguark changed the base branch from graphite-base/55 to main March 20, 2026 10:59
Leguark added 4 commits March 20, 2026 11:00
- Refactored stack operations to enable parallel preparation of solver inputs.
- Introduced thread-safe handling of `stack_structure` to avoid race conditions.
- Improved efficiency and scalability by replacing sequential loops with concurrent execution.
- Added conditionals for GPU usage to streamline tensor preparation and movement.
- Improved contiguity enforcement and asynchronous GPU transfers in evaluator workflows.
- Enhanced backend configuration logic by refining `BackendTensor` methods for modularity.
- Fixed minor formatting and consistency issues across backend and evaluator modules.
…ization

- Implemented `_compute_weights_for_stacks_single_thread` to support stack weight calculations.
- Added explicit GPU synchronization for enhanced eGPU stability.
- Resolved minor formatting inconsistencies across evaluator and stack modules.

# Conflicts:
#	gempy_engine/API/interp_single/_stack_ops.py
- Enhanced tensor handling by enabling `.to("cuda")` during tensor preparation in `symbolic_evaluator`.
- Introduced `BackendTensor.clear_gpu_memory()` to explicitly manage GPU memory.
- Added `gc.collect()` for improved resource cleanup after computations.
@Leguark Leguark force-pushed the optimize_yield_cov branch from 1dcf3fb to 46fd8a1 Compare March 20, 2026 11:00
@Leguark Leguark merged commit 73a0e25 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