Summary
After applying the updated hardware contract from #29 (the output of TROWSUM uses physical Columns = 1 and ValidCols = 1), the full SuperNPUBench RMSNorm kernel still cannot compile.
The minimal type-instantiation test in #29 (comment) does not instantiate tile operations, so it does not cover the failures below.
Versions
- Linx-TileOP-API:
dacedc2
- llvm-project / installed clang:
76044f43610027d016191453b9a60bbdc329e3e9
- clang version:
15.0.4 (linx64v5-musl-local 76044f...)
- SuperNPUBench: tag
20260823 plus the RMSNorm change below
Required RMSNorm change
The row-reduction output is declared with one physical column:
Tile<Vec, float, tA, 1, RowMajor, tA, 1> row_sum;
For the reproducer parameters below, this becomes Tile<float, 2, 1, RowMajor, 2, 1>.
Reproduction
From:
SuperNPUBench/benchmark/one-level-arch/test/kernel/normalization/rms_norm
run:
make TESTCASE=rms_norm_static \
DType=__half G_A=16 G_R=512 TILE_A=2 TILE_R=512 PE_NUM=1 \
COMPILER_DIR=/home/wangyu/Code/PtoNpu/linx-toolchain-build/output/linx_blockisa_llvm_musl/bin \
res_check=on all
Actual result
Compilation fails in TileOP inline assembly. Two concrete problems are visible:
1. %D dtype modifier is not printed
include/jcore/template_asm.hpp emits, for example:
The installed compiler reports an invalid operand, and the rendered instruction has no dtype:
template_asm.hpp:1781: invalid operand for instruction
BSTART.TLOAD
LinxV5AsmPrinter::PrintAsmOperand at LLVM commit 76044f4 handles %S and %Z, but does not handle %D.
2. A narrow Rows x 1 tile has no valid physical TSize
Tile<float, 2, 1, ...> currently has StorageBytes = 8. However, the active B.IOT tile size range starts at 128B. TilesizeCode is therefore invalid and the emitted assembly contains an empty size:
This also contradicts the stated hardware contract that physical rows are inferred from TSize / (physical Columns * element bytes): with physical Columns fixed to 1, TileOP still needs a representable physical TSize (presumably at least 128B), while retaining logical/valid rows as 2.
Expected result
The complete TLOAD -> TROWSUM -> subsequent tile ops/TSTORE RMSNorm path should compile when the reduction output has physical Columns = 1 and ValidCols = 1.
In particular:
- TileOP and the supported LLVM revision should agree on how dtype operands such as
%D are rendered.
- Non-cube tiles smaller than 128B should receive a legal physical carrier/TSize without changing their logical shape and valid dimensions.
Why this is different from #29
#29's original alignment assertion was removed, but the comment's verification only compiled a minimal tile declaration to an object file. It did not instantiate operations that require dtype rendering or B.IOT TSize encoding. The full normalization kernel exercises both and remains blocked.
Summary
After applying the updated hardware contract from #29 (the output of
TROWSUMuses physicalColumns = 1andValidCols = 1), the full SuperNPUBench RMSNorm kernel still cannot compile.The minimal type-instantiation test in #29 (comment) does not instantiate tile operations, so it does not cover the failures below.
Versions
dacedc276044f43610027d016191453b9a60bbdc329e3e915.0.4 (linx64v5-musl-local 76044f...)20260823plus the RMSNorm change belowRequired RMSNorm change
The row-reduction output is declared with one physical column:
For the reproducer parameters below, this becomes
Tile<float, 2, 1, RowMajor, 2, 1>.Reproduction
From:
run:
Actual result
Compilation fails in TileOP inline assembly. Two concrete problems are visible:
1.
%Ddtype modifier is not printedinclude/jcore/template_asm.hppemits, for example:The installed compiler reports an invalid operand, and the rendered instruction has no dtype:
LinxV5AsmPrinter::PrintAsmOperandat LLVM commit76044f4handles%Sand%Z, but does not handle%D.2. A narrow
Rows x 1tile has no valid physical TSizeTile<float, 2, 1, ...>currently hasStorageBytes = 8. However, the active B.IOT tile size range starts at 128B.TilesizeCodeis therefore invalid and the emitted assembly contains an empty size:This also contradicts the stated hardware contract that physical rows are inferred from
TSize / (physical Columns * element bytes): with physical Columns fixed to 1, TileOP still needs a representable physical TSize (presumably at least 128B), while retaining logical/valid rows as 2.Expected result
The complete
TLOAD -> TROWSUM -> subsequent tile ops/TSTORERMSNorm path should compile when the reduction output has physicalColumns = 1andValidCols = 1.In particular:
%Dare rendered.Why this is different from #29
#29's original alignment assertion was removed, but the comment's verification only compiled a minimal tile declaration to an object file. It did not instantiate operations that require dtype rendering or B.IOT TSize encoding. The full normalization kernel exercises both and remains blocked.