Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift : exclude ggml-metal-embed.metal #10211

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Conversation

jhen0409
Copy link
Collaborator

@jhen0409 jhen0409 commented Nov 8, 2024

This fixes the build of llama.swiftui. If we run build like make before, the ggml-metal-embed.metal file will be included in the build in llama.swiftui.

xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
Error Logs
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination generic/platform=iOS build

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    SDKROOT = iphoneos18.0

2024-11-08 09:54:40.335 xcodebuild[61982:482265]  DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion.
2024-11-08 09:54:40.339 xcodebuild[61982:482199] [MT] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion.
Resolve Package Graph


Resolved source packages:
  llama: /Users/jhen/workspace/llama.cpp

Prepare packages

note: Using codesigning identity override: 
ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (4 targets)
    Target 'llama.swiftui' in project 'llama.swiftui'
        ➜ Explicit dependency on target 'llama' in project 'llama'
    Target 'llama' in project 'llama'
        ➜ Explicit dependency on target 'llama' in project 'llama'
        ➜ Explicit dependency on target 'llama_llama' in project 'llama'
    Target 'llama' in project 'llama'
        ➜ Explicit dependency on target 'llama_llama' in project 'llama'
    Target 'llama_llama' in project 'llama' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Users/jhen/workspace/llama.cpp/examples/llama.swiftui/llama.swiftui/Assets.xcassets

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --version --output-format xml1

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc --version

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -x c++ -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -version_details

Build description signature: d2370de4dd8d7d574a58e327859d35cd
Build description path: /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/XCBuildData/d2370de4dd8d7d574a58e327859d35cd.xcbuilddata
ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk /Users/jhen/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.0-22A3362-8ec3fe4dca91fa9a941eaa2d5faad0e4.sdkstatcache
    cd /Users/jhen/workspace/llama.cpp/examples/llama.swiftui/llama.swiftui.xcodeproj
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -o /Users/jhen/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.0-22A3362-8ec3fe4dca91fa9a941eaa2d5faad0e4.sdkstatcache

CompileMetalFile /Users/jhen/workspace/llama.cpp/ggml/src/ggml-metal-embed.metal (in target 'llama_llama' from project 'llama')
    cd /Users/jhen/workspace/llama.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal -c -target air64-apple-ios14.0 -I/Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/include -F/Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -fmetal-math-mode\=fast -fmetal-math-fp32-functions\=fast -serialize-diagnostics /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal-embed.dia -o /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal-embed.air -MMD -MT dependencies -MF /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal-embed.dat /Users/jhen/workspace/llama.cpp/ggml/src/ggml-metal-embed.metal
/Users/jhen/workspace/llama.cpp/ggml/src/ggml-metal-embed.metal:479:28: warning: unused variable 'ksigns64' [-Wunused-const-variable]
GGML_TABLE_BEGIN(uint64_t, ksigns64, 128)
                           ^
1 warning generated.

ProcessInfoPlistFile /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/llama_llama.bundle/Info.plist /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/empty-llama_llama.plist (in target 'llama_llama' from project 'llama')
    cd /Users/jhen/workspace/llama.cpp
    builtin-infoPlistUtility /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/empty-llama_llama.plist -producttype com.apple.product-type.bundle -expandbuildsettings -format binary -platform iphoneos -requiredArchitecture arm64 -o /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/llama_llama.bundle/Info.plist

MetalLink /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/llama_llama.bundle/default.metallib (in target 'llama_llama' from project 'llama')
    cd /Users/jhen/workspace/llama.cpp
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal -target air64-apple-ios14.0 -o /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/llama_llama.bundle/default.metallib /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal-embed.air /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_gelu_4' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q3_K_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_q4_0' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_q4_1' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q5_1_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_scale_4' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_diag_mask_inf' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sum_rows' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_pool_2d_max_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z29kernel_mul_mv_iq4_xs_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_norm' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_iq4_nl' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_q5_0' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_q5_1' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_gelu' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z28kernel_mul_mv_iq3_s_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq2_s_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_get_rows_i32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q2_K_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q4_K_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sin' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_tanh' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_ssm_conv_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_relu' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq1_m_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_timestep_embedding_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sub_row' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_div' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sqrt' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z29kernel_mul_mv_iq2_xs_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z28kernel_mul_mv_iq2_s_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq2_xxs_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z28kernel_mul_mv_iq1_m_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_rms_norm' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q4_0_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq4_xs_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_leaky_relu_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q6_K_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q2_K_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_gelu_quick' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q8_0_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq4_nl_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_group_norm' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cpy_f32_q8_0' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq2_xs_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z28kernel_mul_mv_iq1_s_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq3_s_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_row' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_cos' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_add' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q5_K_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_clamp' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_concat' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_ssm_scan_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q5_K_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sigmoid' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q4_1_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_add_row' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sqr' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_upscale_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z29kernel_mul_mv_iq4_nl_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q5_0_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_silu_4' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_diag_mask_inf_8' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq1_s_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_gelu_quick_4' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z27kernel_mul_mv_q4_K_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q3_K_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_scale' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_pool_2d_avg_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_arange_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_pad_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_iq3_xxs_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q8_0_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_div_row' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z30kernel_mul_mv_iq3_xxs_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_silu' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_sub' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol 'kernel_mul_mv_q6_K_f32' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
duplicated symbol '_Z30kernel_mul_mv_iq2_xxs_f32_implPU9MTLdeviceKvPU9MTLdeviceKfPU9MTLdeviceflllmmmllmmmlljjPU14MTLthreadgroupaDv3_jjj' in:
      /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Intermediates.noindex/llama.build/Debug-iphoneos/llama_llama.build/Metal/ggml-metal.air
air-lld: error: 81 duplicated symbols for target 'air64_v23-apple-ios14.0.0'
metal: error: air-lld command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
        MetalLink /Users/jhen/Library/Developer/Xcode/DerivedData/llama.swiftui-cuwqaggxievdwmfykiewtzqkddsd/Build/Products/Debug-iphoneos/llama_llama.bundle/default.metallib (in target 'llama_llama' from project 'llama')
        Building project llama.swiftui with scheme llama.swiftui
(2 failures)

@jhen0409 jhen0409 changed the title llama.swift : exclude ggml-metal-embed.metal swift : exclude ggml-metal-embed.metal Nov 8, 2024
@@ -67,7 +67,8 @@ let package = Package(
"models",
"tests",
"CMakeLists.txt",
"Makefile"
"Makefile",
"ggml/src/ggml-metal-embed.metal"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be a similar issue with the cmake build. I think something like this might work for cmake if you'd like to add it:

diff --git a/Package.swift b/Package.swift
index d246658b..8a064fd8 100644
--- a/Package.swift
+++ b/Package.swift
@@ -68,7 +68,9 @@ let package = Package(
                "tests",
                "CMakeLists.txt",
                "Makefile",
-               "ggml/src/ggml-metal-embed.metal"
+               "ggml/src/ggml-metal-embed.metal",
+               "./build/autogenerated/ggml-metal-embed.metal",
+               "./build/bin/ggml-metal.metal"
             ],
             sources: sources,
             resources: resources,

@ggerganov ggerganov merged commit d05b312 into ggerganov:master Nov 8, 2024
52 checks passed
@jhen0409 jhen0409 deleted the fix-swift branch November 8, 2024 10:05
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
* llama.swift : exclude ggml-metal-embed.metal

* swift : exclude build/
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
* llama.swift : exclude ggml-metal-embed.metal

* swift : exclude build/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants