Update ONNX Gen AI jextract example#304
Conversation
Signed-off-by: Ana-Maria Mihalceanu <ana-maria.m.mihalceanu@oracle.com>
|
👋 Welcome back amihalceanu! A progress list of the required criteria for merging this PR into |
|
@ammbra This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
|
|
||
| ```bash | ||
| export ONNX_LIB_PATH=/.../onnxruntime-genai/build/macOS/RelWithDebInfo/ | ||
| export ONNX_LIB_PATH=/path/.../onnxruntime-genai/lib/ |
There was a problem hiding this comment.
I can't find a lot of references to this variable -- could we please double check this is really needed?
There was a problem hiding this comment.
E.g. our compile.sh script doesn't need this -- so who does? Is it jextract, or is the execution of the Java program? If the latter, it feels like there should be better options to point FFM to the correct libraries
There was a problem hiding this comment.
I see -- that part is depended on by run.sh, not compile.sh.
I'd suggest to reorder the bullets:
- set ORT_GENAI_INCLUDE_DIR
- run compile.sh
- download model
- set ONNX_LIB_PATH
- run run.sh
And, I think it would probably be even better to point jextract at the two libraries explicitly using -l flags, so that step (4) can be omitted entirely.
There was a problem hiding this comment.
I reordered and reworded the steps, but I think is easier to run the example when the native library is given at runtime.
Signed-off-by: Ana-Maria Mihalceanu <ana-maria.m.mihalceanu@oracle.com>
|
I guess what I'm trying to get at is a place where maybe we don't need to ask the user to copy a library from one place to another? If ONNX_LIB is used to set java.library.path (which allows multiple paths) perhaps it would be better to ask developers to set two variables:
And then derive from (2) the include folder for jextract and from (1 + 2) the correct -Djava.library.path -- e.g. as in |
1. Status Quo
The current ONNX Gen AI example requires end users to manually build the native library. A lot of files are needed only to build the native runtime, but not serving a need later on.
2. Problem
The native build instructions are subject to change when comes to prerequisites and the build from latest sources can also come with unresolved issues on the native side.
3. Fix
This pull request introduces a few changes in the prerequisites:
onnxruntimeandonnxruntime-genai(theonnxruntime-genaiis a wrapper over the nativeonnxruntime). Release archives have the structure:The user should manually move the
libonnxruntime<release>.dylibin theonnxruntime-genailib folder.onnxruntime-genairelease using thepromptmethod code and add a way to exit the from LLM conversation incallmethod.I run tests through Github actions enabled in my fork.
Progress
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jextract.git pull/304/head:pull/304$ git checkout pull/304Update a local copy of the PR:
$ git checkout pull/304$ git pull https://git.openjdk.org/jextract.git pull/304/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 304View PR using the GUI difftool:
$ git pr show -t 304Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jextract/pull/304.diff
Using Webrev
Link to Webrev Comment