Skip to content

Commit

Permalink
fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
blaise-muhirwa committed Dec 17, 2023
1 parent ca6a6b4 commit 166228e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run Tests
on: [pull_request]

env:
POETRY_VERSION: "1.6.1"
POETRY_VERSION: "1.7.1"

jobs:
build-and-test:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Build flatnav
run: |
cd flatnav_python
./install_flatnav.sh
./install_flatnav.sh
- name: Run Unit Tests
run: |
Expand Down
2 changes: 0 additions & 2 deletions flatnav/distances/InnerProductDistance.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class InnerProductDistance : public DistanceInterface<InnerProductDistance> {
setDistanceFunction();
}

// ~InnerProductDistance() = default;

float distanceImpl(const void *x, const void *y,
bool asymmetric = false) const {
(void)asymmetric;
Expand Down
2 changes: 0 additions & 2 deletions flatnav/distances/SquaredL2Distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class SquaredL2Distance : public DistanceInterface<SquaredL2Distance> {
setDistanceFunction();
}

// ~SquaredL2Distance() = default;

float distanceImpl(const void *x, const void *y,
bool asymmetric = false) const {
(void)asymmetric;
Expand Down
10 changes: 10 additions & 0 deletions flatnav_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ def platform_has_avx_support():
EXTRA_COMPILE_ARGS.append("-ftree-vectorize")


no_manual_vectorization = int(os.environ.get("NO_MANUAL_VECTORIZATION", "0"))

if no_manual_vectorization:
# Remove SIMD-related flags. Otherwise, it would crush in an environment
# where SIMD extensions (SSE, AVX) are not supported
EXTRA_COMPILE_ARGS = [
arg for arg in EXTRA_COMPILE_ARGS if arg not in ("-mavx", "-mavx512f")
]


ext_modules = [
Pybind11Extension(
"flatnav",
Expand Down
3 changes: 2 additions & 1 deletion flatnav_python/unit_tests/test_parallel_insertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from flatnav.index import L2Index
from .test_utils import get_ann_benchmark_dataset, compute_recall, create_index
import os
import numpy as np
import numpy as np


def test_parallel_insertions_yield_similar_recall():
training_set, queries, ground_truth, _ = get_ann_benchmark_dataset(
Expand Down

0 comments on commit 166228e

Please sign in to comment.