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

feat(beamform): delete some class list attributes in 'process_finish'. #242

Merged
merged 1 commit into from
May 16, 2023

Conversation

ljgray
Copy link
Contributor

@ljgray ljgray commented May 2, 2023

These lists can hold fairly large chunks of data which will not get cleared from memory until one pipeline iteration after .finish is called, which often happens out of order

@jrs65
Copy link
Contributor

jrs65 commented May 2, 2023

Oh great, did this work in the end?

@ljgray
Copy link
Contributor Author

ljgray commented May 2, 2023

Oh great, did this work in the end?

It helps, but the root of the issue was with the pipeline run order. It calls setup on both BeamFormCat tasks as soon as the sidereal stream is made, which causes both to generate these vis copies. So I'll have another PR to tweak the config

@tristpinsm
Copy link
Contributor

If this is a common performance issue, would it make sense to purge all attributes in SingleTask.finish?

@ljgray
Copy link
Contributor Author

ljgray commented May 12, 2023

If this is a common performance issue, would it make sense to purge all attributes in SingleTask.finish?

I don't see any issues with doing that off the top of my head, other than keeping the attribute that handles pipeline state

@jrs65
Copy link
Contributor

jrs65 commented May 12, 2023

Purging all attributes is a little risky as you don't know if the user might want access to them later (for instance for people running the pipeline in a notebook for testing).

I think for the moment doing what you are doing here is good. I think a more general fix needs to go into caput.pipeline. I wondered if there would be a minimal fix that would allow us to remove tasks early, but I don't think there is. We would need to change the way the pipeline tasks signal they are done in a fairly invasive way.

@tristpinsm
Copy link
Contributor

does finish get called if you are running a task in a notebook?

@jrs65
Copy link
Contributor

jrs65 commented May 12, 2023

Yup

@ljgray
Copy link
Contributor Author

ljgray commented May 12, 2023

Purging all attributes is a little risky as you don't know if the user might want access to them later (for instance for people running the pipeline in a notebook for testing).

I think for the moment doing what you are doing here is good. I think a more general fix needs to go into caput.pipeline. I wondered if there would be a minimal fix that would allow us to remove tasks early, but I don't think there is. We would need to change the way the pipeline tasks signal they are done in a fairly invasive way.

I've been playing with the run order a bit, and I do think we could at least remove finished tasks after they finish without too much of a change, but if we're going to be making changes like that I'd rather look at modifying the pipeline runner as a whole

@ljgray
Copy link
Contributor Author

ljgray commented May 12, 2023

Purging all attributes is a little risky as you don't know if the user might want access to them later (for instance for people running the pipeline in a notebook for testing).

I think for the moment doing what you are doing here is good. I think a more general fix needs to go into caput.pipeline. I wondered if there would be a minimal fix that would allow us to remove tasks early, but I don't think there is. We would need to change the way the pipeline tasks signal they are done in a fairly invasive way.

Assume this means its good to merge?

These lists can hold fairly large chunks of data which will not get
cleared from memory otherwise.
@ljgray ljgray merged commit ee31bc3 into master May 16, 2023
@ljgray ljgray deleted the clear-extra-attrs branch May 16, 2023 18:13
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.

3 participants