Replies: 4 comments
-
Updates: a) gpt2 works fine on x86_64 linux with or without the masking patch. b) gpt2 works fine on arm64 linux using the current HEAD c) gpt2 on Apple's M1+Metal - produces the wrong answer using this branch. Unfortunately, I cannot go back and forth on the commits because the patch for making IREE on Metal is still WIP by @antiagainst and the existing patches don't compose well. d) gpt2 on Apple's M1 without Metal segfaults using the current HEAD. The standalone kernel responsible for segfaulting is this. Still trying to find the root cause of the segfault. |
Beta Was this translation helpful? Give feedback.
-
Updates: https://gist.github.com/afec50c1bab4b3a4c4cc786271d3ef7f contains a smaller kernel The crashing instructions are as follows:
Reading the ARM document, apparently x18 is a platform specific register.
https://gist.github.com/8eab36cd1eb39beb83b458eabbfc3913 is the assembly generated for the dispatch by iree This may not be the only error though (I don't see this error for 768x13 - it shows up only for 8x13. Consistently though. |
Beta Was this translation helpful? Give feedback.
-
Changing |
Beta Was this translation helpful? Give feedback.
-
Fixed for llvm-cpu backend with #12460 |
Beta Was this translation helpful? Give feedback.
-
I used the string "Hello, my dog is cute" as a prompt and ran James' KV-caching-enabled GPT-2 implementation in the following ways. The expected result of the encoding should be [13], which in GPT-2 means "the period."
🟢 Running the JAX program without
jax.jit
on an M1 Max MacBook Pro was smooth. The result is correct, [13].🟢 Compiling the JAX program into vmvx using IREE and running it using
iree-run-module
.The result is correct.
🟡 Compiling the JAX program into metal code using this branch of IREE, running it using
iree-run-module
on an M1 Max MacBook Pro.It runs and retuns an answer. Unfortunately, the result is wrong (not 13):
🔴 Running the above
/tmp/gpt2-metal.vmfb
on an iPhone 13 with A chip. The iOS app crashed at allocating a tensor. Details are at here.🔴 Compiling the JAX program into
llvm-cpu
code on an M1 Max MacBook Pro and run it usingiree-run-module
on the same computer.The running of iree-run-module crashed.
I also tried to run this vmfb in the iOS Simulator. It also crashed. The team has been investigating this issue EXC_BAD_ACCESS signal received executing GPT2 llvm-cpu on iOS Simulator #12369
Beta Was this translation helpful? Give feedback.
All reactions