fix: concat_ofi_features uses state_dim_padded stride, not state_dim

states_buf has stride pad128(state_dim) for CUTLASS alignment. The
concat_ofi kernel was reading with stride state_dim → OOB for sample 1+.
With state_dim=50, pad=128: sample 1 OFI at offset 128+42=170, but
kernel read at 50+42=92 (sample 0 padding area). Silent data corruption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-04-15 13:56:05 +02:00
parent 3794134416
commit f4059a7510

View File

@@ -1438,7 +1438,8 @@ impl GpuDqnTrainer {
};
let b = self.config.batch_size as i32;
let sh2 = self.config.shared_h2 as i32;
let sd = self.config.state_dim as i32;
// states_buf has stride state_dim_padded (pad128), NOT state_dim
let sd = ((self.config.state_dim + 127) & !127) as i32;
let total = b * (sh2 + 3);
let blocks = ((total as u32 + 255) / 256).max(1);
let vsn_masked_ptr = self.vsn_masked_buf.raw_ptr();