[Engine] 0.2.22 (gfx1100): gr_write_norm_rs still misses the reference on the scalar fallback (ed5bff88c's own new parity test)

未关闭
#7,345 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp

调研方向

Start with engine/src/prefill/kernels.cu and the failing parity test, engine/tests/hip/prefill_gr_write_norm_parity.cpp. Compare the scalar fallback in gr_write_norm_rs_kernel with the gr_write_kernel plus gr_norm_rs_kernel reference composition for odd strides (ldx = D + 1) on gfx1100. Rebuild and run ctest -R hip_prefill_gr_write_norm_parity; done means all configurations match bitwise.

由索引模型根据 Issue 内容生成。

描述

Area: [Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?: Source (START-HERE.bat, setup.sh or a build)
What happened: see the fenced result below — the named kernel/test mismatch, with the isolation details in the body.
Smallest steps or command that reproduce it: see the fenced block below.
Reproduction status: reproduces on a pristine checkout at the named tag on gfx1100; not fork-specific.
Strata version: 0.2.22 (b28ca95e3)
Graphics card, memory and system: AMD RX 7900 XTX (gfx1100, Navi 31, 24 GiB); Fedora 45, kernel 7.3.4; vendored ROCm SDK 10.2.0a (HIP 7.17.26392, amdclang 24.0.0git)


Hi — we maintain a small gfx1100 replay fork (xyzzing/Strata) and re-play our carried commits onto every upstream tag; the parity pregate in that routine is how this surfaced. Reporting because it is your own new test failing on your own new kernel, in the configurations the test itself added for coverage.

Problem and result

At the v0.2.22 tag (b28ca95e3, engine 0.1.69), on gfx1100 (RX 7900 XTX, ROCm 10.2.0a SDK, amdclang++ 24.0.0git, -O3 --offload-arch=gfx1100, no fast-math), the new test from ed5bff88c fails:

$ ctest -R hip_prefill_gr_write_norm_parity --output-on-failure
T=1     ldx=10240  lo=0 f16=0  identical
T=7     ldx=10240  lo=1 f16=0  identical
T=64    ldx=10240  lo=0 f16=1  identical
T=1000  ldx=10240  lo=1 f16=1  identical
T=4097  ldx=10240  lo=0 f16=0  identical
T=4097  ldx=10304  lo=1 f16=0  identical
MISMATCH rs T=257 ldx=10241 lo=0 f16=0: 18 of 1028 words differ, first at 24
MISMATCH xn16 T=257 ldx=10241 lo=0 f16=0: 1 of 2631936 words differ, first at 1104353
MISMATCH rs T=257 ldx=10241 lo=1 f16=1: 16 of 1028 words differ, first at 84
MISMATCH xn16 T=257 ldx=10241 lo=1 f16=1: 1 of 2631936 words differ, first at 969457
MISMATCH xn16_lo T=257 ldx=10241 lo=1 f16=1: 1176 of 2631936 words differ, first at 215181
RESULT: DIFFERS (1212 words)
  • All aligned configurations pass bit-exact, including the production-shaped padded stride (ldx = D + 64): the #6776 vector-path fix works there, on this card too.
  • Only the odd-stride configurations fail (ldx = D + 1). The commit message reports "with the fix, 0" — we cannot reproduce that on gfx1100 for the D+1 rows.
What the failing rows take

With ldx = 10241, xo = t * ldx + c * N is 4-word aligned only for t ≡ 0 (mod 4) (N = 2560), so ~75% of tokens take the scalar fallback in gr_write_norm_rs_kernel, not the vector path. 18 of 1028 rs values differ — sparse, last-bit class, not a whole-path signature. We checked the scalar fallback against the reference composition (gr_write_kernel + gr_norm_rs_kernel, both launched with 256 threads) line by line: same fmaf(bo, sc, r) expression, same d = threadIdx.x + 256k reduction order, same block_sum, no fast-math to allow reassociation — and could not find a source-level divergence. We are reporting the empirical signature rather than a root cause; the false-positive candidates we falsified (stale reference, contract change, fork interference, loader) are listed below.

Isolation
  • Our replay fork's delta on the failing compilation unit is empty: engine/src/prefill/kernels.cu, prefill.cpp and engine/tests/hip/prefill_gr_write_norm_parity.cpp are upstream-verbatim at our tip, and the fork's cmake delta is link-graph only. Pristine v0.2.22 fails identically by construction.
  • Production is not reachable: the engine's token stride is D or D + XN_PAD with XN_PAD = 64 (src/prefill/prefill.cpp:1008, :5102), both keep every row on the (now bit-exact) vector path. So this is coverage-only on our side — we carry it with a declared exception in our gate rather than a revert, since reverting would resurrect the 1-in-5 rs defect on production rows that #6776 fixed.
  • Falsified: not the test's reference (it is gr_write + gr_norm_rs as two launches, bitwise, and the aligned cases against the same reference pass); not the fork (empty delta, above); not the loader/environment (other HIP parity binaries on the same card pass; the same binary passes 6 of 8 configurations); not a tolerance question (the test is bitwise by design and we changed nothing).
Ask

If you can reproduce ldx = D+1 on an RDNA3 card (or have a hypothesis for what the scalar fallback reads differently from the two-kernel composition — we compared it against gr_norm_rs_kernel's loop statement by statement), we are glad to run diagnostics. Even a confirmation that the "with the fix, 0" claim was measured on aligned shapes only would sharpen the issue.

Environment: Fedora 45, kernel 7.3.4, gfx1100 (Navi 31), vendored ROCm SDK 10.2.0a (HIP 7.17.26392, amdclang 24.0.0git), build flags -O3 --offload-arch=gfx1100 (Release, no fast-math, project defaults).

主要语言
C++
星标
11.6k
派生
1k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Niko1221/Strata 的其他 Issue

查看 Niko1221/Strata 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。