-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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]: bulkinsert f16 and bf16 data in csv will cause accuracy issue #36632
Comments
/assign OxalisCu |
Correct. For FP16 (half-precision), you get less accuracy compared to FP32. Specifically: FP16 (half precision) has 5 decimal digits of precision (approximately). |
So I think there is no way you can maintain that much detail with fp16. Most likely your data is under fp64 or double and Milvus don't support it for now. Because for vectors there is usually not a necessity to keep it full precision |
I understand that json.Unmarshal parses floating point numbers according to f32 by default, which will cause precision loss for f64, but it has no effect on f16 type. The data 0.89990234375 is generated in pymilvus, because before json.dumps, np.array(dtype=np.float16).tolist() converts nparray into list, and python native data types do not support float16, so they are stored as float64, but in fact we only need float16 precision. In short, my submission has no practical significance, and I am ready to close this PR. |
Is there an existing issue for this?
Environment
Current Behavior
Using
json.Unmarshal([]byte(obj), &vec)
to parse an array in the code will result in loss of float:Expected Behavior
Steps To Reproduce
No response
Milvus Log
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: