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 139 forks source link

Crashes when running the example command #85

Closed CanLikeTo closed 4 months ago

CanLikeTo commented 5 months ago

Hi

I'm following the instructions to get started and whenever I run:

mojo llama2.mojo stories15M.bin -s 100 -n 256 -t 0.5 -i "Mojo is a language"

it crashes with the following info:

num parallel workers: 8  SIMD width: 16
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.  Program arguments: mojo llama2.mojo stories15M.bin -s 100 -n 256 -t 0.5 -i "Mojo is a language"
#0 0x0000000102becfd8 llvm_strlcpy (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000ccfd8)
#1 0x0000000102beb138 llvm_strlcpy (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000cb138)
#2 0x0000000102bed678 llvm_strlcpy (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000cd678)
#3 0x0000000180a69a24 (/usr/lib/system/libsystem_platform.dylib+0x18046da24)
#4 0x000000028000e7a0
#5 0x0000000102f8a5a8 llvm_strlcpy (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10046a5a8)
#6 0x0000000102b41e94 _mh_execute_header (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100021e94)
#7 0x0000000102b25bd0 _mh_execute_header (~/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100005bd0)
#8 0x00000001806b90e0
[15981:92870:20240318,112922.885502:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)
zsh: segmentation fault  mojo llama2.mojo stories15M.bin -s 100 -n 256 -t 0.5 -i "Mojo is a language"

System info Macbook Pro, 14inch, 2021. macOS:14.2.1 (23C71) mojo 24.1.0 (55ec12d6) modular 0.5.2 (6b3a04fd)

CanLikeTo commented 5 months ago

OK, it turns out that the model parameters file never properly downloaded and was corrupted. The issue is solved.