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

Fix faiss swig build with version > 4.2.x #3315

Closed
wants to merge 20 commits into from
Closed

Fix faiss swig build with version > 4.2.x #3315

wants to merge 20 commits into from

Commits on Mar 26, 2024

  1. change cmake

    junjieqi committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    a4b50e3 View commit details
    Browse the repository at this point in the history
  2. Fix faiss swig build with version > 4.2.x

    Summary:
    Currently, faiss can't build with swig version > 4.2.x. As the #3239 mentioned.  Swig removed the support for 32bit swig/swig@9fb3a49. So SWIGTYPE_p_unsigned_long_long isn't supported any more. In this diff, we are going to remove the unsupported type from Faiss swig.
    
    Test Plan:
    STEP 1: create a new conda env
    ```
    conda create --name faiss_swig
    conda activate faiss_swig
    ```
    
    STEP 2: install dependecies from conda-forge
    ```
    conda install -y -q python=3.11 cmake make swig mkl=2023 mkl-devel=2023 numpy scipy pytest gxx_linux-64 sysroot_linux-64=2.28 -c conda-forge
    ```
    
    STEP 3: CMAKE
    
    ```
    cmake -B build \                                                                                  [system]
          -DBUILD_TESTING=ON \
          -DBUILD_SHARED_LIBS=ON \
          -DFAISS_ENABLE_GPU=OFF \
          -DFAISS_ENABLE_RAFT=OFF \
          -DFAISS_OPT_LEVEL=avx512 \
          -DFAISS_ENABLE_C_API=ON \
          -DPYTHON_EXECUTABLE=$(which python) \
          -DCMAKE_BUILD_TYPE=Release \
          -DBLA_VENDOR=Intel10_64_dyn \
          -DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
          .
    ```
    
    STEP 4: build
    ```
    make -C build -j faiss && make -C build -j swigfaiss
    ```
    
    /var/folders/n5/8sm28y7j7hl8w4xdtl7r_33w0000gn/T/TemporaryItems/NSIRD_screencaptureui_AjUh4J/Screenshot 2024-03-25 at 12.21.25 AM.png
    junjieqi committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    1fcb3de View commit details
    Browse the repository at this point in the history
  3. <Replace this line with a title. Use 1 line only, 67 chars or less>

    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    junjieqi committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    f235edb View commit details
    Browse the repository at this point in the history
  4. add debug output

    Tags:
    junjieqi committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    a3498c0 View commit details
    Browse the repository at this point in the history
  5. remove broken change

    junjieqi committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    673f48a View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2024

  1. add gcc version

    junjieqi committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    8de8d7e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c89a574 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. try to fix test

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    6598d49 View commit details
    Browse the repository at this point in the history
  2. remove debug info

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    961713a View commit details
    Browse the repository at this point in the history
  3. add long long marco

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    8a17e06 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bd04ec6 View commit details
    Browse the repository at this point in the history
  5. try sizeof_long

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    c1c8ee3 View commit details
    Browse the repository at this point in the history
  6. _LONG_WIDTH__

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    9ce9a67 View commit details
    Browse the repository at this point in the history
  7. try another macro

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    50144f5 View commit details
    Browse the repository at this point in the history
  8. use size_of_long

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    4432541 View commit details
    Browse the repository at this point in the history
  9. use size_of_long

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    449964e View commit details
    Browse the repository at this point in the history
  10. use __wordsize

    junjieqi committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    19b73ef View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. fix typo

    junjieqi committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    cb243fc View commit details
    Browse the repository at this point in the history
  2. use __SIZEOF_LONG__

    junjieqi committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    4a95427 View commit details
    Browse the repository at this point in the history
  3. use __SIZEOF_LONG__

    junjieqi committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    6b16647 View commit details
    Browse the repository at this point in the history