Skip to content

Cast query embeddings to fp32 before faiss search #2406

@sahel-sh

Description

@sahel-sh

Currently the corpus embeddings are casted to fp32 before faiss search[1] but queries are not[2]. Even though --fp16 is supported for query encoders, as well[3].

[1] https://github.com/castorini/pyserini/blob/master/pyserini/index/faiss.py#L62
[2] https://github.com/castorini/pyserini/blob/master/pyserini/search/faiss/_searcher.py#L202
[3] https://github.com/castorini/pyserini/blob/e9b559c32c10893ae61c12a0c1e9ee2b264a2e41/pyserini/search/faiss/main.py#L294

This is a one line fix, but it might require an audit of all the 2crs using --fp16 for search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions