I’ve built PyTorch from source, just to get quantized matrix multiplication operator from Ruy Quantized Matrix Multiplication. There is #include<ruy/ruy.h>
directive in aten/src/ATen/native/quantized/cpu/RuyUtils.h
. I’ve also built google/ruy
repository, copied ruy/ruy
directory in aten/src
(because there is ruy/ruy/ruy.h
file).
python setup.py build
manages to find ruy/ruy.h
but fails to link it with following errors:
Building wheel torch-1.13.0a0+git0f561f0
-- Building version 1.13.0a0+git0f561f0
cmake --build . --target install --config Release
[4/13] Linking CXX executable bin/FileStoreTest
FAILED: bin/FileStoreTest
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic test_cpp_c10d/CMakeFiles/FileStoreTest.dir/FileStoreTest.cpp.o -o bin/FileStoreTest -Wl,-rpath,/ec2-user/repos/pytorch/build/lib: lib/libtorch_cpu.so lib/libgtest_main.a -lpthread lib/libprotobuf.a lib/libc10.so lib/libgtest.a -pthread && :
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::clear_performance_advisories()'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx2(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2SingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::get_ctx(ruy::Context*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::~Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::MulFrontEndFromTrMulParams(ruy::Ctx*, ruy::TrMulParams*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::SelectPath(ruy::Path)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx512(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx512(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvxSingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::set_performance_advisory(ruy::PerformanceAdvisory)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx2(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Allocator::AllocateBytes(long)'
lib/libtorch_cpu.so: undefined reference to `ruy::detail::MultiplyByQuantizedMultiplier(int, int, int)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::GetMainAllocator()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512SingleCol(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::Context()'
collect2: error: ld returned 1 exit status
[5/13] Linking CXX executable bin/TCPStoreTest
FAILED: bin/TCPStoreTest
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic test_cpp_c10d/CMakeFiles/TCPStoreTest.dir/TCPStoreTest.cpp.o -o bin/TCPStoreTest -Wl,-rpath,/ec2-user/repos/pytorch/build/lib: lib/libtorch_cpu.so lib/libgtest_main.a -lpthread lib/libprotobuf.a lib/libc10.so lib/libgtest.a -pthread && :
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::clear_performance_advisories()'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx2(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2SingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::get_ctx(ruy::Context*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::~Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::MulFrontEndFromTrMulParams(ruy::Ctx*, ruy::TrMulParams*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::SelectPath(ruy::Path)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx512(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx512(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvxSingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::set_performance_advisory(ruy::PerformanceAdvisory)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx2(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Allocator::AllocateBytes(long)'
lib/libtorch_cpu.so: undefined reference to `ruy::detail::MultiplyByQuantizedMultiplier(int, int, int)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::GetMainAllocator()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512SingleCol(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::Context()'
collect2: error: ld returned 1 exit status
[6/13] Linking CXX executable bin/HashStoreTest
FAILED: bin/HashStoreTest
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic test_cpp_c10d/CMakeFiles/HashStoreTest.dir/HashStoreTest.cpp.o -o bin/HashStoreTest -Wl,-rpath,/ec2-user/repos/pytorch/build/lib: lib/libtorch_cpu.so lib/libgtest_main.a -lpthread lib/libprotobuf.a lib/libc10.so lib/libgtest.a -pthread && :
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::clear_performance_advisories()'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx2(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2SingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::get_ctx(ruy::Context*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::~Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::MulFrontEndFromTrMulParams(ruy::Ctx*, ruy::TrMulParams*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::SelectPath(ruy::Path)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx512(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx512(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvxSingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::set_performance_advisory(ruy::PerformanceAdvisory)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx2(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Allocator::AllocateBytes(long)'
lib/libtorch_cpu.so: undefined reference to `ruy::detail::MultiplyByQuantizedMultiplier(int, int, int)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::GetMainAllocator()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512SingleCol(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::Context()'
collect2: error: ld returned 1 exit status
[7/13] Linking CXX executable bin/ProcessGroupGlooTest
FAILED: bin/ProcessGroupGlooTest
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic test_cpp_c10d/CMakeFiles/ProcessGroupGlooTest.dir/ProcessGroupGlooTest.cpp.o -o bin/ProcessGroupGlooTest -Wl,-rpath,/ec2-user/repos/pytorch/build/lib:/usr/local/cuda/lib64: lib/libtorch_cpu.so lib/libc10d_cuda_test.so lib/libgtest_main.a -lpthread lib/libtorch_cuda.so lib/libc10_cuda.so /usr/local/cuda/lib64/libcudart.so /usr/local/cuda/lib64/libnvToolsExt.so lib/libprotobuf.a lib/libc10.so -Wl,--no-as-needed,"/ec2-user/repos/pytorch/build/lib/libtorch_cpu.so" -Wl,--as-needed /usr/local/cuda/lib64/libcufft.so /usr/local/cuda/lib64/libcurand.so /usr/local/cuda/lib64/libcublas.so /usr/lib/x86_64-linux-gnu/libcudnn.so lib/libgtest.a -pthread && :
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::clear_performance_advisories()'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx2(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2SingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::get_ctx(ruy::Context*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::~Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::MulFrontEndFromTrMulParams(ruy::Ctx*, ruy::TrMulParams*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::SelectPath(ruy::Path)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx512(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx512(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvxSingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::set_performance_advisory(ruy::PerformanceAdvisory)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx2(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Allocator::AllocateBytes(long)'
lib/libtorch_cpu.so: undefined reference to `ruy::detail::MultiplyByQuantizedMultiplier(int, int, int)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::GetMainAllocator()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512SingleCol(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::Context()'
collect2: error: ld returned 1 exit status
[8/13] Linking CXX executable bin/ProcessGroupGlooAsyncTest
FAILED: bin/ProcessGroupGlooAsyncTest
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic test_cpp_c10d/CMakeFiles/ProcessGroupGlooAsyncTest.dir/ProcessGroupGlooAsyncTest.cpp.o -o bin/ProcessGroupGlooAsyncTest -Wl,-rpath,/ec2-user/repos/pytorch/build/lib:/usr/local/cuda/lib64 lib/libtorch_cpu.so lib/libc10d_cuda_test.so lib/libgtest_main.a -lpthread lib/libtorch_cuda.so lib/libc10_cuda.so /usr/local/cuda/lib64/libcudart.so /usr/local/cuda/lib64/libnvToolsExt.so lib/libprotobuf.a lib/libc10.so -Wl,--no-as-needed,"/ec2-user/repos/pytorch/build/lib/libtorch_cpu.so" -Wl,--as-needed /usr/local/cuda/lib64/libcufft.so /usr/local/cuda/lib64/libcurand.so /usr/local/cuda/lib64/libcublas.so /usr/lib/x86_64-linux-gnu/libcudnn.so lib/libgtest.a -pthread && :
lib/libtorch_cpu.so: undefined reference to `ruy::Context::Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::clear_performance_advisories()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2SingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::MulFrontEndFromTrMulParams(ruy::Ctx*, ruy::TrMulParams*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::SelectPath(ruy::Path)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx512(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx2(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::set_performance_advisory(ruy::PerformanceAdvisory)'
lib/libtorch_cpu.so: undefined reference to `ruy::Allocator::AllocateBytes(long)'
lib/libtorch_cpu.so: undefined reference to `ruy::detail::MultiplyByQuantizedMultiplier(int, int, int)'
lib/libtorch_cpu.so: undefined reference to `ruy::Ctx::GetMainAllocator()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx512SingleCol(ruy::KernelParams8bit<16, 16> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx2(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitColMajorForAvx(signed char const*, signed char, signed char const*, int, int, int, signed char*, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::get_ctx(ruy::Context*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Context::~Context()'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Pack8bitRowMajorForAvx512(unsigned char const*, int, int, signed char*, int, int, int, int, int, int, int, int*)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvxSingleCol(ruy::KernelParams8bit<8, 8> const&)'
lib/libtorch_cpu.so: undefined reference to `ruy::Kernel8bitAvx2(ruy::KernelParams8bit<8, 8> const&)'
collect2: error: ld returned 1 exit status
[9/13] Linking CXX shared library lib/libtorch_cuda_linalg.so
ninja: build stopped: subcommand failed.
Also, I’ve tried changing buckbuild.bzl
and defs.bzl
by changing flag -DUSE_RUY_QMATMUL
to 1, but it didn’t do anything. I don’t understand what I have to do in order to successfully link Ruy, so I’ll be grateful for any help.