Skip to content

Can we use Panama Vector API for quantizing vectors? #13922

Open
@benwtrent

Description

@benwtrent

Description

It would take a bit of refactoring, but:

    float dx = v - minQuantile;
    float dxc = Math.max(minQuantile, Math.min(maxQuantile, v)) - minQuantile;
    float dxs = scale * dxc;
    float dxq = Math.round(dxs) * alpha;
    if (dest != null) {
      dest[destIndex] = (byte) Math.round(dxs);
    }
    return minQuantile * (v - minQuantile / 2.0F) + (dx - dxq) * dxq;

All these actions seem like they could be done lane-wise. Though, I expect the transformation from FloatVector to byte[] array to be the most expensive part and consequently, might make vectorizing this effectively impossible.

of course, much of the stuff here written for value reuse would have to be adjusted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions