Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/mojo_engine/bench_batch.sh # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / mojo_engine / bench_batch.sh` 31 lines ยท 938 bytes Raw Blame History 1 #!/bin/bash 2 set -e 3 MOJO_LIB="$HOME/.local/share/uv/tools/mojo/lib/python3.11/site-packages/modular/lib" 4 SRC="tinyllama_gen_batch.mojo" 5 6 for B in 2 4 8; do 7 echo "" 8 echo "==============================" 9 echo " Building B=$B" 10 echo "==============================" 11 sed -i "s/comptime B: Int = [0-9]*/comptime B: Int = $B/" "$SRC" 12 mojo build "$SRC" --emit object -o "tinyllama_gen_batch.o" 13 gcc -o "tinyllama_gen_batch_${B}" "tinyllama_gen_batch.o" \ 14 -L"$MOJO_LIB" \ 15 -lKGENCompilerRTShared \ 16 -lAsyncRTRuntimeGlobals \ 17 -lMSupportGlobals \ 18 -lAsyncRTMojoBindings \ 19 -lm -lpthread -ldl -lstdc++ 20 21 echo "" 22 echo "--- Running B=$B (3 runs) ---" 23 for run in 1 2 3; do 24 LD_LIBRARY_PATH="$MOJO_LIB" "./tinyllama_gen_batch_${B}" 2>&1 | grep "B=" 25 done 26 done 27 28 # Restore to B=4 29 sed -i "s/comptime B: Int = [0-9]*/comptime B: Int = 4/" "$SRC" 30 echo "" 31 echo "Done."