Граф коммитов

221 Коммитов

Автор SHA1 Сообщение Дата
Ben Karsin 4ecf2495eb
[Draft] GPU unit and integration tests (#377)
* Initial unit tests and KNN build test

* Fix linking error

* Fix TPT tests

* Change test files and fix tpt test issues

* Fix linking issues

* Fix buildssd tests and add new tests - new bug with SPTAG logger when running tests

* Add benchmark tests for PQ optimization

---------

Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2024-05-03 15:49:51 -07:00
dependabot[bot] 9d7da6908a
Bump pillow from 9.4.0 to 10.0.1 in /docs/examples (#399)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.4.0 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.4.0...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2024-04-30 18:11:15 -07:00
Huisheng Liu e7e4f71144
add Wait() method to SPTAG::Helper::DiskIO (#409) 2024-04-26 18:30:36 -07:00
zqxjjj 0dedbd9e99
Iterator interface (#407)
* add iterator interface

* add relaxed mono signal in the interface

* add batch in iterator interface

* IterativeScanTest: change delete flag to false in Search

* enable iterator and relax monotonicity support in java, python and c#

* avoid queryresult empty issue

* fix Iterator issue

* clean code for SPANN

* fix CLR compiling

* add result check for IterativeScan

* add iterator for spann

* fix SSDTest bugs

* remove logs in truthset

* trigger the pipeline

* add iterator example for python tutorial

* modify the README

---------

Co-authored-by: Qianxi Zhang <qiazh@microsoft.com>
Co-authored-by: Qi Chen <cheqi@microsoft.com>
2024-02-01 16:27:53 -08:00
dlmodric 1f6a85ea68
fix compile failed, ErrorCode::fail should be ErrorCode::Fail (#404)
Co-authored-by: denisyang <denisyang@tencent.com>
2023-12-15 13:38:33 -08:00
MaggieQi 7e9ff649f6
Opt perf and fix thread affinity bug (#395)
* remove unnecessary checks

* fix multithread threadaffinity issue

---------

Co-authored-by: cheqi <cheqi@SRGSSD-07>
2023-10-11 10:48:00 +08:00
Alexander Sklar 176e7cd125
When storing metadata, we were truncating at the first '\n' which is problematic when dealing with binary metadata (like zstd-compressed data). Turns out we don't need to use the GetMetadataOffsets function since we're always adding one vector+one metadata at a time. So we will treat the metadata as one continuous chunk of data. (#393) 2023-08-28 11:26:44 +08:00
Philip Adams 35a9bd126a
Convenience functions for parsing SPANN index (#384)
* outline convenience function changes

* implement GetPostingDebug

* fix make_shared of abstract class

* dont need to change VectorIndex.h interface

* resolve build
2023-08-15 20:10:16 +08:00
Philip Adams c05bdc85f4
More gracefully handle when invalid IDs are inserted or checked in the DeletedIDs set (#391) 2023-07-18 01:57:30 -07:00
microsoft-github-policy-service[bot] 2ffaec67dd
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-12 19:01:42 +00:00
microsoft-github-policy-service[bot] ff3825d883
Microsoft mandatory file 2023-06-02 18:32:01 +00:00
MaggieQi b28eafad10
Clr core (#385)
* add .net core support

* add linux nuget

* fix linux nuspec

* fix CsharpClient.vcxproj

* fix Linux and Windows conflict

* fix windows nuget package

* add dump and loadfromdump

* fix setup.py

* fix cuda LOG

* fix GPU log

* fix Dockerfile for ubuntu20.04

* fix Dockerfile

* add new apis for CLRCore

* fix CLR version

* fix test case

* add quantizevector and reconstructvector support

* fix quantizeVector

* fix CLR build

* fix fresh BKT bug

* update swig to 4.0.0

* fix README

---------

Co-authored-by: cheqi <cheqi@SRGSSD-07>
2023-05-24 13:31:18 +08:00
Philip Adams 268578dc31
Avoid off-by-one in BKT search (#383)
* avoid off-by-one due to post-increment in do-while comparison

* Update to not miss last BKT node

* syntax
2023-05-09 13:00:34 +08:00
jinwei14 ccb78d6313
enhance syncing script uploading and downloading (#382)
* add logger for total distance

* enhance syncing code execution.

* change typo

---------

Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2023-05-04 13:19:10 +08:00
Ben Karsin 98bc2966ab
Remove old cuda tests and fix linux build error (#381) 2023-05-04 11:04:48 +08:00
Philip Adams 0df1b75e6a
std::out_of_range doesn't have a default constructor (#378) 2023-04-10 15:31:46 +08:00
MaggieQi 3b00327a14
Clr core (#376)
* add .net core support

* add linux nuget

* fix linux nuspec

* fix CsharpClient.vcxproj

* fix Linux and Windows conflict

* fix windows nuget package

* add dump and loadfromdump

* fix setup.py

* fix cuda LOG

* fix GPU log

* fix Dockerfile for ubuntu20.04

* fix Dockerfile

---------

Co-authored-by: cheqi <cheqi@SRGSSD-07>
2023-04-04 11:09:17 +08:00
Ben Karsin fc24d65798
Fix 384d GPU index build support and error reporting (#363)
* Add support for and error checking for 384 dim and other PQ dimensions

* Fix error message for GPU code

---------

Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2023-04-02 22:18:33 +08:00
limenghao 2c0bb04713
resolve compilation warnings (#374)
Co-authored-by: Menghao Li <menghaoli@microsoft.com>
2023-04-02 19:40:24 +08:00
yangliu-ms d6aca4099a
Add dimension check for ProcessWithoutMPI. (#373) 2023-03-27 15:57:05 +08:00
Philip Adams 0341c33e05
Add protections against overflow and size mismatch, and invalid IDs in graph refine (#369)
* add protections against overflow and size mismatch, and invalid IDs

* avoid compilation issue

* add more safety to rebuild job

* add check to RNG

* try to resolve gcc compiler issue

* debug-guard expensive check

* fix the logging macro

* make it more branch-predictor friendly

* transform macro into function

* turn KDT macro to function

* special case for index==-1

* Update to LL_ERROR

* prevent extra allocations in BKT search by templated search function

* static dispatch in KDT index

* fix RNG prefetching

* skip checking index in graph traversal, since we will check in At

* dispatch by switch instead of if for fewer branches, use AlwaysTrue when filterFunc is null to allow compiler to optimize

* make the template function naming easier to understand, formatting improvements

* make checks in RebuildNeighbors IF_DEBUG only
2023-03-23 12:57:46 +08:00
zqxjjj 72f929d01a
add filter support for BKT: replace function pointer to std::fucntion to support lambda expression (#371)
Co-authored-by: Qianxi Zhang <Qianxi.Zhang@microsoft.com>
2023-03-23 10:39:33 +08:00
Philip Adams ac85ff4029
Allow setting a different Logger at runtime (#370)
* Allow setting a different Logger at runtime

Mutex is needed here because Logger::Logging is not const, so we can mangle things if shared_ptr is not updated atomically. And specialization for std::atomic<std::shared_ptr<T>> isn't availible to us in C++17

* Missed one file

* use atomics
2023-03-21 09:34:55 -07:00
Philip Adams fe03712efa
Rename logging macro to avoid name conflicts (#366)
* rename logging macro to avoid name conflicts

* fix rename

* resolve merge

---------

Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2023-03-16 13:39:47 -07:00
zqxjjj e950fad338
add filter support for BKT index (#368)
* add filter support for BKT index

* put the nullptr check into the upper function instead of #define, and add filter checking before duplicated check

---------

Co-authored-by: Qianxi Zhang <qiazh@microsoft.com>
Co-authored-by: Qianxi Zhang <Qianxi.Zhang@microsoft.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2023-03-16 10:56:49 +08:00
awesomelewis2007 b725cac633
Update versions in requirements.txt to patched versions (#367) 2023-03-15 11:06:26 +08:00
Renan S d082b55361
Update WindowsInstallation.md (#365)
I have gone to "https://sourceforge.net/projects/boost/files/boost-binaries/1.67.0/" and downloaded "boost_1_67_0-msvc-14.1-64.exe", but encountered this failure during cmake

-- Could NOT find Boost (missing: system thread serialization wserialization regex filesystem) (found suitable version "1.67.0", minimum required is "1.66")
CMake Error at src/legacy/sptag/SPTAG/CMakeLists.txt:90 (message):
  Could not find Boost >= 1.67!

I've notice that there are no precomiled libs, and had to run bootstrap + build exe to get the compiled libs.

Co-authored-by: Philip Adams <35666630+PhilipBAdams@users.noreply.github.com>
2023-03-13 15:53:45 +08:00
MaggieQi 5ffeabe4d0
Thread local context (#359)
* modify for thread_local context

* fix initialization issue

* fix ExtraWorkSpace id issue

* fix workSpacePool

* set thread affinity

* add more affinity strategies

* fix cmake compiler

* fix linux libnuma compile

* fix compiling and core bind

* fix NumaStrategy and OrderStrategy enum type

* remove space

* Clear the workspace to ensure the heap size and pagebuffer size

* User-overrideable worskpace implementation draft (#362)

* make it possible to override workspace implementation

* bool -> ErrrorCode

* SPANN index should allow setting child index workspace

* finish replacing by workspace factory

* switch to unique_ptr

* unresolved external

* linux build error

* windows build error

---------

Co-authored-by: cheqi <cheqi@SRGSSD-07>
Co-authored-by: Philip Adams <35666630+PhilipBAdams@users.noreply.github.com>
2023-03-09 12:00:55 -08:00
Alexander Sklar 0207479d01
add nuget package for WinRT (#361) 2023-03-01 14:44:07 +08:00
Alexander Sklar a9fb9339db
Add WinRT wrapper (#360)
* add winrt projects

* add gitignore for VS files

* retarget to vc142

* make neighborCount uint32

* api takes byte[] for metadata

* enable CFG and disable incremental linking to make BinSkim pass

* format

* remove edit and continue /ZI since it's incompatible for CFG

* remove arm/arm64 platforms
2023-02-28 17:32:25 -08:00
Alexander Sklar a5bd48e807
Fix static initialization fiasco problem with the logger and code calling into it from other TUs (#358)
* Addresses static initialization fiasco problem with the logger and code calling into it from other translation units

* fix namespace

* make logger init multithreading safe

* actually we can use magic statics to simplify

* Fix #356

* gate GMH/GPA on Windows only
2023-02-22 11:05:39 -05:00
Philip Adams 9c777df07c
Prevent saving failure in SaveindexToFile (#355)
* prevent SimpleBufferIO fails to resize

* Set put area for SimpleBufferIO

* Update DiskIO.h
2023-02-21 10:12:11 -05:00
jinwei14 de5b7f8c57
add logger for total distance (#351) 2023-01-06 13:08:02 +08:00
MaggieQi dda1180a8e
Fix python version (#333)
* update python to python3

* use dynamic linking

* enable ANNIndexTestTool code compiling

* add python version in wheel package

* update nuspec

* enable to set different maxcheck and hashexponent

* change to configure python version

* trigger azurepipeline

* trigger

* fix python version

* fix python version

* fix python version in windows

* fix cosine kmeans

* clean avx/see header files

* fix nuspec

Co-authored-by: cheqi <cheqi@SRGSSD-07>
2022-12-02 14:44:11 +08:00
Yuming-Xu 2d2cfb38a4
fix bkt bug: shuffle bug when clustering (#349) 2022-11-29 22:40:19 +08:00
Ben Karsin ebeb690e9a
Fix windows build issues for GPU code (#346)
* Fix build issue and windows issue with is_same_v

* fix is_same_v error
2022-11-17 13:55:08 +08:00
Jie (Diego) Cai 3d76e5e363
Add 768D support for GPU Generate Ground Truth (#343)
* Remove Transposed Point to save shared Memory

* Add Generate GT int8 Dim to 768, add CUDA CHECK to debug, Add infty for uint32

* Fix sharedmem usage for K=100 gt

Co-authored-by: Diego Cai <diegocai@microsoft.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2022-11-03 13:40:34 +08:00
Ben Karsin 98ef3b132a
Fix graph accuracy of GPU build for PQ/OPQ (#340)
* Fixed bugs with accuracy fix for TPT build with recon vectors

* Accuracy fix working for GPU index build with PQ/OPQ enabled

* Fix bug with accuracy fix

* Trigger CI

* Fix low accuracy issue with GPU index build for int8/cosine configuration (#339)

* Fix bug with int8/cosine configuration, and enabled hardware optimization for this case.

* Trigger CI

Co-authored-by: diegocai <diegocai@microsoft.com>

* Add nni_auto_tune example (#325)

* add nni_auto_tune

* support other data format and add more result

* add result picture

* refine readme

* refine readme

* refine code style

* update readme and datareader

* add aml training config

* update config

* fix licence

* refactor for data type

* refactor for data type

* refactor for data type

* fix overflow on bruteforce

* fix compute metric by index

* add limits and preprocessing

* change code dir

Co-authored-by: Guoxin <suiguoxin@gmail.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>

* Fixed bugs with accuracy fix for TPT build with recon vectors

* Accuracy fix working for GPU index build with PQ/OPQ enabled

* Fix bug with accuracy fix

* Trigger CI

Co-authored-by: diegocai <diegocai@microsoft.com>
Co-authored-by: smallv0221 <33639025+smallv0221@users.noreply.github.com>
Co-authored-by: Guoxin <suiguoxin@gmail.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2022-11-03 11:19:18 +08:00
smallv0221 636b3d66b1
Add nni_auto_tune example (#325)
* add nni_auto_tune

* support other data format and add more result

* add result picture

* refine readme

* refine readme

* refine code style

* update readme and datareader

* add aml training config

* update config

* fix licence

* refactor for data type

* refactor for data type

* refactor for data type

* fix overflow on bruteforce

* fix compute metric by index

* add limits and preprocessing

* change code dir

Co-authored-by: Guoxin <suiguoxin@gmail.com>
Co-authored-by: MaggieQi <chenqi871025@gmail.com>
2022-11-01 18:53:49 +08:00
Ben Karsin f7e3fe4750
Fix low accuracy issue with GPU index build for int8/cosine configuration (#339)
* Fix bug with int8/cosine configuration, and enabled hardware optimization for this case.

* Trigger CI

Co-authored-by: diegocai <diegocai@microsoft.com>
2022-11-01 17:05:08 +08:00
Jie (Diego) Cai 55ca655c66
Add GPU KNN to Generate Truth (#336)
* GPU KNN Intergrate

* Merged cuda hxx files

* Remove extra files, fix CoreLibrary build

* GPU code needs to be in cu file

* break circular including

* Rearranged the method

* Included the files like Neighborhood Graph. h did.
Only included need files in Kernel.cu

* Relocate the Quey_KNN to KNN.hxx (templates cannot be in kernel.cu

* Try to Instantizate before compile

* Fixed compile error. Need GPU to test rest

* Set Mem Failure

* Adjusted the max dimension for vectors up ot 184

* Change DistCalMethod

* Print Thread Start/End

* Shared memory

* Cannot launch Kernelr with 60% MaxSharedMemory

* Root Cause: Transpose_Mem

* L2 480s, Cosine 703s after Transpose

* Two functions for Shared and local ThreadHeap, two launch setting with shared and local DistPair

* Test version for Ben. 32 Threads defined in params.h
query_KNN has transpose and all shared memory.
query_KNN has transpose and heamMem in local.

* Found the debugger issue, next step: fix dist calc

* 1. Fixed int8 dist calc
2. Tested batch splitting on 35M
3. Moved the malloc before launching to avoid waste of memry

* 45cap, monitor mem usage, track where Convert failed

* Succeed on 400M 100D, Fixed int overflow, major change: int to size_t

* Multi-GPU detection

* Fixed the CPU mem over-usage, located the bug in updating results

* Fixed multi free results

* Fixed hard coded Cosine DistCalcMethod

* Relocate the Point & Transposed Point to GPUKNNDistance.hxx

* Merge SPTAG current changes, complaining about cuh cuda lib

* Move Generate Truth to TruthSet.cpp

* Fix optimization issue, add GPUCoreLibrary/GPUSSDServing to default build

* Fix Error for Linux cmake.

* Remove Unnecessary Changes.

* restore datasets

* missing s in folder name

* Restore build config to Lib, restore sln Config

* update tlog for lib config

* Remove Wrappers

* Removed not ignored log info

* Remove Static in TruthSet.cpp
Remove debug command, build GPU SSDServing to exe in Debug

* Recover CL compile for GPU SSDServing/main.cpp

Co-authored-by: diegocai <diegocai@microsoft.com>
Co-authored-by: Philip Adams <philipadams@microsoft.com>
Co-authored-by: Diego-Cai <103398280+Diego-Cai@users.noreply.github.com>
2022-10-08 12:59:59 +08:00
Jie (Diego) Cai ca617601f4
Merge pull request #334 from bkarsin/fix_gpu_pq_build
Fix GPU PQ build errors and added error checks
2022-09-27 03:46:48 +00:00
diegocai cbc4e0da73 Remove space 2022-09-27 10:23:46 +08:00
diegocai 6242cff7ca Try to trigger Azure Pipeline CL build 2022-09-26 21:05:42 +08:00
Diego Cai 5112fff6bb Add SIMDUtils.cpp to GPU build 2022-09-23 02:59:02 +00:00
Ben Karsin 77b93a268a Fix for Windows build 2022-09-22 09:56:46 -10:00
Ben Karsin 2b179658fb Fix zstd build/link error 2022-09-21 16:25:49 -10:00
Ben Karsin 5ce6fd278e Fix Windows build error 2022-09-21 15:25:23 -10:00
Ben Karsin 4cabd0b6db Small fixes 2022-09-19 14:00:30 -10:00
Ben Karsin 4d2eccfd0f Added more error checking for GPU PQ 2022-09-19 11:39:08 -10:00