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

DM-39582: Decrease memory usage and load times when reading graphs #348

Merged
merged 9 commits into from
Jul 4, 2023

Conversation

natelust
Copy link
Contributor

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@natelust natelust requested a review from andy-slac June 27, 2023 21:26
Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -0,0 +1 @@
Deprecated reconstituteDimensions argument from QuantumNode.from_simple
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably removal.md instead of api.md?

Comment on lines 225 to 227
runner = PersistenceContextVars()
graph = runner.run(self.deserializer.constructGraph, nodeSet, _readBytes, universe)
return graph # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not entirely understand PersistenceContextVars/context vars, would it be nice if it could work like a regular context manager, e.g.:

with PersistenceContextVars():
   return self.deserializer.constructGraph(nodeSet, _readBytes, universe)

but may be it's not possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked on that for a while, and the outcome kept coming out more awkward, and not at all nice like that. I think it is mostly because context vars are more geared toward asyncio, callback programming style.

@natelust natelust force-pushed the tickets/DM-39582 branch 3 times, most recently from 89015ec to 620e96b Compare June 30, 2023 22:33
@natelust natelust changed the title tickets/DM039582 tickets/DM-39582 Jun 30, 2023
@timj timj changed the title tickets/DM-39582 DM-39582: Decrease memory usage and load times when reading graphs Jun 30, 2023
@natelust natelust force-pushed the tickets/DM-39582 branch 2 times, most recently from 8b2305b to 80046aa Compare July 4, 2023 01:00
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.07 ⚠️

Comparison is base (806fb6d) 82.82% compared to head (44f5f6c) 82.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
- Coverage   82.82%   82.75%   -0.07%     
==========================================
  Files          66       66              
  Lines        7242     7237       -5     
  Branches     1410     1291     -119     
==========================================
- Hits         5998     5989       -9     
- Misses        999     1000       +1     
- Partials      245      248       +3     
Impacted Files Coverage Δ
python/lsst/pipe/base/executionButlerBuilder.py 66.21% <0.00%> (ø)
python/lsst/pipe/base/graph/_implDetails.py 44.69% <ø> (ø)
python/lsst/pipe/base/graphBuilder.py 63.68% <ø> (ø)
...ython/lsst/pipe/base/script/transfer_from_graph.py 12.50% <0.00%> (ø)
...ython/lsst/pipe/base/tests/mocks/_pipeline_task.py 34.54% <0.00%> (+0.61%) ⬆️
python/lsst/pipe/base/pipeline.py 66.05% <25.00%> (ø)
python/lsst/pipe/base/connections.py 77.85% <37.50%> (-0.28%) ⬇️
python/lsst/pipe/base/_quantumContext.py 86.39% <60.00%> (ø)
python/lsst/pipe/base/graph/quantumNode.py 88.70% <85.71%> (-0.58%) ⬇️
python/lsst/pipe/base/_instrument.py 84.92% <100.00%> (ø)
... and 5 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Fixing mypy annotations revealed a small bug in adjustQuantum with
dataset type names, this commit also fixes that.
@natelust natelust merged commit 07d78ed into main Jul 4, 2023
@natelust natelust deleted the tickets/DM-39582 branch July 4, 2023 13:39
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

Successfully merging this pull request may close these issues.

2 participants