Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SemiValue batching and parallelization #490

Open
AnesBenmerzoug opened this issue Jan 22, 2024 · 5 comments
Open

Issue with SemiValue batching and parallelization #490

AnesBenmerzoug opened this issue Jan 22, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@AnesBenmerzoug
Copy link
Collaborator

While working on PR #341, I realized that there is a bug in the batching feature of semivalues when using n_jobs > 1.
The results are almost the same but not exactly the same.

@AnesBenmerzoug AnesBenmerzoug added the bug Something isn't working label Jan 22, 2024
@AnesBenmerzoug
Copy link
Collaborator Author

@kosmitive could you have a look at this if you have time?

@kosmitive
Copy link
Contributor

kosmitive commented Jan 22, 2024

Yes, it might be related to the parallelization as due to parallel processing, the order in which numbers arrive might be prone to a racing condition. I recall this occurs only for semivalues as we break down the calculation to single marginals. Or do you think it might be a different problem?

For the desribed problem, we could introduce a order resolver on the main thread, but at the cost of blowing up RAM on average of about N/2*C where N is the number of processes and C cost per process.

@kosmitive
Copy link
Contributor

@AnesBenmerzoug Here is the reference which was made in the tests

# Occasionally, batch_2 arrives before batch_1, so rtol isn't always 0.
check_values(result_single_batch, result_multi_batch, rtol=1e-4)
. Do we want to go for a order resolution object for the batches?

@AnesBenmerzoug
Copy link
Collaborator Author

@kosmitive I changed that test to use a deterministic scoring method coming from a toy game, so the order of batches shouldn't have an effect on the final result.

@mdbenito mdbenito added this to the v0.10.0 milestone Mar 23, 2024
@schroedk
Copy link
Collaborator

Potentially resolved by #558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants