-
Notifications
You must be signed in to change notification settings - Fork 1.7k
IndexOutOfBoundsException on working code after integrating new working code that used ByteBuffer instead of MemorySegment #11294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was able to reproduce the problem (on Linux) but I think it is not related to GraalVM because I see exactly the same issue when running the example on OpenJDK 25 (EA build). |
Should I log this under the JDK issue tracker here? |
Just FYI I was encountering the same problem trying to run the Gemma1.1-2B and DevstralQ4 but it works fine with all the Llama's and Mistral-7b-Q8 |
It feels more like this is a problem in @mukel 's code. Can you have a look? Might still be a Java problem but this seems rather unlikely. |
Logged bug on bugreport.java.com internal review Id 9078583 |
If you look at what it's doing it's fairly straightforward; its traversing an array backed by a MemorySegment. It gets through it and then it doesn't for no logical reason. |
I figured out the new Magistral model and integrated it and what do ya know, same IndexOutOfBoundsException! But now it's in vector dot. BTW the report says Oracle confirmed its in JDK 21 as well. |
IndexOutOfBoundsException after integrating code from https://github.com/mukel/qwen2.svm.java into Llama3.java. Code which worked with ByteBuffer now failing on MemorySegment. Failure occurs under Java 25 GraalVM vector extensions incubator under both windows 11 and Ubuntu 22.04.
Steps to reproduce the issue
git clone --depth 1 https://github.com/neocoretechs/Llama4jNoDeps
compile_rel.bat
jar_llama3.bat
chat_qwendb.bat
java version "25" 2025-09-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 25-dev+20.1 (build 25+20-LTS-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25-dev+20.1 (build 25+20-LTS-jvmci-b01, mixed mode, sharing)
NOTE: must acquire qwen2-7b-instruct-q8_0.gguf from HuggingFace etc. for proper model
llama3runwithQwen2IndexOutOfBounds.txt
Windows 11 - AMD Threadripper 32 gig. Same result under Ubuntu 22.04, Ryzen 9 Hx370 128 gig using -Xmn96g -Xms96g -Xmx96g
RUN WITH STACE TRACE:
The text was updated successfully, but these errors were encountered: