dit dump: velocity-head isolation shadows (b_hn video rows + b_nout table row)

The per-block window verdict showed the block stack faithful to its quantization
floor (cos 0.98 -> 0.78 smooth decay over blocks 0-19, cascade at 20), leaving
the 7.6x step-0 velocity-std gap pointing at the FinalLayer. Dump its two own
operands so a CPU replay can judge them without the trunk: norm_out's modulated
stream over the first 256 video rows (bf16 -> f32 cast shadow) and lane/step's
shift|scale table row. The driver writes them as dit_hn.f32 / dit_nout.f32
after the existing slab files.

Replay verdict (compare_head.py, dasiwa-w8a8 dump): the table's video cell
equals t8 @ norm_out.linear + bias to the bf16 floor (relFro 1.5e-3, no silu --
the curve form bakes it, a_temb.x aliases b_temb), and the checkpoint head
reproduces the device velocity exactly (row cos 1.000000, affine 1.0000). The
head and its modulation are faithful; the vel-std gap is a harness-side
statistic, not a device op.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
gearwave00001andClaude committed 2026-10-21 21:37:50 -05:00
1 parent c783a7cb72
commit f617cbafb5
4 files changed
+90 -24

No files matched your search

+20 -10
View File
@@ -324,7 +324,10 @@ int VideoDriver::init(const Program& prog, PositionsFn positions,
dit_temb_b_ = decl_.dbg_dit_temb_bytes;
dit_mod_b_ = decl_.dbg_dit_mod_bytes;
dit_blk_b_ = decl_.dbg_dit_blk_bytes;
const int64_t sum = dit_h0_b_ + dit_vel_b_ + dit_temb_b_ + dit_mod_b_ + dit_blk_b_;
dit_hn_b_ = decl_.dbg_dit_hn_bytes;
dit_nout_b_ = decl_.dbg_dit_nout_bytes;
const int64_t sum = dit_h0_b_ + dit_vel_b_ + dit_temb_b_ + dit_mod_b_ + dit_blk_b_
+ dit_hn_b_ + dit_nout_b_;
dit_host_ = static_cast<char*>(rad_dev_alloc(sum, RAD_MEM_HOST_PINNED));
dit_dbg_ = dit_host_ != nullptr;
if (!dit_dbg_)
@@ -1204,10 +1207,12 @@ const RadBatch* VideoDriver::build_step(Job& j, int step) {
if (dit_dbg_ && j.step == 0 && !small && !j.ref_wide && j.ref_tab.empty()) {
char* p = dit_host_;
int64_t off = 0;
const rad_buf hh[5] = { decl_.dbg_dit_h0, decl_.dbg_dit_temb, decl_.dbg_dit_mod,
decl_.dbg_dit_blk, decl_.dbg_dit_vel };
const int64_t nn[5] = { dit_h0_b_, dit_temb_b_, dit_mod_b_, dit_blk_b_, dit_vel_b_ };
for (int i = 0; i < 5; ++i)
const rad_buf hh[7] = { decl_.dbg_dit_h0, decl_.dbg_dit_temb, decl_.dbg_dit_mod,
decl_.dbg_dit_blk, decl_.dbg_dit_hn, decl_.dbg_dit_nout,
decl_.dbg_dit_vel };
const int64_t nn[7] = { dit_h0_b_, dit_temb_b_, dit_mod_b_, dit_blk_b_, dit_hn_b_,
dit_nout_b_, dit_vel_b_ };
for (int i = 0; i < 7; ++i)
if (hh[i] && nn[i] > 0) {
rb_.push_back(Readback{ hh[i], nn[i], p + off });
off += nn[i];
@@ -1505,9 +1510,9 @@ int VideoDriver::done() {
case RAD_GEN_PASS_VSTEP: {
++j->step;
if (dit_used_) {
/* The step-0 dump landed: slab (h0 | temb | mod | blk | vel) to raw files, plus the few
* facts the driver knows (R4D_ENC_DUMPDIR; the prep script supplies D=5376 and the
* harness .meta files). */
/* The step-0 dump landed: slab (h0 | temb | mod | blk | hn | nout | vel) to raw
* files, plus the few facts the driver knows (R4D_ENC_DUMPDIR; the prep script
* supplies D=5376 and the harness .meta files). */
char* p = dit_host_;
dit_dump_file("dit_h0.f32", p, (size_t)dit_h0_b_);
p += dit_h0_b_;
@@ -1517,6 +1522,10 @@ int VideoDriver::done() {
p += dit_mod_b_;
dit_dump_file("dit_blk.f32", p, (size_t)dit_blk_b_);
p += dit_blk_b_;
dit_dump_file("dit_hn.f32", p, (size_t)dit_hn_b_);
p += dit_hn_b_;
dit_dump_file("dit_nout.f32", p, (size_t)dit_nout_b_);
p += dit_nout_b_;
dit_dump_file("dit_vel.f32", p, (size_t)dit_vel_b_);
if (std::getenv("R4D_ENC_DUMPDIR")) {
const std::string path =
@@ -1530,9 +1539,10 @@ int VideoDriver::done() {
}
}
RAD_ERR("dit_dbg: dumped step 0 -- rows %lld h0 %lld temb %lld mod %lld blk %lld "
"vel %lld",
"hn %lld nout %lld vel %lld",
(long long)dit_rows_, (long long)dit_h0_b_, (long long)dit_temb_b_,
(long long)dit_mod_b_, (long long)dit_blk_b_, (long long)dit_vel_b_);
(long long)dit_mod_b_, (long long)dit_blk_b_, (long long)dit_hn_b_,
(long long)dit_nout_b_, (long long)dit_vel_b_);
dit_used_ = false;
}
VideoEvent e;