Archived
unlimitedocr: tiled/base e2e parity, per-segment tower layout, n-gram whitelist
The pass packer now keeps a view and its one-cell separator in one pass, and RadBatch carries each segment's grid host-side (enc_seg_h/enc_seg_w) so the DeepEncoder no longer reads device coordinates to pick a geometry. The tower lays out a line of n tiles as kMap rows of n*kMap features plus one newline cell, accepts an earlier chunk of a longer line, and emits the learned view_seperator for an explicit 4x4 separator rather than any square segment. The device sam_attn resamples a rel_pos table that is not 2*tile-1 rows on read (the 127-row global tables serve a 40-grid block as 79), matching libref/libavx. The n-gram ban gains the reference's optional whitelist (5th operand, OAI keys, generation_config alias) with range/dtype checks. Gates: tiled e2e stage cosines 0.9994-1.0, det/text 0.9901 with every coordinate within 1 px; two-page 0.9917 within 2 px; device selftest sam_attn (incl. 127->79) and ngram whitelist (1344 columns) 0 mismatches.
This commit is contained in:
1 parent
fad4ba7f1a
commit
52637ec186
37 files changed
+401566
-778
No files matched your search
+14
-1
@@ -119,6 +119,8 @@ int Engine::run_encodes() {
|
||||
|
||||
size_t i = 0;
|
||||
int32_t seg = 0;
|
||||
int32_t seg_grid = 0; /* the pass's view grid; a pass is one geometry (a tower refuses
|
||||
a mixed one: its position tables and grids are per geometry) */
|
||||
while (i < mine.size()) {
|
||||
std::vector<BatchBuilder::EncoderPart> parts;
|
||||
int64_t np = 0;
|
||||
@@ -126,16 +128,27 @@ int Engine::run_encodes() {
|
||||
mm::Item& it = *mine[i];
|
||||
const int32_t first = seg;
|
||||
for (; seg < it.n_seg; ++seg) {
|
||||
const int32_t g = it.seg_h(seg);
|
||||
/* The one-output-row view separator (core/mm marks it explicitly) belongs to
|
||||
* the pass of the view before it, so it neither breaks at a "grid change" nor
|
||||
* sets the pass's grid. A square segment that is a real view (a chunked line
|
||||
* of one tile) keeps the ordinary geometry rule below. */
|
||||
const bool sep = it.seg_is_sep(seg);
|
||||
const int64_t seg_p = it.patch_at(seg + 1) - it.patch_at(seg);
|
||||
if (seg_p > max_p) {
|
||||
RAD_ERR("encoder: a segment of %lld patches does not fit a pass of %lld",
|
||||
(long long)seg_p, (long long)max_p);
|
||||
return RAD_E_STATE;
|
||||
}
|
||||
if (!sep && np > 0 && seg_grid != 0 && g != seg_grid) break;
|
||||
if (np + seg_p > max_p) break;
|
||||
np += seg_p;
|
||||
if (!sep) seg_grid = g;
|
||||
}
|
||||
if (seg == first) {
|
||||
if (seg_grid == 0) seg_grid = it.seg_h(seg); /* a lone oversized segment */
|
||||
break;
|
||||
}
|
||||
if (seg == first) break;
|
||||
parts.push_back({ &it, first, seg - first });
|
||||
if (seg == it.n_seg) { ++i; seg = 0; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user