-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Addresses the issue in #3173 for `IndexNNDescent`, I see that there is already interrupt implemented for it's [search](https://fburl.com/code/iwn3tqic) API, so I looked into it's `add` API. For a given dataset nb = 10 mil, iter = 10, K = 32, d = 32 on a CPU only machine reveals that bulk of the cost comes from [nndescent](https://fburl.com/code/5rdb1p5o). For every iteration of `nndescent` takes around ~12 seconds, ~70-80% of the time is spent on `join` method (~10 seconds per iteration) and ~20-30% spent on `update` (~2 second per iteration). Adding the interrupt on the `join` should suffice on quickly terminating the program when users hit ctrl+C (happy to move the interrupt elsewhere if we think otherwise) Reviewed By: junjieqi, mdouze Differential Revision: D57300514
- Loading branch information
1 parent
4d06d70
commit 56b9aa9
Showing
3 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
set -euo pipefail | ||
# https://reproducible-builds.org/docs/archives/ | ||
deterministic_tar_gz() { | ||
# Use year 2030 to thwart tmpreaper. | ||
tar \ | ||
--sort=name \ | ||
--mtime=2030-01-01T00:00:00Z \ | ||
--owner=0 --group=0 --numeric-owner \ | ||
-cf- \ | ||
"${@:2}" \ | ||
| gzip -9n \ | ||
> "$1" | ||
} | ||
|
||
# To curl from devservers | ||
if host -W 1 fwdproxy >/dev/null; then | ||
curl() { HTTP_PROXY=fwdproxy:8080 HTTPS_PROXY=fwdproxy:8080 command curl "$@"; } | ||
fi | ||
|
||
### CHANGE THESE VARIABLES WHEN UPDATING ### | ||
|
||
# https://pypi.org/project/clang-format/18.1.3 | ||
|
||
|
||
LINUX_X86_64_URL=https://files.pythonhosted.org/packages/d5/9c/4f3806d20397790b3cd80aef89d295bf399581804f5c5758b6207e54e902/clang_format-18.1.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | ||
|
||
### | ||
NAME=${LINUX_X86_64_URL##*/} | ||
|
||
set -x | ||
curl -L -o "$NAME.zip" "$LINUX_X86_64_URL" | ||
mkdir "clang-format" | ||
unzip -q -d "clang-format" "$NAME.zip" | ||
echo "clang-format/clang_format/data/bin" | ||
deterministic_tar_gz "$NAME.tar.gz" -C "clang-format/clang_format/data/bin" "clang-format" | ||
tar tvf "$NAME.tar.gz" | ||
|
||
echo "$PWD" | ||
export PATH="${PWD}/clang-format/clang_format/data/bin:$PATH" | ||
echo $PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters