metal-flash-attention icon indicating copy to clipboard operation
metal-flash-attention copied to clipboard

Undefined symbols error

Open jafioti opened this issue 1 year ago • 1 comments

Hi, when I try to compile the GEMM kernel, I get an error: Undefined symbol(s) for architecture 'air64':\n '@air.simdgroup_async_copy_2d.p1i8.p3i8', referenced from:\n _Z10_gemm_implIfEvPU9MTLdeviceT_S2_S2_PU14MTLthreadgroupS0_Dv3_jtt in program_sourc

I've made sure to install Xcode 14.2 and follow your instructions, but it doesn't seem to know what that asm instruction is. I'm currently on an M1 Pro Macbook pro.

jafioti avatar Oct 18 '23 13:10 jafioti

Some first attempts to remedy:

  1. What OS version are you on? I compiled this successfully on later macOS 13 minor versions and macOS 14 Beta. Are you directing the script to compile for macOS or for iOS?
  2. Can you narrow exactly where in the build process, the failure occurs? When converting .metal -> .air, or .air -> .metallib? You can try inserting some print("DEBUG MARKER \(any integer)") statements into the build script at different places, then examining where they appear in the output.
  3. Have you tried entering the directly of the metal command from Xcode 14.2, and tested whether that binary will accept metal_simdgroup_event without errors? Next, test whether it will convert GEMM.metal to AIR. Finally, repeat this procedure with the Xcode 15 binary and confirm the results are not the same.

philipturner avatar Oct 18 '23 14:10 philipturner