Skip to content

Add INT8 vector support for vector sets#1806

Draft
harsha-simhadri wants to merge 6 commits into
microsoft:mainfrom
harsha-simhadri:harshasi/add_int8_support_vectorset
Draft

Add INT8 vector support for vector sets#1806
harsha-simhadri wants to merge 6 commits into
microsoft:mainfrom
harsha-simhadri:harshasi/add_int8_support_vectorset

Conversation

@harsha-simhadri
Copy link
Copy Markdown

Added copilot-generated patch for INT8 vectors support in vector sets.

Copilot AI review requested due to automatic review settings May 17, 2026 01:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.SB8 enum member and dimension calculation support.
  • VADD and VSIM parsers accept an SB8 <bytes> form; VADD now also permits Q8 quantization.
  • DiskANNService.Insert / SearchVector accept SB8 vectors; TryGetEmbedding dequantizes 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 thread libs/server/Resp/Vector/DiskANNService.cs Outdated
Comment thread libs/server/Resp/Vector/DiskANNService.cs Outdated
Comment thread libs/server/Resp/Vector/RespServerSessionVectors.cs
Comment thread libs/server/Resp/Vector/RespServerSessionVectors.cs
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];
Comment thread libs/server/Storage/Session/MainStore/VectorStoreOps.cs
Comment thread libs/server/Resp/Vector/RespServerSessionVectors.cs
@harsha-simhadri harsha-simhadri marked this pull request as draft May 18, 2026 21:55
harsha-simhadri and others added 6 commits May 19, 2026 16:48
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>
@harsha-simhadri harsha-simhadri force-pushed the harshasi/add_int8_support_vectorset branch from 4af5c0a to 2822e68 Compare May 19, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants