RWKV / rwkv.cpp

INT4/INT5/INT8 and FP16 inference on CPU for RWKV language model
MIT License
1.37k stars 90 forks source link

How to build a librwkv.dylib file with "arm64" on Mac M1 #115

Closed realcarlos closed 1 year ago

realcarlos commented 1 year ago

❯ cmake . -DRWKV_CUBLAS=ON -- Accelerate framework found -- Could not find nvcc, please set CUDAToolkit_ROOT. CMake Warning at CMakeLists.txt:125 (message): cuBLAS not found

-- CMAKE_SYSTEM_PROCESSOR: arm64 -- ARM detected -- Configuring done (0.2s) -- Generating done (0.0s) -- Build files have been written to: /Users/xxx/rwkv.cpp ❯ cmake --build . --config Release [ 7%] Built target ggml [ 23%] Built target rwkv [ 38%] Built target test_ggml_basics [ 53%] Built target test_tiny_rwkv [ 69%] Built target test_context_cloning [ 84%] Built target rwkv_cpu_info [100%] Built target rwkv_quantize ❯ lipo -info librwkv.dylib Non-fat file: librwkv.dylib is architecture: x86_64

schamane commented 1 year ago

@realcarlos check your toolset and terminal settings. Maybe you running inside rosetta?

cmake ..
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Accelerate framework found
-- CMAKE_SYSTEM_PROCESSOR: arm64
-- ARM detected
-- Configuring done (0.5s)
cmake --build . --config Release
lipo -info librwkv.dylib
Non-fat file: librwkv.dylib is architecture: arm64
realcarlos commented 1 year ago

@realcarlos check your toolset and terminal settings. Maybe you running inside rosetta?

cmake ..
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Accelerate framework found
-- CMAKE_SYSTEM_PROCESSOR: arm64
-- ARM detected
-- Configuring done (0.5s)
cmake --build . --config Release
lipo -info librwkv.dylib
Non-fat file: librwkv.dylib is architecture: arm64

Thank you @schamane , so cool , now I could get the arm64 one .