Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Faiss
Commits
508730cf
Commit
508730cf
authored
Sep 08, 2022
by
Your Name
Browse files
删除debug信息,SQ_IP
parent
a49479f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
8 deletions
+48
-8
.nfs0000000003d5826d000005b4
.nfs0000000003d5826d000005b4
+0
-0
compile.sh
compile.sh
+1
-1
faiss/gpu/impl/L2Norm.cu
faiss/gpu/impl/L2Norm.cu
+2
-2
test_gpu.sh
test_gpu.sh
+3
-1
test_gpu_python.sh
test_gpu_python.sh
+36
-0
tests/test_index_accuracy.py
tests/test_index_accuracy.py
+6
-4
No files found.
.
test_gpu.sh.swp
→
.
nfs0000000003d5826d000005b4
View file @
508730cf
No preview for this file type
compile.sh
View file @
508730cf
...
...
@@ -9,7 +9,7 @@ export LD_LIBRARY_PATH=${ROCM_PATH}/hipblas/lib/:$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
${
ROCM_PATH
}
/llvm/lib:
$LD_LIBRARY_PATH
#CXX=hipcc CC=hipcc cmake -DFAISS_ENABLE_GPU=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MODULE_PATH="${ROCM_PATH}/hip/cmake/" -DMKL_LIBRARIES=/public/software/compiler/intel-compiler-2017.5.239/mkl/lib/intel64_lin/ ..
CXX
=
hipcc
CC
=
hipcc cmake
-DFAISS_ENABLE_GPU
=
ON
-DBUILD_SHARED_LIBS
=
ON
-DBUILD_TESTING
=
ON
-DCMAKE_BUILD_TYPE
=
RELEASE
-DCMAKE_MODULE_PATH
=
"
${
ROCM_PATH
}
/hip/cmake/"
-DMKL_LIBRARIES
=
/public/software/compiler/intel-compiler-2017.5.239/mkl/lib/intel64_lin/ ..
CXX
=
hipcc
CC
=
hipcc cmake
-DFAISS_ENABLE_GPU
=
ON
-DBUILD_SHARED_LIBS
=
ON
-DFAISS_OPT_LEVEL
=
avx
-DBUILD_TESTING
=
ON
-DCMAKE_BUILD_TYPE
=
RELEASE
-DCMAKE_MODULE_PATH
=
"
${
ROCM_PATH
}
/hip/cmake/"
-DMKL_LIBRARIES
=
/public/software/compiler/intel-compiler-2017.5.239/mkl/lib/intel64_lin/
libmkl_rt.so
..
make
-j32
faiss
VERBOSE
=
1
>
hc_faiss.log 2>&1
make
-j32
swigfaiss
VERBOSE
=
1
>
hc_swigfaiss.log 2>&1
...
...
faiss/gpu/impl/L2Norm.cu
View file @
508730cf
...
...
@@ -176,8 +176,8 @@ __global__ void l2NormRowMajor(
:
sqrtf
(
ConvertTo
<
float
>::
to
(
rowNorm
[
row
]));
}
}
if
(
blockIdx
.
x
<
2
)
{
printf
(
"output[outCol] = %f
\n
"
,
rowNorm
[
0
]);}
//
if(blockIdx.x < 2)
//
{printf("output[outCol] = %f\n", rowNorm[0]);}
}
}
...
...
test_gpu.sh
View file @
508730cf
source
/opt/dtk-22.04.2/env.sh
cd
build
;
export
CPLUS_INCLUDE_PATH
=
${
ROCM_PATH
}
/include:
${
ROCM_PATH
}
:/opencl/include
export
LD_LIBRARY_PATH
=
/
opt/intel/compilers_and_libraries_2018.1.163/linux
/mkl/lib/intel64_lin/:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
/
public/software/compiler/intel-compiler-2017.5.239
/mkl/lib/intel64_lin/:
$LD_LIBRARY_PATH
#export PATH=/home/huchen/FAISS/swig-4.0.2-build/bin/:$PATH
export
CPLUS_INCLUDE_PATH
=
${
ROCM_PATH
}
/hiprand/include/:
${
ROCM_PATH
}
/rocrand/include:
$CPLUS_INCLUDE_PATH
export
LD_LIBRARY_PATH
=
${
ROCM_PATH
}
/hipblas/lib/:
$LD_LIBRARY_PATH
...
...
@@ -13,6 +13,8 @@ export LD_LIBRARY_PATH=${BUILD_DIR}/faiss/gpu/test/:${BUILD_DIR}faiss/:${BUILD_D
#make -j95 VERBOSE=1
export
HIP_VISIBLE_DEVICES
=
3
export
MKL_DEBUG_CPU_TYPE
=
5
#export HIP_LAUNCH_BLOCKING=1
#export HIP_LOG_LEVEL=7
...
...
test_gpu_python.sh
0 → 100755
View file @
508730cf
source
/opt/dtk-22.04.2/env.sh
export
CPLUS_INCLUDE_PATH
=
${
ROCM_PATH
}
/include:
${
ROCM_PATH
}
:/opencl/include
export
LD_LIBRARY_PATH
=
/public/software/compiler/intel-compiler-2017.5.239/mkl/lib/intel64_lin/:
$LD_LIBRARY_PATH
#export PATH=/home/huchen/FAISS/swig-4.0.2-build/bin/:$PATH
export
CPLUS_INCLUDE_PATH
=
${
ROCM_PATH
}
/hiprand/include/:
${
ROCM_PATH
}
/rocrand/include:
$CPLUS_INCLUDE_PATH
export
LD_LIBRARY_PATH
=
${
ROCM_PATH
}
/hipblas/lib/:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
${
ROCM_PATH
}
/rocblas/lib/:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
${
ROCM_PATH
}
/llvm/lib:
$LD_LIBRARY_PATH
export
BUILD_DIR
=
`
pwd
`
/build
export
LD_LIBRARY_PATH
=
${
BUILD_DIR
}
/faiss/gpu/test/:
${
BUILD_DIR
}
faiss/:
${
BUILD_DIR
}
/lib/:
$LD_LIBRARY_PATH
#export HIP_KERNEL_PRINTF=1
#make -j95 VERBOSE=1
export
HIP_VISIBLE_DEVICES
=
3
#export AMD_LOG_LEVEL=4
#export AMD_OCL_WAIT_COMMAND=1
export
MKL_DEBUG_CPU_TYPE
=
5
cd
build/faiss/python
&&
python3 setup.py build
cd
-
#PYTHONPATH="$(ls -d ./build/faiss/python/build/lib*/)" pytest tests/test_*.py
export
PYTHONPATH
=
"
$(
ls
-d
./build/faiss/python/build/lib
*
/
)
"
#pytest -v -s --capture=no -q tests/test_index_accuracy.py
pytest tests/test_
*
.py
#pytest -v tests/test_fast_scan.py
#pytest -v tests/test_index_accuracy.py
#pytest -v -s --capture=no -q tests/test_index_accuracy.py::TestSQFlavors::test_SQ_IP
tests/test_index_accuracy.py
View file @
508730cf
...
...
@@ -298,11 +298,13 @@ class TestSQFlavors(unittest.TestCase):
assert
set
(
Iref
)
==
set
(
Inew
),
"q %d ref %s new %s"
%
(
qno
,
Iref
,
Inew
)
def
test_SQ_IP
(
self
):
self
.
subtest
(
faiss
.
METRIC_INNER_PRODUCT
)
# HC debug
#def test_SQ_IP(self):
# self.subtest(faiss.METRIC_INNER_PRODUCT)
def
test_SQ_L2
(
self
):
self
.
subtest
(
faiss
.
METRIC_L2
)
#
def test_SQ_L2(self):
#
self.subtest(faiss.METRIC_L2)
def
test_parallel_mode
(
self
):
d
=
32
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment