hcc
hcc copied to clipboard
Linker error for Reduce kernel with "short" type
Hipcc gives a clang linker error when linking the attached test case for a Reduce kernel. Please note that the failure only occurs for "short" type, whereas "int32_t" etc. work fine (you can uncomment the relevant parts of the test case and change the "#define TYPE" to "int32_t" instead of "short" to test it out). Let me know if you need a more reduced testcase.
@jithunnair-amd could also provide error log you are seeing with "short" type?
Commands I used to reproduce the linker error: hipcc -o super_simple_reducemax_kernel.o -c super_simple_reducemax_kernel.cu hipcc super_simple_reducemax_kernel.o
Linker error:
rocm-user@a69b1b7130d8:~/pytorch__hc2_v4__clean/TEMP$ hipcc super_simple_reducemax_kernel.o
LLVM ERROR: Cannot select: 0x2f61a40: v2i16 = SMAX3 0x2f619d8, 0x2f61768, 0x2f514f8
0x2f619d8: v2i16 = SMAX3 0x2f3c788, 0x2f51560, 0x2f61288
0x2f3c788: v2i16 = SMAX3 0x2f369e0, 0x2f37470, 0x2f51970
0x2f369e0: v2i16 = smax 0x2f36ff8, 0x2f378e8
0x2f36ff8: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %33
0x2f3baf0: v2i16 = Register %33
0x2f378e8: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %34
0x2f370c8: v2i16 = Register %34
0x2f37470: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %35
0x2f3be98: v2i16 = Register %35
0x2f51970: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %36
0x2f37540: v2i16 = Register %36
0x2f51560: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %37
0x2f517d0: v2i16 = Register %37
0x2f61288: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %38
0x2f515c8: v2i16 = Register %38
0x2f61768: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %39
0x2f61630: v2i16 = Register %39
0x2f514f8: v2i16,ch = CopyFromReg 0x2e8f0d0, Register:v2i16 %40
0x2f50e78: v2i16 = Register %40
In function: _Z26superSimpleReduceMaxKernelIs9ReduceMaxIsEEvPT_iS2_T0_S3_
Generating AMD GCN kernel failed in llc for target: gfx900
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
Died at /opt/rocm/bin/hipcc line 501.
@acmeman925 From the look of it, it could be an issue in LC backend. Could you help assign someone familiar with the backend to look at it? Thanks!
This is fixed in an upcoming release (probably not from the 1.8.x branch though).
I think this can be closed now? Although if someone can provide the resolution details and version where fixed, that'd be more complete.