You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Sad Catapella N6][Performance/Memory] RGB apply allocates multiple full float32 intermediates instead of a fused bounded-memory transform #53
Normalization Batch 6 at f784c95e3049483f87466150ffc5764375fa631d. Confirmed allocation pattern, peak RSS and speed improvement hypotheses require benchmarks. No tests executed and no source modified.
Evidence
apply_rgb() lines 58–74 copies each input image to float32 and uses ((x-mi)/(ma-mi+eps)), creating at least subtraction/output temporary arrays in standard NumPy evaluation.
CSBDeep implementation optionally uses numexpr to evaluate the same fused float32 expression; this is a useful benchmark comparator, not a reason to add a dependency or presume parity/performance.
Optimization and Numba requirements
Benchmark a preallocated float32 output and sequential np.subtract(..., out=output), np.divide(..., out=output) to reduce whole-image intermediates while retaining the exact CSBDeep float32 operation order. Compare existing NumPy, preallocated ufuncs, optional numexpr, and only then a fused numba.njit kernel where dtype/layout trade-offs justify JIT startup. The return must never share memory with input (even float32), and RGB output must be bitwise identical to the direct CSBDeep reference—not just close. Include uint8/uint16, constant zero-scale, varied R/G/B values, noncontiguous C-first/C-last, RGB patches and full FOVs (e.g. 256² to 8192²), cold/warm compiled timing, peak RSS, allocations and threads. Do not silently substitute approximate arithmetic or new clipping semantics. Keep Numba optional only if measured improvements justify complexity; no benchmark result claimed.
Activity
Compute apply_rgb in the one float32 copy instead of two extra tempor…