-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MRG, ENH: Fix memory on CircleCI #8379
Conversation
Looks like the culprit was our volume source space Ready for review/merge from my end. |
e4134e3
to
e64e200
Compare
I don't expect this @GuillaumeFavelier can you take a look and approve if you're happy? Then I'll merge once the latest-matplotlib fix is merged upstream (nilearn). |
I'll review right now |
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.
+1 for tools/circleci_download.sh
Just one question but except from that LGTM
d8a80c5
to
37da9e1
Compare
Okay looks like #8352 was probably the culprit as it added a reference cycle due to bound methods. Locally before 8abd6ff getting partway through a Now after 20 minutes of running I get a baseline around ~2GB instead of the ~5GB above: I've added a
@GuillaumeFavelier can you take another look? It looks like what really needed to happen was cleaning up the bound methods of If the circle full passes, I'm going to add this GC reference check for Brain so that hopefully these get flagged in the future. I tried it already to see if we could fix "plot_montage.py", but it turns out that there are no references to |
Nevermind, all of this can be closed afterwards with |
13ce561 passed with Clearly there are some examples that could be improved, but at least it got us back to green. I pushed an empty commit with another |
Travis is far from happy, I am working on |
Worst case scenario, we can remove |
Let's do that for now with a |
That's it for the TODO, should I push now or wait that Circle is done? |
Feel free to push now, don't bother with |
resmat = np.absolute(resmat) # only use absolute values | ||
# we want to use absolute values, but doing abs() mases a copy and this | ||
# can be quite expensive in memory. So let's just use abs() in place below. |
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.
FYI @olafhauk these matrices can be quite large (~8000x8000), so instead of doing this operation here, I've moved it to be done column-wise. It shouldn't be an appreciable performance difference but it should lower memory usage by ~800 MB in the plot_resolution_metrics.py
example.
@GuillaumeFavelier I worry that the
I think we should prioritize fixing PyVista, getting a PR merged there, and then hopefully soon-ish get rid of our workarounds here. |
This is homemade hack basically 😓
Agreed 👍 |
I can reproduce the failures of
|
This sounds like a comment for pyvista/pyvista#958 :) |
Whoops |
It seems that the brain has been off-road in |
Yes probably in the change from |
@GuillaumeFavelier maybe we should add |
I think that's the default when |
mne-python/mne/viz/backends/_pyvista.py Lines 771 to 774 in 278608f
|
Okay then let's just update the broken example and the ones that manually set |
* upstream/master: Fix separate canvas (mne-tools#8408) FIX: focalpoint (mne-tools#8405) WIP: Refs (mne-tools#8406) tiny cosmetic improvements to BEM code (mne-tools#8404) MRG, ENH: Fix memory on CircleCI (mne-tools#8379) MRG: Update backend parameter in stc.plot() (mne-tools#8395)
Closes #8375