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

how to run dso multiple times in a loop #89

Closed
joshkamm opened this issue Feb 2, 2024 · 2 comments
Closed

how to run dso multiple times in a loop #89

joshkamm opened this issue Feb 2, 2024 · 2 comments

Comments

@joshkamm
Copy link

joshkamm commented Feb 2, 2024

Are there any special considerations that need to be taken into account when using DeepSymbolicOptimizer multiple times within a python program?

Currently we are looping over a set of datasets. In each loop iteration we create a new DeepSymbolicOptimizer object and execute training on it. This seems to work when running on a single core other than of course being slow. When running on multiple cores the program seems to deadlock. Specifically, all printing stops and running top on linux reveals all python processes all using 0.0% CPU. When we do a keyboard interrupt, many processes return stack traces that seem to be waiting for locks. If it's helpful we can provide more detail on the code and or the specific stack traces.

@brendenpetersen
Copy link
Collaborator

That's a good question. In general the DeepSymbolicOptimizer object is not thread safe--tensorflow does not make creating multiple TF-based objects like this easy.

One option is to use the n_cores_batch parameter. Your multiple training runs will still run in series, but each one will leverage multiple cores.

Otherwise, for batch tasks, you'll be better off parallelizing the entire program and having each one create a single DeepSymbolicOptimizer object called with your different datasets.

@joshkamm
Copy link
Author

joshkamm commented Feb 6, 2024

Okay thank you for the explanation.

We tried parallelizing the entire program and restricting to one DeepSymbolicOptimizer object per process and that seems to be working.

@joshkamm joshkamm closed this as completed Feb 6, 2024
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

No branches or pull requests

2 participants