Skip to content

Commit

Permalink
pthreads: fixed memory 4GB
Browse files Browse the repository at this point in the history
  • Loading branch information
mtasic85 committed Feb 12, 2024
1 parent f17cd9d commit c609188
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion build-pthread.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ cd ../..
mkdir -p $LLAMA_CPP_BUILD_DIR
cd $LLAMA_CPP_BUILD_DIR
emcmake cmake ../../$LLAMA_CPP_SOURCE_DIR
export EMCC_CFLAGS="-O3 -msimd128 -pthread -DNDEBUG -s FORCE_FILESYSTEM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s INITIAL_MEMORY=1GB -s MAXIMUM_MEMORY=4GB -s ALLOW_MEMORY_GROWTH -s EXPORTED_FUNCTIONS=_main -s EXPORTED_RUNTIME_METHODS=callMain -s NO_EXIT_RUNTIME=1"
# export EMCC_CFLAGS="-O3 -msimd128 -pthread -DNDEBUG -s FORCE_FILESYSTEM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s INITIAL_MEMORY=1GB -s MAXIMUM_MEMORY=4GB -s ALLOW_MEMORY_GROWTH -s EXPORTED_FUNCTIONS=_main -s EXPORTED_RUNTIME_METHODS=callMain -s NO_EXIT_RUNTIME=1"
export EMCC_CFLAGS="-O3 -msimd128 -pthread -DNDEBUG -s FORCE_FILESYSTEM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s INITIAL_MEMORY=4GB -s EXPORTED_FUNCTIONS=_main -s EXPORTED_RUNTIME_METHODS=callMain -s NO_EXIT_RUNTIME=1"
emmake make main
cd ../..

Expand Down
3 changes: 1 addition & 2 deletions dist/llama/main-worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { action } from "./actions.js";
import { loadBinaryResource } from "./utility.js";
// import Module from "./main.js";
import Module from "./main.worker.mjs";
import Module from "./main.js";

// WASM Module
let module;
Expand Down
2 changes: 1 addition & 1 deletion dist/llama/main.js

Large diffs are not rendered by default.

Binary file modified dist/llama/main.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ <h2> Demo </h2>
</main>

<!-- example -->
<script type="module" src="example.js?v=240212-4"></script>
<script type="module" src="example.js?v=240212-6"></script>
</body>
</html>
3 changes: 1 addition & 2 deletions docs/llama/main-worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { action } from "./actions.js";
import { loadBinaryResource } from "./utility.js";
// import Module from "./main.js";
import Module from "./main.worker.mjs";
import Module from "./main.js";

// WASM Module
let module;
Expand Down
2 changes: 1 addition & 1 deletion docs/llama/main.js

Large diffs are not rendered by default.

Binary file modified docs/llama/main.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions src/llama/main-worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { action } from "./actions.js";
import { loadBinaryResource } from "./utility.js";
// import Module from "./main.js";
import Module from "./main.worker.mjs";
import Module from "./main.js";

// WASM Module
let module;
Expand Down

0 comments on commit c609188

Please sign in to comment.