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

[bug] Can't compile or install from pip. #17

Open
matchyc opened this issue May 23, 2024 · 2 comments
Open

[bug] Can't compile or install from pip. #17

matchyc opened this issue May 23, 2024 · 2 comments

Comments

@matchyc
Copy link

matchyc commented May 23, 2024

For pip install .:

      tinyknn/_fast_pq.cpp:17539:320: error: can’t convert a value of type ‘int’ to vector type ‘__m128i’ {aka ‘__vector(2) long long int’} which has different size
      17539 |     __pyx_t_6 = __pyx_f_7tinyknn_8_fast_pq_compute_block_dists((&(*((__uint64_t *) ( /* dim=1 */ ((char *) (((__uint64_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_4 * __pyx_v_data.strides[0]) )) + __pyx_t_5)) )))), ((__pyx_v_data.shape[1]) / 2), __pyx_v_tables, __pyx_v_signd); if (unlikely(__pyx_t_6 == ((__m128i)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 109, __pyx_L1_error)
            |                                                                                                                                                                                                                                                                                                                                ^
      tinyknn/_fast_pq.cpp:1498:43: note: in definition of macro ‘unlikely’
       1498 |   #define unlikely(x) __builtin_expect(!!(x), 0)

For pip install fast-pq:

      ValueError: 'fast_pq/_fast_pq.pyx' doesn't match any files
      [end of output]
@matchyc
Copy link
Author

matchyc commented Jun 7, 2024

@thomasahle Hi, Could you please help me with this?

@thomasahle
Copy link
Owner

The errors you're encountering stem from a mismatch between the architecture of your system (ARM-based, since you're likely on an M1/M2 Mac) and the x86/x64-specific instructions being used in the code.

TinyKNN uses SIMD instructions everywhere. To work on more platforms you would either have to reimplement the assembly parts, like

#if defined(__x86_64__) || defined(_M_X64)
// x86-specific code (e.g., SIMD optimizations)
#elif defined(__aarch64__)
// ARM-specific code (e.g., NEON optimizations)
#endif

or switch to using some library underneath.

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

No branches or pull requests

2 participants