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
Reduce memory usage of scheduler process - Optimize scheduler.py::TaskState class #8331
Reduce memory usage of scheduler process - Optimize scheduler.py::TaskState class #8331
Conversation
02d1844
to
eb69001
Compare
9ed69f1
to
67a80cf
Compare
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 27 files ±0 27 suites ±0 13h 41m 1s ⏱️ - 1h 13m 13s For more details on these failures, see this check. Results for commit 45447a6. ± Comparison against base commit 0dc9e88. ♻️ This comment has been updated with latest results. |
67a80cf
to
f952b61
Compare
Okay, @fjetter I think this is ready for a proper review then. Failing tests don't seem related, (ran most/all of those failing here locally fine as well). |
I think summarizing my review
|
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
[skip ci] Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
if self.scheduler.validate: | ||
assert self not in ts.who_has | ||
assert ts not in self.has_what |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed add_replica to be idempotent so this validation is no longer valid
test failures are all unrelated |
Co-authored-by: Florian Jetter <fjetter@users.noreply.github.com>
kind of sad considering all the failures... |
Part of #7998
The first approach in ef4b7dd moved things into descriptors, which would only assign a value when being accessed. This results in ~34% reduction in memory when compared to main. Downside was there is some boilerplace for each attribute requiring a lazy creation (albeit this could be generalized by prefixing each with
__lazy_
for example then iterating on those annotations after initialization..)Second approach, the current direction of this PR, uses optionals for more attributes in this class. Primarily those using
set
/dict
. This results in ~42% reduction in memory when compared to main. Downside is much more changed code, checking forNone
everywhere and the tests are currently wildly broken. 😅Snippet I'm using for this comparison to main:
cc @fjetter