Skip to content
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

[BUG] Error output when using AOT mode but not JIT mode to run llama3.mojo #3113

Open
EllisLambda opened this issue Jun 24, 2024 · 0 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@EllisLambda
Copy link

EllisLambda commented Jun 24, 2024

Bug description

When running llama3.mojo compiled in AOT mode (using 'mojo build'), error output occurs, even using --no-optimization, most important is that the error output token is different for each run(most common is repeating output wrong token). However, when using JIT mode (using 'mojo run'), no issues are encountered.

Steps to reproduce

The JIT mode is following the steps in Run inference. Here's the normal outputs:

$ mojo run llama3q.mojo llama3_8b_instruct_q80.bin -z tokenizer.bin -i "The planets of the solar system are" -n 128 -t 0
num parallel workers: 8  SIMD width: float32: 64  int32: 64  int8: 256
Reading weights...
header done, bytes read: 256
rms_att_weight done, bytes read: 524544
rms_ffn_weight done, bytes read: 1048832
rms_final_weight done, bytes read: 1065216
q_token_embedding_table done, bytes read: 559235328
token_embedding_table done, bytes read: 559235328
dequantize token_embedding_table done, bytes read: 559235328
wq, wk, wv, wo done, bytes read: 1985298688
w1, w2, w3 done, bytes read: 7974764800
wcls done, bytes read: 8532934912
n layers: 32 | vocab size: 128256
The planets of the solar system are the eight celestial bodies that orbit around the Sun. They are:
1. Mercury: The smallest planet in our solar system, Mercury is a rocky, barren world with a highly elliptical orbit.
2. Venus: The second planet from the Sun, Venus is a scorching hot world with a thick atmosphere that traps heat.
3. Earth: The third planet from the Sun, Earth is a terrestrial planet with a diverse range of environments and life forms.
4. Mars: The fourth planet from the Sun, Mars is a rocky, barren world with a thin atmosphere and a potential for life.

The AOT mode use mojo build --no-optimization llama3q.mojo to build the binary file and execute the file with same params.

$ mojo build --no-optimization  llama3q.mojo
$ ./llama3q llama3_8b_instruct_q80.bin -z tokenizer.bin -i "The planets of the solar system are" -n 128 -t 0
num parallel workers: 8  SIMD width: float32: 64  int32: 64  int8: 256
Reading weights...
header done, bytes read: 256
rms_att_weight done, bytes read: 524544
rms_ffn_weight done, bytes read: 1048832
rms_final_weight done, bytes read: 1065216
q_token_embedding_table done, bytes read: 559235328
token_embedding_table done, bytes read: 559235328
dequantize token_embedding_table done, bytes read: 559235328
wq, wk, wv, wo done, bytes read: 1985298688
w1, w2, w3 done, bytes read: 7974764800
wcls done, bytes read: 8532934912
n layers: 32 | vocab size: 128256
The planets of the solar system areinerinerinerinerineriner

System information

mojo -v

mojo 24.4.0 (2cb57382)

modular -v

modular 0.8.0 (39a426b5)

mojo build --sanitize address llama3q.mojo
OnlinePaste

@EllisLambda EllisLambda added bug Something isn't working mojo-repo Tag all issues with this label labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

1 participant