Summary
During -tune on FFT spec 1:512:8:512:202 (FFT_FP32=1, NTT_GF61=1, NTT_GF31=0), the tuner tests TAIL_TRIGS31=1 successfully on the tail kernel, selects it as best, and then fails to compile fftp.cl with a type mismatch in fftbase.cl. The tuner exits and the tuning run is aborted.
Environment
- OS: Windows (AMD GPU, compiled via comgr / ROCm OpenCL)
- FFT spec:
1:512:8:512:202 (FP32 + GF61 NTT)
Error
In file included from ...\input\CompileSource:1:
In file included from ...\include\fftp.cl:5:
In file included from ...\include\fftwidth.cl:18:
...\include\fftbase.cl:1136:8: error: assigning to '__private F2' (aka '__private float2') from incompatible type 'ulong2' (vector of 2 'ulong' values)
1136 | base = U2(fma(a, -w.y, w.x), fma(a, w.x, -w.y));
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error: Failed to compile source (from CL or HIP source to LLVM IR).
Full compile args of the failing kernel:
-cl-finite-math-only -cl-std=CL2.0 -DFAST_BARRIER=0 -DINPLACE=0 -DIN_SIZEX=8 -DIN_WG=256
-DLOADS=11010 -DMIDDLE_IN_LDS_TRANSPOSE=1 -DMIDDLE_OUT_LDS_TRANSPOSE=1 -DOUT_SIZEX=32
-DOUT_WG=256 -DPAD=0 -DSTORES=10 -DTAIL_KERNELS=2 -DTAIL_TRIGS31=1 -DTAIL_TRIGS32=0
-DEXP=126152063u -DWIDTH=512u -DSMALL_HEIGHT=512u -DMIDDLE=8u -DCARRY_LEN=8u -DNW=8u -DNH=8u
-DAMDGPU=1 -DCARRY64=1 -DFFT_VARIANT=202u -DMAXBPW=3166u
-DWEIGHT_STEP=0.896059698234141 -DIWEIGHT_STEP=-0.47259044589612292
-DTAILT=U2(-1.88247177e-05f,0.00613588467f) -DTRIG_SCALE=9
-DTRIG_SIN={...} -DTRIG_COS={...}
-DTAILTGF61=U2(807738046998073027ull,30095103403839256ull) -DFFT_TYPE=2 -DWordSize=8u
-DDISTGF61=1048576ull -DDISTWTRIGGF61=132416ull -DDISTMTRIGGF61=768ull -DDISTHTRIGGF61=132416ull
-DFRAC_BPW_HI=330693631u -DFRAC_BPW_LO=4294967295u -DFFT_FP32=0? (actual: -DFFT_FP32=1) -DNTT_GF31=0 -DNTT_GF61=1
Analysis
The failing line is in the FP32 (F2) version of chainMul4 in fftbase.cl:
F2 base = csqTrig(w);
...
F a = mul2(base.y);
base = U2(fma(a, -w.y, w.x), fma(a, w.x, -w.y)); // <-- error here
U2() is overload-resolved by argument type (base.cl: float -> float2, ulong -> ulong2). With TAIL_TRIGS31=1 in this FP32+GF61 configuration, w/the fma operands on this code path resolve to the GF61 ulong types, so U2() returns ulong2, which cannot be assigned to the F2 base — compile fails.
It looks like TAIL_TRIGS31=1 combined with FFT_FP32=1 + NTT_GF61=1 (and NTT_GF31=0) is an untested code-path combination — TAIL_TRIGS31 presumably targets the GF31 NTT, which is disabled in this variant.
Steps to reproduce
- Run
-tune on an AMD GPU with FFT 1:512:8:512:202.
- The tuner's isolated
TAIL_TRIGS31=1 test compiles and times fine (only the tail kernel is rebuilt), and gets selected as best (1722.4 vs 1753.7 in my run).
- The next compile of
fftp.cl (which includes fftbase.cl with TAIL_TRIGS31=1 now globally set) fails as above, and the program exits: Exiting because "Can't compile fftp.cl".
Impact / workaround
- The whole tuning run aborts partway through.
- Workaround: pin
-use TAIL_TRIGS31=0 and re-run tune (giving up the ~1.8% improvement measured for TAIL_TRIGS31=1).
Perhaps the tuner should also skip TAIL_TRIGS31 when NTT_GF31=0, or validate the flag combination before selecting it.-
(我运行 prpll-ntt_win64-opencl_20260525 但是失败了。用的是AMD RX 9060 XT)
(我不知道是什么错误🥲使用qwenLLM后-让我提交的)
Summary
During
-tuneon FFT spec1:512:8:512:202(FFT_FP32=1, NTT_GF61=1, NTT_GF31=0), the tuner testsTAIL_TRIGS31=1successfully on the tail kernel, selects it as best, and then fails to compilefftp.clwith a type mismatch infftbase.cl. The tuner exits and the tuning run is aborted.Environment
1:512:8:512:202(FP32 + GF61 NTT)Error
Full compile args of the failing kernel:
Analysis
The failing line is in the FP32 (
F2) version ofchainMul4infftbase.cl:U2()is overload-resolved by argument type (base.cl:float -> float2,ulong -> ulong2). WithTAIL_TRIGS31=1in this FP32+GF61 configuration,w/thefmaoperands on this code path resolve to the GF61ulongtypes, soU2()returnsulong2, which cannot be assigned to theF2 base— compile fails.It looks like
TAIL_TRIGS31=1combined withFFT_FP32=1 + NTT_GF61=1(andNTT_GF31=0) is an untested code-path combination —TAIL_TRIGS31presumably targets the GF31 NTT, which is disabled in this variant.Steps to reproduce
-tuneon an AMD GPU with FFT1:512:8:512:202.TAIL_TRIGS31=1test compiles and times fine (only the tail kernel is rebuilt), and gets selected as best (1722.4 vs 1753.7 in my run).fftp.cl(which includesfftbase.clwithTAIL_TRIGS31=1now globally set) fails as above, and the program exits:Exiting because "Can't compile fftp.cl".Impact / workaround
-use TAIL_TRIGS31=0and re-run tune (giving up the ~1.8% improvement measured forTAIL_TRIGS31=1).Perhaps the tuner should also skip
TAIL_TRIGS31whenNTT_GF31=0, or validate the flag combination before selecting it.-(我运行 prpll-ntt_win64-opencl_20260525 但是失败了。用的是AMD RX 9060 XT)
(我不知道是什么错误🥲使用qwenLLM后-让我提交的)