Skip to content

Run adaptive localization in parallel - #228

Merged
dafeda merged 1 commit into
equinor:mainfrom
dafeda:parallel-adloc
Aug 4, 2025
Merged

Run adaptive localization in parallel#228
dafeda merged 1 commit into
equinor:mainfrom
dafeda:parallel-adloc

Conversation

@dafeda

@dafeda dafeda commented Jun 14, 2025

Copy link
Copy Markdown
Collaborator

Using joblib to loop over parameters in parallel when doing adaptive localization.
Added the test test_parallelization_runtime_comparison for benchmarking which uses the fixture large_linear_problem to set-up a problem with lots of parameters and observations.

Synthetic tests

Below is an example run. Results seem promising but more testing is needed.

num_parameters = 100000
num_observations = 200
num_ensemble = 200

--- Benchmark Summary ---
✅ Numerical results are identical.
🚀 Speedup factor: 4.84x

Drogon

Komodo testing 37 min:

image

Komodo testing with parallel version 19 min:

image

Almost 2x speed-up. Note that we in the synthetic test force every parameter to be updated by setting the threshold to 0, while drogon is run with a threshold of 0.3. There might be a significant number of parameters that do not get updated, but I'm not sure.

Memory usage

From docs of joblib.Parallel

  • "Ability to use shared memory efficiently with worker processes for large numpy-based datastructures."

@dafeda dafeda self-assigned this Jun 14, 2025
@dafeda dafeda added this to SCOUT Jun 14, 2025
@dafeda dafeda moved this to In Progress in SCOUT Jun 14, 2025
Comment thread src/iterative_ensemble_smoother/experimental.py Outdated
@dafeda dafeda moved this from In Progress to Ready for Review in SCOUT Jun 17, 2025
Comment thread src/iterative_ensemble_smoother/experimental.py Outdated
return corr_XY

@staticmethod
def _update_single_parameter(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_update_single_parameter_group?


@staticmethod
def _update_single_parameter(
param_num: int,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to provide param_num?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Parallel(n_jobs=n_jobs, return_as="list") (default setting) preserves the order of the outputs.

Comment thread tests/test_experimental.py
Comment thread tests/test_experimental.py

@xjules xjules left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR @dafeda ! 🚀

@github-project-automation github-project-automation Bot moved this from Ready for Review to Reviewed in SCOUT Aug 4, 2025
@dafeda
dafeda merged commit bdfde06 into equinor:main Aug 4, 2025
10 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in SCOUT Aug 4, 2025
@dafeda
dafeda deleted the parallel-adloc branch August 4, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants