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

fix: fail to load ivf_flat(metric = cosine) with DeserializeFromFile #841

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

cqy123456
Copy link
Collaborator

@cqy123456 cqy123456 commented Sep 14, 2024

issue:milvus-io/milvus#36052

When we set IO_FLAG_WITH_NORM = true to read a faiss index, ArrayInvertedLists will read into a read-only OnDiskInvertedLists.
OnDiskInvertedLists will mmap all ids and vectors with the index file, and record the ids and vectors offset in memory. If we use cosine, l1-norms will save in index file and all offsets are wrong.

Copy link

mergify bot commented Sep 14, 2024

@cqy123456 🔍 Important: PR Classification Needed!

For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:

  1. If you're fixing a bug, label it as kind/bug.
  2. For small tweaks (less than 20 lines without altering any functionality), please use kind/improvement.
  3. Significant changes that don't modify existing functionalities should be tagged as kind/enhancement.
  4. Adjusting APIs or changing functionality? Go with kind/feature.

For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”.

Thanks for your efforts and contribution to the community!.

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.40%. Comparing base (3c46f4c) to head (0ab4eb2).
Report is 201 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main     #841       +/-   ##
=========================================
+ Coverage      0   75.40%   +75.40%     
=========================================
  Files         0       86       +86     
  Lines         0     6318     +6318     
=========================================
+ Hits          0     4764     +4764     
- Misses        0     1554     +1554     

see 86 files with indirect coverage changes

Copy link
Collaborator

@foxspy foxspy left a comment

Choose a reason for hiding this comment

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

/lgtm

@foxspy
Copy link
Collaborator

foxspy commented Sep 14, 2024

/kind bugfix

@sre-ci-robot
Copy link
Collaborator

@foxspy: The label(s) kind/bugfix cannot be applied, because the repository doesn't have them.

In response to this:

/kind bugfix

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alexanderguzhva
Copy link
Collaborator

/hold

}
}

void OnDiskInvertedLists::release_code_norms(size_t list_no, const float* codes)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it needed to override this method in the provided way?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to clarify the question. It seems that the base class has the same implementation as the added one

Copy link
Collaborator Author

@cqy123456 cqy123456 Sep 19, 2024

Choose a reason for hiding this comment

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

@alexanderguzhva I thought the behavior in release_code_norms is based on the storage method of InvertedList(e.g. ArrayInvertedLists, ConcurrentArrayInvertedLists), so this function is overrided, and this function do nothing like the basic class.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then I would eliminate it, because it does nothing.
Or I can lgtm the PR, just let me know. :)

@mergify mergify bot removed the ci-passed label Sep 18, 2024
@cqy123456 cqy123456 added kind/bug This PR is a bug fix kind/improvement labels Sep 19, 2024
Copy link

mergify bot commented Sep 19, 2024

@cqy123456 Please remove redundant kind/xxx labels and make sure that there is only one kind/xxx label of your Pull Request. (eg. “/remove-kind improvement”)

@cqy123456
Copy link
Collaborator Author

/unhold

Copy link
Collaborator

@liliu-z liliu-z left a comment

Choose a reason for hiding this comment

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

/lgtm

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cqy123456, foxspy, liliu-z

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cqy123456,foxspy,liliu-z]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify bot added the ci-passed label Sep 20, 2024
@sre-ci-robot sre-ci-robot merged commit 81d3b38 into zilliztech:main Sep 20, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants