tairov / llama2.mojo

Inference Llama 2 in one file of pure 🔥
https://www.modular.com/blog/community-spotlight-how-i-built-llama2-by-aydyn-tairov
MIT License
2.09k stars 140 forks source link

Error executing mojo llama2.mojo #2

Closed mpage38 closed 1 year ago

mpage38 commented 1 year ago

After having installed mojo (working), and llama2 as described, running mojo llama2.mojo on ubuntu 22.04 with 16 cores, I get:

llama2.mojo $ mojo llama2.mojo num hardware threads: 16 SIMD vector width: 16 checkpoint size: 60816028 Unhandled exception caught during execution: An error occurred in Python. mojo: error: execution exited with a non-zero result: 1

tairov commented 1 year ago

Hi @mpage38 , thanks for opening this issue. Yeah, I got ton of messages like this during my implementation. Did you have a stack dumped? Could you please make sure you have llvm-symbolizer installed on your system. And then share the stack trace.

Also did you tried any examples from Mojo to execute on you environment?

As a workaround I can suggest to upload llama2.mojo & read module directory to modular playground (just copy llaam2.mojo content to the notebook), there you need to upload stories15M.bin to playground as well. It was working fine in playground.

raxbits commented 1 year ago

Hi @mpage38 , thanks for opening this issue. Yeah, I got ton of messages like this during my implementation. Did you have a stack dumped? Could you please make sure you have llvm-symbolizer installed on your system. And then share the stack trace.

Also did you tried any examples from Mojo to execute on you environment?

As a workaround I can suggest to upload llama2.mojo & read module directory to modular playground (just copy llaam2.mojo content to the notebook), there you need to upload stories15M.bin to playground as well. It was working fine in playground.

i have llvm 14 (with symbolizer) installed , still getting same. mojo 0.2.1 (64d14e85) is version.

tairov commented 1 year ago

@raxbits could you share stack trace?

raxbits commented 1 year ago

@raxbits could you share stack trace?

sure. 1 sec. strace_output.txt

EDIT: HARDWARE INFO ADDED BELOW

Computer

Processor | AMD Ryzen 5 5600X 6-Core Processor Memory | 32780MB Machine Type | Desktop Operating System | Linux Mint 21.2

tairov commented 1 year ago

@raxbits Linux Mint 21.2 ? I think mojo currently supports only Ubuntu OS please see this : https://docs.modular.com/mojo/manual/get-started/#system-requirements

ZeroHackz commented 1 year ago

Ngl I have the same issue on Ubuntu 22.04.

tempsnip

These are the commands I used. tempsnip2

Everything installed succesfully also on version 14 LLVM. Mind sharing a bit more about your setup?

tairov commented 1 year ago

@ZeroHackz I think I just used standard instructions from this page https://docs.modular.com/mojo/manual/get-started/index.html And then just separately I installed llvm-symbolizer

The error message you shared says An error occured in Python, probably this could be related to MOJO_PYTHON_LIBRARY env variable.

Which version of Python do you have ? Can you execute successfully mojo/examples?

Try to follow instructions from this repo https://github.com/trevorhobenshield/mojodojo

If it won't help, I think the only way is to debug the code by switching off python related lines

raxbits commented 1 year ago

@raxbits Linux Mint 21.2 ? I think mojo currently supports only Ubuntu OS please see this : https://docs.modular.com/mojo/manual/get-started/#system-requirements

fair. r u able to dockerize ur app? can help a ton. thanks!

g1y5x3 commented 1 year ago

Which version of Python do you have ?

3.10.12

Can you execute successfully mojo/examples?

Yes, all the examples run.

Try to follow instructions from this repo https://github.com/trevorhobenshield/mojodojo

I followed the instructions but unfortunately it didn't help. Also running on Ubuntu 22.04

tairov commented 1 year ago

@mpage38 @raxbits @ZeroHackz could you guys confirm , is the issue disappear after pulling latest changes? Essentially this repo didn't contain tokenizer.bin

And yes, Mojo is still in early stages.. I think I need to add some pre-checks and print nice messages if some files couldn't be found or broken.

raxbits commented 1 year ago

@mpage38 @raxbits @ZeroHackz could you guys confirm , is the issue disappear after pulling latest changes? Essentially this repo didn't contain tokenizer.bin

And yes, Mojo is still in early stages.. I think I need to add some pre-checks and print nice messages if some files couldn't be found or broken.

just pulled and seems fixed :+1: