Add INT8 vector support for vector sets#1806
Draft
harsha-simhadri wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an INT8 vector value type (SB8, signed bytes in [-128, 127]) to the vector-set commands and wires it through the parser, the DiskANN bridge, dimension calculation, and the Q8 dequantization path used by TryGetEmbedding.
Changes:
- New
VectorValueType.SB8enum member and dimension calculation support. - VADD and VSIM parsers accept an
SB8 <bytes>form; VADD now also permitsQ8quantization. DiskANNService.Insert/SearchVectoraccept SB8 vectors;TryGetEmbeddingdequantizes Q8 by sign-extending each stored byte.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| libs/server/Storage/Session/MainStore/VectorStoreOps.cs | Adds SB8 to VectorValueType enum with doc summary. |
| libs/server/Resp/Vector/RespServerSessionVectors.cs | Adds SB8 parsing in VADD/VSIM and permits Q8 quantization in VADD; usage comments not updated. |
| libs/server/Resp/Vector/VectorManager.cs | Handles SB8 in CalculateValueDimensions and adds Q8 dequantization branch in TryGetEmbedding. |
| libs/server/Resp/Vector/DiskANNService.cs | Forwards SB8 vectors to native DiskANN insert/search; introduces two unrelated whitespace regressions around =. |
Comment on lines
+925
to
+928
| // Q8 stores signed bytes; dequantize by sign-extending to float | ||
| for (var i = 0; i < asBytes.Length; i++) | ||
| { | ||
| into[i] = (float)(sbyte)from[i]; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Add SB8 to the grammar comments at the top of NetworkVADD and NetworkVSIM methods, and add a one-line explanation analogous to the existing XB8 note: SB8 encodes [-128, 127] per dimension. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add SB8 vector to VADD() test alongside FP32/XB8 (NOQUANT path) - Add VADDSB8Q8() test: dedicated SB8+Q8 VADD/VEMB round-trip - Add SB8 query to VSIM() test alongside FP32/XB8 - Update VADDErrors: Q8 is now supported, so quant-type rejection tests are replaced with dimension-mismatch expectations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a common values.IsEmpty check after all type-specific branches in both VADD and VSIM to reject zero-dimension vector requests with a clear error instead of passing them through to DiskANN. The FP32 alignment check remains in the FP32-specific branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4af5c0a to
2822e68
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added copilot-generated patch for INT8 vectors support in vector sets.