You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Pulkitg64 (via GitHub)" <gi...@apache.org> on 2026/08/19 20:07:45 UTC
[I] Implement quantization on fp16 directly without inflating to fp32 [lucene]
Pulkitg64 opened a new issue, #16533:
URL: https://github.com/apache/lucene/issues/16533
### Description
Follow-up to #16473, which added scalar quantization support for the float16 vector encoding.
The quantization works on fp32, so every fp16 vector is inflated to a float[] before it is quantized, and the centroid and corrective terms are computed in fp32 as well. Since Java has no fp16 arithmetic type, so there is no way to compute in fp16 at the moment. Once Java have support for doing arithmetic operations on fp16 directly, we should switch our existing implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] Implement quantization on fp16 directly without inflating to fp32 [lucene]
Posted by "CH-Abhinav (via GitHub)" <gi...@apache.org>.
CH-Abhinav commented on issue #16533:
URL: https://github.com/apache/lucene/issues/16533#issuecomment-5531855978
May be I am not correct but I guess we have `jdk.incubator.vector.Float16` though not flat and requires value classes to improve but it is worth a try I guess (just heap will be object clutter of f16).
Also Java as `Float.floatToFloat16()` which we can try using instead (idk if we are using this need to check it)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] Implement quantization on fp16 directly without inflating to fp32 [lucene]
Posted by "Pulkitg64 (via GitHub)" <gi...@apache.org>.
Pulkitg64 commented on issue #16533:
URL: https://github.com/apache/lucene/issues/16533#issuecomment-5591120385
> May be I am not correct but I guess we have jdk.incubator.vector.Float16 though not flat and requires value classes to improve but it is worth a try I guess (just heap will be object clutter of f16).
@CH-Abhinav I think the issue which you pointed out are correct. The issue with this approach is the object overhead for each float value. Also if you check the implementation of Float16 class ([link](https://docs.oracle.com/en/java/javase/24/docs/api/jdk.incubator.vector/jdk/incubator/vector/Float16.html)), you will find it is also doing the same conversion which we are doing in the existing implementation. So using Float16 class does not bring any benefits to us.
```
public float floatValue() {
return float16ToFloat(value);
}
```
> Also Java as Float.floatToFloat16() which we can try using instead (idk if we are using this need to check it)
We are already doing this in the existing implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org