Update profiling setup - #354
Merged
Merged
Conversation
max-models
force-pushed
the
update-dependencies
branch
from
August 21, 2026 08:16
42cc75a to
68e9906
Compare
max-models
marked this pull request as ready for review
August 21, 2026 08:28
max-models
marked this pull request as draft
August 21, 2026 12:08
Contributor
|
📖 Docs preview: https://struphy-hub.github.io/docs-preview/pr-354/ |
max-models
marked this pull request as ready for review
August 21, 2026 12:37
max-models
enabled auto-merge (squash)
August 21, 2026 13:06
max-models
disabled auto-merge
August 22, 2026 09:54
Member
|
That looks great - looking forward to testing it! |
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.
Updated scope-profiler to 0.3.3. There are some big improvements in the postprocessing in this version. Especially for GPU profiling and also line-by-line profiling for the regions we already defined using the tool without having to use line_profiler directly.
For example, please try running this param file:
Then inspect the profiling file in the terminal with
With
scope-profiler > 0.3.0, there is a new optional syntax for the profiling manager. Instead of writingProfilingManager.setup(...)and thenProfilingManager.finalize(), it is now possible to define the start and stop of the profiling manager work using contexts, just as is done with the profiling regions.For example (from the scope-profiler readme
For us, this means we can use this syntax in
sim.run(), so we don't need the_setup_profiling()method. Everything insim.run()is just indented by one tab afterwith ProfileManager.session(...):, but in the diff it looks like there is a much bigger diff... I promise there isn't though.Changes in the code:
functions=[...]toProfileManager.profile_regioncalls which are profiling a very small scope, most likely just a function. When line profiling is turned on, this means that the lines inside that function are profiled, not just the line for the function call itself.For example:
ProfilingOptionsclass to specify profiling option in the parameter files, this class is automatically added to the scripts withstruphy params MODEL. This class basically mirrors the parameters used inscope-profilerprofiling_activatedfrom theEnvironmentOptionsclass and moved it tosim.run(profiling_activated=profiling_activated)insteadtutorials/tutorial_scope_profiling.ipynb