Repository navigation
vision tower test: the join's two row counts, pinned on a real pack with no oracle needed (#2324) - #2338
vision tower test: the join's two row counts, pinned on a real pack with no oracle needed (#2324)#2338bong-water-water-bong wants to merge 1 commit into
Conversation
…ith no oracle needed
`npu/vision_plan.h` defines `PiecePlan::rows` as "grid_h/4 * grid_w/4" -- the rows the text model receives -- and
`npu/vision_tower.h:44` says the optional `tower` out-parameter receives "step 5's output, (gh/2 x gw/2, hidden): the tower
*before* the merger". Two different quantities, one merger apart, and until now the only place they were forced to agree was
`minicpm_image_probe.cpp:252,260` -- at run time, on a 21 GB text model.
This adds that to the tower's own test, gated on `ONEBIT_MINICPM_PACK` alone:
out.size() / geometry().out_hidden == plan.source.rows one text row per placeholder
tower.size() == (gh/2) * (gw/2) * hidden the tower before the merger
Measured on the real `MiniCPM-V-4.7-35B-A3B-NPU2` vision component: **17 checks, 0 failed**. Without the pack the arm prints
"did not run" and the suite reports 15 checks, so CI -- which has no pack -- is unaffected.
Three things worth knowing, all of which cost me a failed attempt first:
1. **The plan is built at four patches per side, not at the pack's 980-pixel image.** `scale_resolution` must be at least
`4 * patch`, and a larger request is *resized* by `best_resize()`, which silently changes the grid the plan describes. 4 * patch
is the smallest geometry the planner leaves alone, and this arm is about the row counts rather than about running a 70 x 70
grid on four cores.
2. **The first version of this arm compared the plan against `tower`, and was wrong by exactly the merger's second halving** --
`tower` is the pre-merger buffer. That is the mistake the arm now pins against.
3. `const vis::Pack pk(std::string(pdir));` is a *function declaration* (most vexing parse); it needs a named string.
The reference arm is unchanged: it still needs `ONEBIT_MINICPM_ORACLE` for its pixel/tower/out goldens, and this one deliberately
needs nothing but the pack a lane already has.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Closing as superseded — by #2335, which landed (6) and (8) properly, and by my own premise going stale. When I opened this, the justification was that the join's two row counts were checked only by What this PR did add, for the record, is the one thing still not covered elsewhere: the invariant on a real pack ( Closing rather than rebasing: a test whose stated reason for existing has been fixed by a better change is maintenance, not evidence. |
|
VERDICT: READY This is the right place to put this invariant, and it fixes a real gap in where a bad assumption could have lived. Two quantities one merger apart, pinned against the geometry rather than against each other: Pinning both against
The failure path is deliberate and I agree with it: a pack that opens and then throws reports One note, and it is about the next reader rather than this change: the comment explains that Not verified by me: a run against a real MiniCPM pack ( |
vision tower test: the join's two row counts, pinned on a real pack with no oracle needed
npu/vision_plan.hdefinesPiecePlan::rowsas "grid_h/4 * grid_w/4" -- the rows the text model receives -- andnpu/vision_tower.h:44says the optionaltowerout-parameter receives "step 5's output, (gh/2 x gw/2, hidden): the towerbefore the merger". Two different quantities, one merger apart, and until now the only place they were forced to agree was
minicpm_image_probe.cpp:252,260-- at run time, on a 21 GB text model.This adds that to the tower's own test, gated on
ONEBIT_MINICPM_PACKalone:Measured on the real
MiniCPM-V-4.7-35B-A3B-NPU2vision component: 17 checks, 0 failed. Without the pack the arm prints"did not run" and the suite reports 15 checks, so CI -- which has no pack -- is unaffected.
Three things worth knowing, all of which cost me a failed attempt first:
scale_resolutionmust be at least4 * patch, and a larger request is resized bybest_resize(), which silently changes the grid the plan describes. 4 * patchis the smallest geometry the planner leaves alone, and this arm is about the row counts rather than about running a 70 x 70
grid on four cores.
tower, and was wrong by exactly the merger's second halving --toweris the pre-merger buffer. That is the mistake the arm now pins against.const vis::Pack pk(std::string(pdir));is a function declaration (most vexing parse); it needs a named string.The reference arm is unchanged: it still needs
ONEBIT_MINICPM_ORACLEfor its pixel/tower/out goldens, and this one deliberatelyneeds nothing but the pack a lane already has.