Search code examples
milvus

Why is my vector precision lost in milvus?


I am using version 2.0.2 of Milvus. When I insert 100,000 double-precision floating-point vectors into Milvus. I later use the query interface to get the original vector based on the id. But the obtained vector, I found that has become a single-precision floating-point type. why is that?


Solution

  • https://milvus.io/docs/v2.0.0/create_collection.md
    https://milvus.io/docs/v2.0.x/schema.md

    The vector field only supports BINARY_FLOAT and FLOAT_VECTOR types. They don't state it anywhere in the docs, but it is safe to assume FLOAT_VECTOR refers to a single precision floating point or np.float32 type. In most machine learning applications, float32 is used to reduce the size of the neural network's memory, since most of the time float64 offers almost no benefit to accuracy.

    Basically, you are probably limited to using float32 since milvus doesn't seem to support float64 in the vector field at this time.