[code-reflection] RFR: ONNX FFM Runtime initial work [v3]

Adam Sotona asotona at openjdk.org
Mon Feb 10 14:10:25 UTC 2025


On Mon, 10 Feb 2025 13:17:36 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   minor rename
>
> cr-examples/onnx/src/main/java/oracle/code/onnx/OnnxRuntime.java line 224:
> 
>> 222:             public int getNumberOfInputs() {
>> 223:                 try {
>> 224:                     return retInt(sessionGetInputCount.invokeExact(sessionAddress, ret));
> 
> I note the use of this shared `ret` output segment. We plan to add more capabilities to FFM to address the case of recyclable allocation -- this will help code like this to avoid the shared segment, at the same time while avoiding the cost of a malloc per call.

That would be very helpful.
Truly I haven't found any FFM hints which type of arena is best for specific case.
My guess is that garbage-collected allocations may be better than creating and disposing individual arena for each allocation (I've seen a lot of objects constructed).
Simple manual disposal of a memory segment might be a step forward?

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/311#discussion_r1949123217


More information about the babylon-dev mailing list