Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NPE with Faiss Byte Vectors when filtering #2310

Open
naveentatikonda opened this issue Dec 4, 2024 · 0 comments
Open

[BUG] NPE with Faiss Byte Vectors when filtering #2310

naveentatikonda opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working v2.19.0

Comments

@naveentatikonda
Copy link
Member

naveentatikonda commented Dec 4, 2024

What is the bug?
Running into NullPointerException when we are computing P * Dimension <= Max_distance_computations for faiss efficient filters using byte vectors. But, it is working fine for all other scenarios.

{
  "error": {
    "root_cause": [
      {
        "type": "null_pointer_exception",
        "reason": "Cannot read the array length because the return value of \"org.opensearch.knn.index.query.KNNQuery.getByteQueryVector()\" is null"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "development-20241204111110-3de6471c",
        "node": "5ry1X70gTgyIOlMItg6TzA",
        "reason": {
          "type": "null_pointer_exception",
          "reason": "Cannot read the array length because the return value of \"org.opensearch.knn.index.query.KNNQuery.getByteQueryVector()\" is null"
        }
      }
    ],
    "caused_by": {
      "type": "null_pointer_exception",
      "reason": "Cannot read the array length because the return value of \"org.opensearch.knn.index.query.KNNQuery.getByteQueryVector()\" is null",
      "caused_by": {
        "type": "null_pointer_exception",
        "reason": "Cannot read the array length because the return value of \"org.opensearch.knn.index.query.KNNQuery.getByteQueryVector()\" is null"
      }
    }
  },
  "status": 500
}

Proposed Solution
Here, we are trying to get byteQueryVector instead of queryVector. We need to get queryVector here because for byte datatype with Faiss engine we will do byte range validation and still store it as a normal query vector to pass it later to Faiss ScalarQuantizer. The Faiss SQ expects the query vector as an fp32 vector.

The fix with integ test in my feature branch - naveentatikonda@bbeb3de

@naveentatikonda naveentatikonda added the bug Something isn't working label Dec 4, 2024
@naveentatikonda naveentatikonda self-assigned this Dec 4, 2024
@navneet1v navneet1v moved this to 2.19.0 in Vector Search RoadMap Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.19.0
Projects
Status: 2.19.0
Development

No branches or pull requests

2 participants