Imaging.apply_mask: trim the native arrays to the mask plus a PSF half-width, so the FFT frame follows the mask rather than the stamp #43
|
While fitting JWST lenses I noticed that the size of the image a mask is cut from, not the mask, sets the cost of every PSF convolution in a fit. I would like to propose a small change to Symptom. Proposal.
Nothing a fit sees changes: the slim arrays, the blurring region and the convolution are identical (to FFT rounding), and the mask and data are unchanged so search identifiers are unchanged: a trimmed chain resumes an untrimmed one and vice versa. On a synthetic 200 px stamp with a 1.6" mask and an 11 px PSF a parametric What a user does see change: Numbers (
Per-call GPU timings still to come; the memory saving is what let me raise the batch size. The question for you: should the packaged default be on or off? The branch ships it on ( |
Replies: 5 comments
|
The per-call GPU timings promised above, measured on both of our cluster's card types. Same method as described for the PR: a PyAutoArray-only benchmark on JWST-F150W-like geometry (400 px stamp at 0.03"/px, 1.5" mask = 7860 pixels, 37 x 37 PSF, 30 x 30 mesh = 900 mapping columns), timing
~4x per call on both cards; trimmed agrees with untrimmed to 1.5e-07 relative (fp32 FFT rounding). The memory rows are what matters for a pixelized search (memory ~ batch x source pixels x frame): batch 20 is impossible untrimmed even on 48 GB, and batch 8 untrimmed only just fits on 24 GB, while trimmed batch 20 uses 16.4 GB. |
|
@samlange04 thank you, and sorry it took two weeks to answer. The GPU table makes the case: ~4× per call and batch-20 fits that previously ran out of memory on both cards is a real gain for JWST pixelized fits. I've reviewed PyAutoLabs/PyAutoArray#675. On your question: keep it on by default. Nothing a fit sees changes, and every masked fit gets the smaller frame for free. Before merging we'll run our workspace smoke scripts with it on, to catch any example that mixes native arrays from before and after Two small requests:
Once the smoke run is clean we'll merge it, and it will go out in the next release. |
|
@samlange04 a follow-up after running our workspace smoke suites on the PR (merged with current
Both come from changing the dataset's native frame, and looking at it, the convolver doesn't need that. We'll make that change on our side, building on your |
|
@samlange04 here it is: PyAutoLabs/PyAutoArray#699, with you as co-author on both commits. Your What we've checked so far:
If you have a moment, could you re-run your GPU benchmark on the PR branch, on the A6000 and 4090? Your numbers are the ones that matter for JWST fits. Once it's merged we'll close #675 in its favour, and it goes out in the next release. |
|
@samlange04 PyAutoLabs/PyAutoArray#699 is now merged, with you as co-author, and goes out in the next release, after which |
@samlange04 PyAutoLabs/PyAutoArray#699 is now merged, with you as co-author, and goes out in the next release, after which
pip install -U autolenspicks it up. PyAutoLabs/PyAutoArray#675 is closed in its favour. If you get a chance to re-run your GPU benchmark on the A6000 and 4090 once it's out, we'd still be glad to see the numbers. Thanks again for finding this and doing the measurements. Closing this as done.