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

Disable AVX instructions in Agent-NGT #685

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ GRAPHQLS = $(PROTOS:apis/proto/%.proto=apis/graphql/%.pb.graphqls)
GQLCODES = $(GRAPHQLS:apis/graphql/%.pb.graphqls=apis/graphql/%.generated.go)
PBDOCS = $(PROTOS:apis/proto/%.proto=apis/docs/%.md)

CFLAGS ?= -mno-avx512f -mno-avx512dq -mno-avx512cd -mno-avx512bw -mno-avx512vl
CXXFLAGS ?= $(CFLAGS)
NGT_BUILD_OPTIONS ?= -DNGT_AVX_DISABLED=ON

BENCH_DATASET_MD5S := $(eval BENCH_DATASET_MD5S := $(shell find $(BENCH_DATASET_MD5_DIR) -type f -regex ".*\.md5"))$(BENCH_DATASET_MD5S)
BENCH_DATASETS = $(BENCH_DATASET_MD5S:$(BENCH_DATASET_MD5_DIR)/%.md5=$(BENCH_DATASET_HDF5_DIR)/%.hdf5)
Expand Down Expand Up @@ -335,7 +334,7 @@ ngt/install: /usr/local/include/NGT/Capi.h
curl -LO https://github.com/yahoojapan/NGT/archive/v$(NGT_VERSION).tar.gz
tar zxf v$(NGT_VERSION).tar.gz -C /tmp
cd /tmp/NGT-$(NGT_VERSION) && \
cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" .
cmake $(NGT_BUILD_OPTIONS) .
make -j -C /tmp/NGT-$(NGT_VERSION)
make install -C /tmp/NGT-$(NGT_VERSION)
rm -rf v$(NGT_VERSION).tar.gz
Expand Down
4 changes: 1 addition & 3 deletions Makefile.d/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ cmd/agent/core/ngt/ngt: \
$(PBGOS) \
$(shell find ./cmd/agent/core/ngt -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \
$(shell find ./pkg/agent/core/ngt ./pkg/agent/internal -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go')
export CFLAGS="$(CFLAGS)" \
&& export CXXFLAGS="$(CXXFLAGS)" \
&& export CGO_ENABLED=1 \
export CGO_ENABLED=1 \
&& export CGO_CXXFLAGS="-g -Ofast -march=native" \
&& export CGO_FFLAGS="-g -Ofast -march=native" \
&& export CGO_LDFLAGS="-g -Ofast -march=native" \
Expand Down