Open
Conversation
* the current `develop` branch appears to not be parallel safe as described at kokkos#60 (comment) * this branch allows pykokkos to compile/run code both in serial and in parallel by providing genuinely unique identifiers (file paths) to each "compilation unit"; careful though, this will slow down the serial execution time for the testsuite substantially, probably because it removes reuse in favor of safety from a compilation standpoint--there's probably an approach that is both fast and safe, and I'm certainly open to that, but I'd also argue that safe and slow > (parallel) unsafe and fast * combined with kokkosgh-60, this allows: - `OMP_NUM_THREADS=1 python runtests.py -n 10` - `123 passed, 9 skipped, 9 xfailed, 16 warnings in 92.10s (0:01:32)` - that's more than twice as fast as the serial test run on `develop` - `python runtests.py` - `123 passed, 9 skipped, 9 xfailed, 16 warnings in 212.40s (0:03:32)` - however, this branch slows down the serial test run a lot, to 11.5 minutes! * of course, you'd probably have to thoroughly test `OMP_NUM_THREADS` values and so on to benchmark the hierarchical parallelism situation to determine scenarios where you'd even want to use "parallel pykokkos," but I certainly think we should try to be "safe" for concurrent usage so that we don't impose a certain model of concurrency on our consumers
tylerjereddy
commented
Aug 22, 2022
| # the same module/class; try using the memory loc of the Python | ||
| # metadata object | ||
| mem_id = id(metadata) | ||
| dirname: str = f"{filename}_{metadata.name}_{mem_id}" |
Contributor
Author
There was a problem hiding this comment.
There must be a scheme that's both fast and safe? Giving each "compilation unit" its own specific directory was the easiest approach I could think of, but presumably the serial test run is so much faster on develop because sharing a directory either allows reuse of some previously-compiled code and/or of some shared common compiled bits between different workunits/kernels?
Contributor
Author
|
With whatever final solution gets adopted here, a regression test on i.e., the directory structure that is decided upon for compilation would probably be a good idea as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the current
developbranch appears to not be parallelsafe as described at WIP, ENH: support parallel runtests #60 (comment)
this branch allows pykokkos to compile/run code both
in serial and in parallel by providing genuinely unique
identifiers (file paths) to each "compilation unit"; careful though,
this will slow down the serial execution time for the testsuite
substantially, probably because it removes reuse in favor
of safety from a compilation standpoint--there's probably an approach
that is both fast and safe, and I'm certainly open to that, but
I'd also argue that safe and slow > (parallel) unsafe and fast
combined with WIP, ENH: support parallel runtests #60, this allows:
OMP_NUM_THREADS=1 python runtests.py -n 10123 passed, 9 skipped, 9 xfailed, 16 warnings in 92.10s (0:01:32)developon the same machinepython runtests.py123 passed, 9 skipped, 9 xfailed, 16 warnings in 212.40s (0:03:32)(3:18withOMP_NUM_THREADS=1)minutes!
of course, you'd probably have to thoroughly test
OMP_NUM_THREADSvalues and so on to benchmark the hierarchical parallelism situation
to determine scenarios where you'd even want to use "parallel pykokkos,"
but I certainly think we should try to be "safe" for concurrent usage
so that we don't impose a certain model of concurrency on our
consumers