Skip to content

Commit 429104e

Browse files
github-actions[bot]meiravgrialonre24
authored
[0.8] Meiravg_feature_bfloat16 (#464)
* upgrade codcov instance to c7i (cherry picked from commit b5cc93b) * [MOD-6763] bfloat16 - distance calculation functions (#445) (cherry picked from commit 850d6a8) * update arch_opt macros in bf16 BM (cherry picked from commit 253dcd3) * fix macro check (cherry picked from commit 26b047d) * Remove arch_opt enum and use cpu features flags instead (#459) (cherry picked from commit f98793a) * FP16 distance functions (#453) (cherry picked from commit 9420e77) * [MOD-6764] Introduce bfloat16 datatype (#454) * Introduce bfloat16 datatype add Datatype to `VecSimIndexAbstract` template args. add template to SetDistFunc and have specialized implemntation for each <dataType, distType> combintation now the dist function pointer argument is not neseccesary, we can simple return the function. move using dist_func_t to spaces_aux.h (should be in a file included by both L2_spaces.h/IP.spaces.h and spaces.h) * move getdistance imp to spaces.cpp * move normalize function from vec_utils to spaces: spaces.h: get normalize function. spaces.cpp: specialized templates according to the datatype for the normalization functions spaces/normalize/normalize_naive.h: templated naive implementations of normalization functions VecSimIndexAbstract must have both DataType and DistType add VecSimType_BFLOAT16 update vec_utile accordingly bfloat16.h: add bfloat16_to_float32 for little and big TieredFactory::NewIndex calls TieredHNSWFactory::TieredFactory::NewIndex instead of implmentation duplication add bfloat to index factory for NewIndex and EstimateInitialSize * add no_opt functions tests for bfloat16 also add normalization function test for bf16 * fixed nohrmalized value * add bf16 benchmarks: add serialized hnsw bf16 files hnswfactory: add ctor from file for bf16 add fitMemory and run it at the begining of each benchmark to tighten memory. * update bm_files script * add flow tests to bf16 bruteforce: L2 batch iterator range query multivalue hnsw: serialization L2 batch iterator range multi tiered: create search and insert * add bfloat16 module to toml * upgrade scipy nupy * also use python 3.10 * upgrade PR python to 3.10 * update serializer * bm: fix casts unit tests: add test_bf16 * more unit tests * tiered tests * add index_type assertion ti hnsw serialization test add desgnated classes for bf and flat in bf16 unit test * unit test final * repalce cast to dynamic casts * add get neighors test to tiered add normalize test for bfloat16 in testcommon * use bit_cast * upgrade codecov machine * Revert "upgrade codecov machine" This reverts commit 7619b05. * Revert "use bit_cast" This reverts commit 59b8fab. * fix alignment intialization by changing the order * make bfloat16_to_float32 templated accroding to system's endianess * eliminate default in GetDistFunc add test for invalid metric * add test fot fit memory * split fit memory tests (cherry picked from commit e018d91) * run merge queue flow (cherry picked from commit 4670c59) * add override to fit memory (cherry picked from commit f994c79) * upload valgrind artifacts on failure (cherry picked from commit 7ece68d) * _mm256_loadu_epi16 is supported as of gcc1, use _mm256_lddqu_si256 instead (cherry picked from commit c521d82) * fix fit memory test (#461) * fix fit memory test * remove xenial checks * remove irrelevant comment * free index in seralization test (cherry picked from commit a0b70c8) * Remove avx512_BW_VL (#460) * remove bw_vl arch (not needed, avx512 is enough) * remove xenial from merge queue flow * fix fit memory test (#461) * fix fit memory test * remove xenial checks * remove irrelevant comment * free index in seralization test * install gcc10 bionic * install newer vg ubuntu18 * exit valgrind directory (cherry picked from commit d2e1d4f) * [MOD-6775] introduce fp16 type! (#462) * remove bw_vl arch (not needed, avx512 is enough) * remove xenial from merge queue flow * introduce fp16 type! change bfloat and fp16 to struct typedef to avoid ambiguty between them * added flow tests * fp16 benchmarks * fix hnsw flow test * add float616 to serializing script add fp16 files to bm files decrease testSizeEstimation dim size to make it run fasetr in debug * set log call back to null in benchmarks * remove struct typedef add default ctor * add comma seriaizer file * disable temp flow * disabe for real * remove constexpr from bfloat default ctor declaring a default ctor as constexpr is allowed as of c++20, and this feature in particular is supported as of gcc10 I don't see any benefit using this feature... * test focal * disable temp flow (cherry picked from commit 704282b) --------- Co-authored-by: meiravgri <[email protected]> Co-authored-by: meiravgri <[email protected]> Co-authored-by: alonre24 <[email protected]>
1 parent a3498b7 commit 429104e

File tree

112 files changed

+6482
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+6482
-593
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
2828
# Ubuntu 22.04 128GB Storage AMI
2929
ec2-image-id: ami-0ba430d4b7b64de57
30-
ec2-instance-type: r6i.xlarge
30+
ec2-instance-type: r7i.xlarge
3131
subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }}
3232
security-group-id: ${{ secrets.AWS_EC2_SG_ID }}
3333

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
with:
2121
mode: start
2222
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
23-
# Ubuntu 20.04 AMI
24-
ec2-image-id: ami-0f4feb99425e13b50
25-
ec2-instance-type: t3.xlarge
23+
# Ubuntu 22.04 AMI
24+
ec2-image-id: ami-036cafe742923b3d9
25+
ec2-instance-type: c7i.xlarge
2626
subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }}
2727
security-group-id: ${{ secrets.AWS_EC2_SG_ID }}
2828

