WPF Parallelization fails
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 279
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Description
There have been reports of the mpire distributed WPF optimization failing with errors like
AttributeError: Can't pickle local object 'WholePatternFit._fit_distributed.<locals>.f
This appears to only affect Windows systems.
I think the fix is to enable dill serialization:
https://github.com/py4dstem/py4DSTEM/blob/113763791edae292060eaf817216eda7d289d352/py4DSTEM/process/wholepatternfit/wpf.py#L748-L753
should be modified to become:
with WorkerPool(
n_jobs=num_jobs,
shared_objects=fit_opts,
use_dill=True,
) as pool:
mpire produces threads differently on Windows vs UNIX and so there can be serialization errors that only show up one one platform when transmitting complicated objects to threads. Unfortunately I do not have a Windows machine to test this on at the moment, so someone else will have to try this and let us know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in py4DSTEM/process/wholepatternfit/wpf.py at the WorkerPool setup around lines 748-753 and review how the distributed WPF fit is serialized. Apply the proposed serialization setting, then run the distributed WPF optimization on Windows. Done means the fit completes without the reported local-object pickle error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100