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

Jupyter tutorials on Windows #95

Open
PhilippPlank opened this issue Nov 23, 2021 · 3 comments
Open

Jupyter tutorials on Windows #95

PhilippPlank opened this issue Nov 23, 2021 · 3 comments
Assignees
Labels
0-needs-review For all new issues 1-bug Something isn't working 2-important/not-urgent Important issues that are not urgent area: tutorials Issues with something in lava/tutorials

Comments

@PhilippPlank
Copy link
Contributor

The usage of multiprocessing on Windows in combination with jupyter notebooks does not work very well (see links below).
Some of our tutorials define the ProcessModels within the jupyter notebook and during run, multiprocessing will try to spawn these models. This will most likely fail with the error
AttributeError: Can't get attribute '<proc_model_name>' on <module '__main__' (built-in)> exitcode = _main(fd, parent_sentinel)

The error will also not show in the notebook, but it will just stall.

The issue is quite known and a combination of problems of Windows and IPython, so this will not be solvable. The recommended solution is to put the code which multiprocessing will use into separate modules and import it in the notebook.

Should we change the tutorials to import all their code (we can still show it) or have a Windows warning/error for some of them?

https://medium.com/@grvsinghal/speed-up-your-python-code-using-multiprocessing-on-windows-and-jupyter-or-ipython-2714b49d6fac
microsoft/vscode-jupyter#941

@PhilippPlank PhilippPlank added 1-bug Something isn't working area: tutorials Issues with something in lava/tutorials labels Nov 23, 2021
@awintel
Copy link
Contributor

awintel commented Nov 23, 2021

Interestingly, this seems to work for some people... What is the difference that makes it work for some? It would be very instructive to keep the PyProcModels in the tutorials.

It does not work for me, but it must have worked for those that created some of the current executable tutorials. Were these never tested on Windows?

@PhilippPlank
Copy link
Contributor Author

PhilippPlank commented Aug 2, 2022

This issue is still present in the 0.4.0 release. We are aware of it and testing different fixes, e.g. PR #259. Such workarounds do solve the issue, but introduce additional code in the juypter tutorial itself.

If anyone has a better solution or idea, feel free to contribute or discuss!

PS: In the longer term perspective we probably move away from the multiprocessing library, which should also solve this issue.

@mathisrichter mathisrichter added the 0-needs-review For all new issues label Jan 3, 2023
@mathisrichter mathisrichter removed this from the feature_jupyter milestone Jan 3, 2023
@mathisrichter mathisrichter added the 2-important/not-urgent Important issues that are not urgent label Jan 3, 2023
@tim-shea
Copy link
Contributor

@PhilippPlank What is the status of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-needs-review For all new issues 1-bug Something isn't working 2-important/not-urgent Important issues that are not urgent area: tutorials Issues with something in lava/tutorials
Projects
None yet
Development

No branches or pull requests

5 participants