.github/workflows/event-merge-to-queue.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Merge a Pull-Request Flow
22
run-name: Validate ${{ github.ref_name }}
33

44
on:
5+
workflow_call:
56
merge_group:
67
types: [checks_requested]
78

@@ -27,12 +28,6 @@ jobs:
2728
uses: ./.github/workflows/task-unit-test.yml
2829
with:
2930
container: ubuntu:bionic
30-
xenial:
31-
needs: [check-if-docs-only]
32-
if: ${{ needs.check-if-docs-only.outputs.only-docs-changed == 'false' }}
33-
uses: ./.github/workflows/task-unit-test.yml
34-
with:
35-
container: ubuntu:xenial
3631
bullseye:
3732
needs: [check-if-docs-only]
3833
if: ${{ needs.check-if-docs-only.outputs.only-docs-changed == 'false' }}
@@ -87,7 +82,6 @@ jobs:
8782
- jammy
8883
- focal
8984
- bionic
90-
- xenial
9185
- bullseye
9286
- centos7
9387
- amazonlinux2

.github/workflows/event-nightly.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ jobs:
2626
with:
2727
container: ubuntu:bionic
2828
run-valgrind: false
29-
xenial:
30-
uses: ./.github/workflows/task-unit-test.yml
31-
with:
32-
container: ubuntu:xenial
33-
run-valgrind: false
3429
bullseye:
3530
uses: ./.github/workflows/task-unit-test.yml
3631
with:

.github/workflows/event-pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: setup python
2323
uses: actions/setup-python@v4
2424
with:
25-
python-version: '3.8'
25+
python-version: '3.10'
2626
- name: install dependencies
2727
run: sudo .install/install_script.sh
2828
- name: install python packages

.github/workflows/flow-temp.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: temporary testing
2+
3+
# This file is useful for triggering actions when you implement them.
4+
# When the `branches-ignore` line is commented out, this workflow will run on every push.
5+
# It is better to use this file for testing your new flows than creating a new one, to avoid cluttering the repo
6+
# action tab with unused workflows.
7+
# Don't worry about conflicts with other PRs - there is no "right" content of this file.
8+
# Make sure the `branches-ignore` line is not commented out when you merge your PR.
9+
10+
on:
11+
push:
12+
branches-ignore: ['**'] # ignore all branches. Comment this line to run your workflow below on every push.
13+
14+
jobs:
15+
check-if-docs-only:
16+
uses: ./.github/workflows/task-check-docs.yml
17+
focal:
18+
needs: [check-if-docs-only]
19+
if: ${{ needs.check-if-docs-only.outputs.only-docs-changed == 'false' }}
20+
uses: ./.github/workflows/task-unit-test.yml
21+
with:
22+
container: ubuntu:focal

.github/workflows/task-unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: ${{ inputs.run-valgrind }}
3838
run: make valgrind
3939
- name: Archive valgrind tests reports
40-
if: ${{ inputs.run-valgrind }}
40+
if: ${{ inputs.run-valgrind }} && failure()
4141
uses: actions/upload-artifact@v3
4242
with:
4343
name: valgrind tests reports

.install/ubuntu_18.04.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ $MODE apt-get dist-upgrade -yqq
99
$MODE apt install -yqq software-properties-common
1010
$MODE add-apt-repository ppa:ubuntu-toolchain-r/test -y
1111
$MODE apt update
12-
$MODE apt-get install -yqq git wget make valgrind gcc-9 g++-9
12+
$MODE apt-get install -yqq git wget make gcc-9 g++-9 libc6-dbg
1313
$MODE update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
14+
15+
wget https://sourceware.org/pub/valgrind/valgrind-3.18.0.tar.bz2
16+
tar -xjf valgrind-3.18.0.tar.bz2
17+
cd valgrind-3.18.0
18+
./configure
19+
make
20+
$MODE make install
21+
cd ..
22+
1423
source install_cmake.sh $MODE

.install/ubuntu_22.04.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ set -e
33
export DEBIAN_FRONTEND=noninteractive
44
MODE=$1 # whether to install using sudo or not
55

6-
$MODE apt-get update -qq
6+
$MODE apt-get update -qq || true
77
$MODE apt-get install -yqq git wget build-essential valgrind lcov
88
source install_cmake.sh $MODE

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ valgrind:
193193

194194
flow_test:
195195
$(SHOW)poetry install
196-
$(SHOW)poetry run pytest tests/flow -v -s
196+
$(SHOW)poetry run pytest tests/flow/$(TEST) -v -s
197197

198198
.PHONY: flow_test
199199

@@ -278,7 +278,7 @@ $(COVERAGE_REPORT)
278278
endef
279279

280280
coverage:
281-
$(SHOW)$(MAKE) build COV=1
281+
$(SHOW)$(MAKE) build COV=1 FP_64=1
282282
$(SHOW)$(COVERAGE_RESET)
283283
$(SHOW)cd $(TESTDIR) && GTEST_COLOR=1 ctest $(_CTEST_ARGS)
284284
$(SHOW)$(COVERAGE_COLLECT_REPORT)

0 commit comments

Comments
 (0)