-
Notifications
You must be signed in to change notification settings - Fork 24
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
support int8 for hnsw #65
Conversation
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/index/hnsw.cpp
Outdated
vectors = (void*)base->GetInt8Vectors(); | ||
data_size = dim_ * sizeof(int8_t); | ||
} else { | ||
throw std::invalid_argument("fail to support this data type"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the exception message need include unknown type id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i removed this choice because the part will be completed during the parameter checking phase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this function, it is still recommended to add a check for the parameter type_
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} else if (type == vsag::DataTypes::DATA_TYPE_INT8) { | ||
fstdistfunc_ = vsag::GetINT8InnerProductDistanceFunc(dim); | ||
data_size_ = dim * sizeof(int8_t); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here need process unsupported type
src/data_type.h
Outdated
case DataTypes::DATA_TYPE_FP16: | ||
return "float16"; | ||
} | ||
return "unknown type"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "unknown type (" + std::to_string(type(int)) + ")";
issue: #64