[code-reflection] RFR: Add support for other onnx providers (CoreML) [v2]
Adam Sotona
asotona at openjdk.org
Fri Oct 17 13:30:16 UTC 2025
On Fri, 17 Oct 2025 12:53:44 GMT, Ana Maria Mihalceanu <duke at openjdk.org> wrote:
>> This PR contains a series of changes meant to integrate other ONNX providers.
>>
>> * It contains generated Java bindings for CoreML provider: `oracle.code.onnx.foreign.coreml_provider_factory_h`
>> * Configurations of providers are present in `oracle.code.onnx.provider`.
>> * Provider configuration should occur via `SessionOptions` on inference session, prior to any work done by the native library. Hence why `OnnxRuntime` has an `executeWithOptions` method.
>> * There is a small UI example that use [Facial Emotion Recognition](https://github.com/onnx/models/tree/main/validated/vision/body_analysis/emotion_ferplus) model on how use the CoreML provider under `test` directory, inside `oracle.code.onnx.fer`.
>> * The `README.md` file contains instructions on how to run the example and how to regenerate the bindings for the provider. Instructions and scripts to regenerate the bindings were provided for macOS users only since CoreML is an Apple software.
>>
>> Work done in this PR is done together with Lize Raes.
>
> Ana Maria Mihalceanu has updated the pull request incrementally with one additional commit since the last revision:
>
> Update full name
Generally it looks great, thank you for the contribution!
cr-examples/onnx/setup.sh line 1:
> 1: #!/bin/bash
Files related to (re)generation of the library could be better stored under opgen folder/project.
cr-examples/onnx/src/main/java/oracle/code/onnx/OnnxRuntime.java line 244:
> 242: }
> 243:
> 244: public static <T> T executeWithOptions(Arena arena, MethodHandles.Lookup l, OnnxFunction<T> codeLambda, SessionOptions options) {
I would recommend to make this method as an override of execute.
Original execute duplicates the code, so it can delegate with no options instead.
cr-examples/onnx/src/test/resources/oracle/code/onnx/fer/emotion-ferplus-8.onnx.data line 1:
> 1: �O:=;z�<�2I;F�i�=��<ӏ&�~�;.s�E J�b2���Q=��=��/�3�ڽ�FY�
We should double-check if it is OK to store 33M binary directly into the Git repo.
-------------
PR Review: https://git.openjdk.org/babylon/pull/618#pullrequestreview-3350323741
PR Review Comment: https://git.openjdk.org/babylon/pull/618#discussion_r2440025962
PR Review Comment: https://git.openjdk.org/babylon/pull/618#discussion_r2439993076
PR Review Comment: https://git.openjdk.org/babylon/pull/618#discussion_r2440029296
More information about the babylon-dev
mailing list