perf(keep): derive the chunk's detection frames in one grouped pass

The round-4 fused crop loops re-derived each frame's detection image with
one single-row converter call per frame - N host sync points where the
round-3 crop did one batch. The grouped form converts the chunk's gathered
rows in one elementwise pass (bitwise the per-row rows) and is bounded by
the caller's chunk; the paste-fallback row form stays. Pins guard the
conversion count. The paste stage itself is proven byte-equivalent to
32e6628 (dispatch, cores, tails); timed CPU stubs show no superlinear
term in either tree - the real-box burn needs the owner's log to attribute
(the device-mode verdict under real VRAM pressure is the only paste-stage
quantity this diff can move).
This commit is contained in:
WildAi
2026-10-29 00:55:54 +03:00
parent 3af08f4357
commit e2fdbbf453
3 changed files with 79 additions and 27 deletions
+6
View File
@@ -765,6 +765,12 @@ def test_the_detection_pass_converts_at_most_a_group_at_a_time(
"the detection pass must convert through the module function"
)
assert max(before_the_first_keep) <= 2, before_the_first_keep
# The fused crop loop re-derives the chunk's detection images in ONE
# group conversion per chunk (the grouped D-R2.2.1) - the per-row
# re-derivations of the first round-4 cut are gone: across the whole
# run only the detection groups, the crop groups and the paste stage's
# second convert-in may call the converter (2 * ceil(3 / 2) + 1 = 5).
assert len(conversions) <= 5, conversions
@pytest.mark.unit