diff --git a/docs/develop/c/hello_world.md b/docs/develop/c/hello_world.md index 01c07a24f..00d12d669 100644 --- a/docs/develop/c/hello_world.md +++ b/docs/develop/c/hello_world.md @@ -73,7 +73,7 @@ With WasmEdge's AoT compiler, you will get higher performance. # Compile the wasm file with wasmedge aot compiler $ wasmedgec hello.wasm hello.wasm # Run the native binary with wasmedge -$ wasmedge hello.wasm +$ wasmedge --run-mode=aot hello.wasm ``` ## Example: Add function @@ -114,7 +114,7 @@ We can further improve performance by using wasmedge AOT compilation , this feat ```bash $ wasmedgec add.wasm add_aot.wasm -$ wasmedge add_aot.wasm 4 9 +$ wasmedge --run-mode=aot add_aot.wasm 4 9 13 ``` diff --git a/docs/develop/c/simd.md b/docs/develop/c/simd.md index 792d4f974..f44c63be1 100644 --- a/docs/develop/c/simd.md +++ b/docs/develop/c/simd.md @@ -50,5 +50,5 @@ With WasmEdge's AoT compiler, you will get higher performance. # Compile wasm-simd with wasmedge aot compiler $ wasmedge compile mandelbrot-simd.wasm mandelbrot-simd-out.wasm # Run the native binary with wasmedge -$ wasmedge mandelbrot-simd-out.wasm 15000 +$ wasmedge --run-mode=aot mandelbrot-simd-out.wasm 15000 ``` diff --git a/docs/develop/deploy/kubernetes/docker-slim.md b/docs/develop/deploy/kubernetes/docker-slim.md index 075749cb8..5b551a422 100644 --- a/docs/develop/deploy/kubernetes/docker-slim.md +++ b/docs/develop/deploy/kubernetes/docker-slim.md @@ -39,7 +39,7 @@ $ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge [2022-07-07 08:15:50.421] [info] compile done [2022-07-07 08:15:50.422] [info] output start -$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge hello.aot.wasm world +$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge --run-mode=aot hello.aot.wasm world hello world ``` diff --git a/docs/develop/go/hello_world.md b/docs/develop/go/hello_world.md index 69c635257..6386dae82 100644 --- a/docs/develop/go/hello_world.md +++ b/docs/develop/go/hello_world.md @@ -117,7 +117,7 @@ To achieve native Go performance for those applications, you could use the `wasm ```bash $ wasmedge compile hello.wasm hello.wasm -$ wasmedge hello.wasm +$ wasmedge --run-mode=aot hello.wasm Hello TinyGo from WasmEdge! ``` @@ -126,6 +126,6 @@ For the `--reactor` mode, ```bash $ wasmedge compile fib.wasm fib.wasm -$ wasmedge --reactor fib.wasm fibArray 10 +$ wasmedge --run-mode=aot --reactor fib.wasm fibArray 10 34 ``` diff --git a/docs/develop/javascript/hello_world.md b/docs/develop/javascript/hello_world.md index e92b2056c..7f10119cb 100644 --- a/docs/develop/javascript/hello_world.md +++ b/docs/develop/javascript/hello_world.md @@ -32,7 +32,7 @@ The reason to use `wasmedge-quickjs` as the current working directory is that `m You can try a simple "hello world" JavaScript program ([example_js/hello.js](https://github.com/second-state/wasmedge-quickjs/blob/main/example_js/hello.js)), which prints out the command line arguments to the console. ```bash -$ wasmedge --dir .:. wasmedge_quickjs.wasm example_js/hello.js WasmEdge Runtime +$ wasmedge --run-mode=aot --dir .:. wasmedge_quickjs.wasm example_js/hello.js WasmEdge Runtime Hello WasmEdge Runtime ``` @@ -85,7 +85,7 @@ WasmEdge provides a `wasmedgec` utility to compile and add a native machine code ```bash wasmedge compile target/wasm32-wasip1/release/wasmedge_quickjs.wasm wasmedge_quickjs.wasm -wasmedge --dir .:. wasmedge_quickjs.wasm example_js/hello.js +wasmedge --run-mode=aot --dir .:. wasmedge_quickjs.wasm example_js/hello.js ``` Next, we will discuss more advanced use cases for JavaScript in WasmEdge. diff --git a/docs/develop/javascript/tensorflow.md b/docs/develop/javascript/tensorflow.md index 0ccfed6f1..ce7fdf7a7 100644 --- a/docs/develop/javascript/tensorflow.md +++ b/docs/develop/javascript/tensorflow.md @@ -78,7 +78,7 @@ print(max / 255); To run the JavaScript in the WasmEdge runtime, make sure that you have the [WASI-NN plug-in and Tensorflow Lite dependency libraries installed with WasmEdge](../../start/install.md#wasi-nn-plug-in-with-tensorflow-lite-backend). You should see the food item's name recognized by the TensorFlow lite ImageNet model. ```bash -$ wasmedge --dir .:. wasmedge_quickjs_nn.wasm example_js/tensorflow_lite_demo/wasi_nn_main.js +$ wasmedge --run-mode=aot --dir .:. wasmedge_quickjs_nn.wasm example_js/tensorflow_lite_demo/wasi_nn_main.js label: Hot dog confidence: diff --git a/docs/develop/rust/dapr.md b/docs/develop/rust/dapr.md index a1550e003..7146d8109 100644 --- a/docs/develop/rust/dapr.md +++ b/docs/develop/rust/dapr.md @@ -72,7 +72,7 @@ dapr run --app-id image-api-grayscale \ --dapr-http-port 3503 \ --components-path ../config \ --log-level debug \ - wasmedge image-api-grayscale.wasm + wasmedge --run-mode=aot image-api-grayscale.wasm ``` ### The image classification microservice @@ -116,7 +116,7 @@ dapr run --app-id events-service \ --dapr-http-port 3505 \ --log-level debug \ --components-path ../config \ - wasmedge events_service.wasm + wasmedge --run-mode=aot events_service.wasm ``` ## Test diff --git a/docs/develop/rust/hello_world.md b/docs/develop/rust/hello_world.md index 360959f4d..748df4a74 100644 --- a/docs/develop/rust/hello_world.md +++ b/docs/develop/rust/hello_world.md @@ -71,12 +71,12 @@ If we don't have extra notes for AoT, all the WASM file will be executed in the ```bash wasmedge compile hello.wasm hello_aot.wasm -wasmedge hello_aot.wasm second state +wasmedge --run-mode=aot hello_aot.wasm second state ``` For the `--reactor` mode, ```bash wasmedge compile add.wasm add_aot.wasm -wasmedge --reactor add_aot.wasm add 2 2 +wasmedge --run-mode=aot --reactor add_aot.wasm add 2 2 ``` diff --git a/docs/develop/rust/http_service/client.md b/docs/develop/rust/http_service/client.md index da406c738..735e19ea9 100644 --- a/docs/develop/rust/http_service/client.md +++ b/docs/develop/rust/http_service/client.md @@ -37,10 +37,10 @@ wasmedge compile target/wasm32-wasip1/release/http.wasm http.wasm wasmedge compile target/wasm32-wasip1/release/https.wasm https.wasm # Run the HTTP GET and POST examples -wasmedge http.wasm +wasmedge --run-mode=aot http.wasm # Run the HTTPS GET and POST examples -wasmedge https.wasm +wasmedge --run-mode=aot https.wasm ``` In your Rust application, import the standard [reqwest](https://crates.io/crates/reqwest) and [tokio](https://crates.io/crates/tokio) crates. You will also patch a few dependency crates to make them aware of the WasmEdge socket API. Just add the following lines to your `Cargo.toml`. @@ -107,7 +107,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_client.wasm wasmedge_hyper_client.wasm # Run the example -wasmedge wasmedge_hyper_client.wasm +wasmedge --run-mode=aot wasmedge_hyper_client.wasm ``` In your Rust application, import the [hyper](https://crates.io/crates/hyper) crate, @@ -134,7 +134,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_client_https.wasm wasmedge_hyper_client_https.wasm // Run -wasmedge wasmedge_hyper_client_https.wasm +wasmedge --run-mode=aot wasmedge_hyper_client_https.wasm ``` In the HTTPS version of `Cargo.toml`, you just need to import the standard [hyper-rustls](https://crates.io/crates/hyper-rustls), [rustls](https://crates.io/crates/rustls) and [webpki-roots](https://crates.io/crates/webpki-roots) crates with the same patches as above. diff --git a/docs/develop/rust/http_service/server.md b/docs/develop/rust/http_service/server.md index 5c804903d..0549474f0 100644 --- a/docs/develop/rust/http_service/server.md +++ b/docs/develop/rust/http_service/server.md @@ -32,7 +32,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_axum_server.wasm wasmedge_axum_server.wasm # Run the example -wasmedge wasmedge_axum_server.wasm +wasmedge --run-mode=aot wasmedge_axum_server.wasm ``` Then from another terminal, you can request the server. The HTTP server echoes the request data and sends back the response. @@ -108,7 +108,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_server.wasm wasmedge_hyper_server.wasm # Run the example -wasmedge wasmedge_hyper_server.wasm +wasmedge --run-mode=aot wasmedge_hyper_server.wasm ``` Then from another terminal, you can request the server. The HTTP server echoes the request data and sends back the response. diff --git a/docs/develop/rust/socket_networking/client.md b/docs/develop/rust/socket_networking/client.md index 94c0b7cf7..6ec4cc591 100644 --- a/docs/develop/rust/socket_networking/client.md +++ b/docs/develop/rust/socket_networking/client.md @@ -30,7 +30,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/http_client.wasm http_client.wasm # Run the example -wasmedge http_client.wasm +wasmedge --run-mode=aot http_client.wasm ``` The [source code](https://github.com/second-state/wasmedge_wasi_socket/tree/main/examples/http_client) for the HTTP client is available as follows. @@ -74,7 +74,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/nonblock_http_client.wasm nonblock_http_client.wasm # Run the example -wasmedge nonblock_http_client.wasm +wasmedge --run-mode=aot nonblock_http_client.wasm ``` diff --git a/docs/develop/rust/socket_networking/server.md b/docs/develop/rust/socket_networking/server.md index 2a4045de5..5c466c30e 100644 --- a/docs/develop/rust/socket_networking/server.md +++ b/docs/develop/rust/socket_networking/server.md @@ -28,7 +28,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/http_server.wasm http_server.wasm # Run the example -$wasmedge http_server.wasm +$wasmedge --run-mode=aot http_server.wasm new connection at 1234 ``` @@ -122,7 +122,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/poll_tcp_listener.wasm poll_tcp_listener.wasm # Run the example -wasmedge poll_tcp_listener.wasm +wasmedge --run-mode=aot poll_tcp_listener.wasm ``` You can submit an HTTP request via `curl` to test the HTTP server. diff --git a/docs/develop/rust/wasinn/llm_inference.md b/docs/develop/rust/wasinn/llm_inference.md index 34f5eb38f..7ff4bb2a7 100644 --- a/docs/develop/rust/wasinn/llm_inference.md +++ b/docs/develop/rust/wasinn/llm_inference.md @@ -149,7 +149,7 @@ You can make the inference program run faster by AOT compiling the wasm file fir ```bash wasmedge compile llama-chat.wasm llama-chat.wasm -wasmedge --dir .:. --nn-preload default:GGML:AUTO:Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf llama-chat.wasm -p llama-3-chat +wasmedge --run-mode=aot --dir .:. --nn-preload default:GGML:AUTO:Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf llama-chat.wasm -p llama-3-chat ``` ## Understand the code diff --git a/docs/develop/rust/wasinn/mediapipe.md b/docs/develop/rust/wasinn/mediapipe.md index 85bdf8aaf..0c62b5026 100644 --- a/docs/develop/rust/wasinn/mediapipe.md +++ b/docs/develop/rust/wasinn/mediapipe.md @@ -31,7 +31,7 @@ Run the inference application against an image. The input `example.jpg` image is ![The input image](https://raw.githubusercontent.com/juntao/demo-object-detection/main/example.jpg) ```bash -wasmedge --dir .:. demo-object-detection.wasm example.jpg output.jpg +wasmedge --run-mode=aot --dir .:. demo-object-detection.wasm example.jpg output.jpg ``` The inference result `output.jpg` image is shown below. diff --git a/docs/develop/rust/wasinn/openvino.md b/docs/develop/rust/wasinn/openvino.md index e2a66daf5..89c229a08 100644 --- a/docs/develop/rust/wasinn/openvino.md +++ b/docs/develop/rust/wasinn/openvino.md @@ -73,7 +73,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-mobilenet.wasm out.wasm -wasmedge --dir .:. out.wasm mobilenet.xml mobilenet.bin input.jpg +wasmedge --run-mode=aot --dir .:. out.wasm mobilenet.xml mobilenet.bin input.jpg ``` ## Understand the code diff --git a/docs/develop/rust/wasinn/pytorch.md b/docs/develop/rust/wasinn/pytorch.md index 5357d956f..2f4770552 100644 --- a/docs/develop/rust/wasinn/pytorch.md +++ b/docs/develop/rust/wasinn/pytorch.md @@ -69,7 +69,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-mobilenet.wasm out.wasm -wasmedge --dir .:. out.wasm mobilenet.pt input.jpg +wasmedge --run-mode=aot --dir .:. out.wasm mobilenet.pt input.jpg ``` ## Understand the code diff --git a/docs/develop/rust/wasinn/tensorflow_lite.md b/docs/develop/rust/wasinn/tensorflow_lite.md index 671ffe24d..e2ebf4bae 100644 --- a/docs/develop/rust/wasinn/tensorflow_lite.md +++ b/docs/develop/rust/wasinn/tensorflow_lite.md @@ -69,7 +69,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-tflite-bird-image.wasm out.wasm -wasmedge --dir .:. out.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg +wasmedge --run-mode=aot --dir .:. out.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg ``` ## Understand the code diff --git a/docs/start/build-and-run/cli.md b/docs/start/build-and-run/cli.md index 45b635038..1a50c37a0 100644 --- a/docs/start/build-and-run/cli.md +++ b/docs/start/build-and-run/cli.md @@ -357,7 +357,7 @@ $ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge [2022-07-07 08:15:50.421] [info] compile done [2022-07-07 08:15:50.422] [info] output start -$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge hello.aot.wasm world +$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge --run-mode=aot hello.aot.wasm world hello world ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/hello_world.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/hello_world.md index 01c07a24f..00d12d669 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/hello_world.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/hello_world.md @@ -73,7 +73,7 @@ With WasmEdge's AoT compiler, you will get higher performance. # Compile the wasm file with wasmedge aot compiler $ wasmedgec hello.wasm hello.wasm # Run the native binary with wasmedge -$ wasmedge hello.wasm +$ wasmedge --run-mode=aot hello.wasm ``` ## Example: Add function @@ -114,7 +114,7 @@ We can further improve performance by using wasmedge AOT compilation , this feat ```bash $ wasmedgec add.wasm add_aot.wasm -$ wasmedge add_aot.wasm 4 9 +$ wasmedge --run-mode=aot add_aot.wasm 4 9 13 ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/simd.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/simd.md index 792d4f974..f44c63be1 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/simd.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/c/simd.md @@ -50,5 +50,5 @@ With WasmEdge's AoT compiler, you will get higher performance. # Compile wasm-simd with wasmedge aot compiler $ wasmedge compile mandelbrot-simd.wasm mandelbrot-simd-out.wasm # Run the native binary with wasmedge -$ wasmedge mandelbrot-simd-out.wasm 15000 +$ wasmedge --run-mode=aot mandelbrot-simd-out.wasm 15000 ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/kubernetes/docker-slim.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/kubernetes/docker-slim.md index 075749cb8..5b551a422 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/kubernetes/docker-slim.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/kubernetes/docker-slim.md @@ -39,7 +39,7 @@ $ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge [2022-07-07 08:15:50.421] [info] compile done [2022-07-07 08:15:50.422] [info] output start -$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge hello.aot.wasm world +$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge --run-mode=aot hello.aot.wasm world hello world ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/go/hello_world.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/go/hello_world.md index 3385a3b7f..03c735d74 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/go/hello_world.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/go/hello_world.md @@ -111,7 +111,7 @@ To achieve native Go performance for those applications, you could use the `wasm ```bash $ wasmedge compile hello.wasm hello.wasm -$ wasmedge hello.wasm +$ wasmedge --run-mode=aot hello.wasm Hello TinyGo from WasmEdge! ``` @@ -120,6 +120,6 @@ For the `--reactor` mode, ```bash $ wasmedge compile fib.wasm fib.wasm -$ wasmedge --reactor fib.wasm fibArray 10 +$ wasmedge --run-mode=aot --reactor fib.wasm fibArray 10 34 ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/hello_world.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/hello_world.md index e92b2056c..7f10119cb 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/hello_world.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/hello_world.md @@ -32,7 +32,7 @@ The reason to use `wasmedge-quickjs` as the current working directory is that `m You can try a simple "hello world" JavaScript program ([example_js/hello.js](https://github.com/second-state/wasmedge-quickjs/blob/main/example_js/hello.js)), which prints out the command line arguments to the console. ```bash -$ wasmedge --dir .:. wasmedge_quickjs.wasm example_js/hello.js WasmEdge Runtime +$ wasmedge --run-mode=aot --dir .:. wasmedge_quickjs.wasm example_js/hello.js WasmEdge Runtime Hello WasmEdge Runtime ``` @@ -85,7 +85,7 @@ WasmEdge provides a `wasmedgec` utility to compile and add a native machine code ```bash wasmedge compile target/wasm32-wasip1/release/wasmedge_quickjs.wasm wasmedge_quickjs.wasm -wasmedge --dir .:. wasmedge_quickjs.wasm example_js/hello.js +wasmedge --run-mode=aot --dir .:. wasmedge_quickjs.wasm example_js/hello.js ``` Next, we will discuss more advanced use cases for JavaScript in WasmEdge. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/tensorflow.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/tensorflow.md index 0ccfed6f1..ce7fdf7a7 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/tensorflow.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/tensorflow.md @@ -78,7 +78,7 @@ print(max / 255); To run the JavaScript in the WasmEdge runtime, make sure that you have the [WASI-NN plug-in and Tensorflow Lite dependency libraries installed with WasmEdge](../../start/install.md#wasi-nn-plug-in-with-tensorflow-lite-backend). You should see the food item's name recognized by the TensorFlow lite ImageNet model. ```bash -$ wasmedge --dir .:. wasmedge_quickjs_nn.wasm example_js/tensorflow_lite_demo/wasi_nn_main.js +$ wasmedge --run-mode=aot --dir .:. wasmedge_quickjs_nn.wasm example_js/tensorflow_lite_demo/wasi_nn_main.js label: Hot dog confidence: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/dapr.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/dapr.md index a1550e003..7146d8109 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/dapr.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/dapr.md @@ -72,7 +72,7 @@ dapr run --app-id image-api-grayscale \ --dapr-http-port 3503 \ --components-path ../config \ --log-level debug \ - wasmedge image-api-grayscale.wasm + wasmedge --run-mode=aot image-api-grayscale.wasm ``` ### The image classification microservice @@ -116,7 +116,7 @@ dapr run --app-id events-service \ --dapr-http-port 3505 \ --log-level debug \ --components-path ../config \ - wasmedge events_service.wasm + wasmedge --run-mode=aot events_service.wasm ``` ## Test diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/hello_world.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/hello_world.md index c96e8eb41..d86dd862d 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/hello_world.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/hello_world.md @@ -74,7 +74,7 @@ If we don't have extra notes for AoT, all the WASM file will be executed in the ```bash $ wasmedge compile hello.wasm hello_aot.wasm -$ wasmedge hello_aot.wasm second state +$ wasmedge --run-mode=aot hello_aot.wasm second state hello second state @@ -85,6 +85,6 @@ For the `--reactor` mode, ```bash $ wasmedge compile add.wasm add_aot.wasm -$ wasmedge --reactor add_aot.wasm add 2 2 +$ wasmedge --run-mode=aot --reactor add_aot.wasm add 2 2 4 ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/client.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/client.md index da406c738..735e19ea9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/client.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/client.md @@ -37,10 +37,10 @@ wasmedge compile target/wasm32-wasip1/release/http.wasm http.wasm wasmedge compile target/wasm32-wasip1/release/https.wasm https.wasm # Run the HTTP GET and POST examples -wasmedge http.wasm +wasmedge --run-mode=aot http.wasm # Run the HTTPS GET and POST examples -wasmedge https.wasm +wasmedge --run-mode=aot https.wasm ``` In your Rust application, import the standard [reqwest](https://crates.io/crates/reqwest) and [tokio](https://crates.io/crates/tokio) crates. You will also patch a few dependency crates to make them aware of the WasmEdge socket API. Just add the following lines to your `Cargo.toml`. @@ -107,7 +107,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_client.wasm wasmedge_hyper_client.wasm # Run the example -wasmedge wasmedge_hyper_client.wasm +wasmedge --run-mode=aot wasmedge_hyper_client.wasm ``` In your Rust application, import the [hyper](https://crates.io/crates/hyper) crate, @@ -134,7 +134,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_client_https.wasm wasmedge_hyper_client_https.wasm // Run -wasmedge wasmedge_hyper_client_https.wasm +wasmedge --run-mode=aot wasmedge_hyper_client_https.wasm ``` In the HTTPS version of `Cargo.toml`, you just need to import the standard [hyper-rustls](https://crates.io/crates/hyper-rustls), [rustls](https://crates.io/crates/rustls) and [webpki-roots](https://crates.io/crates/webpki-roots) crates with the same patches as above. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/server.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/server.md index 5c804903d..0549474f0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/server.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/http_service/server.md @@ -32,7 +32,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_axum_server.wasm wasmedge_axum_server.wasm # Run the example -wasmedge wasmedge_axum_server.wasm +wasmedge --run-mode=aot wasmedge_axum_server.wasm ``` Then from another terminal, you can request the server. The HTTP server echoes the request data and sends back the response. @@ -108,7 +108,7 @@ RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi wasmedge compile target/wasm32-wasip1/release/wasmedge_hyper_server.wasm wasmedge_hyper_server.wasm # Run the example -wasmedge wasmedge_hyper_server.wasm +wasmedge --run-mode=aot wasmedge_hyper_server.wasm ``` Then from another terminal, you can request the server. The HTTP server echoes the request data and sends back the response. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/client.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/client.md index 94c0b7cf7..6ec4cc591 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/client.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/client.md @@ -30,7 +30,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/http_client.wasm http_client.wasm # Run the example -wasmedge http_client.wasm +wasmedge --run-mode=aot http_client.wasm ``` The [source code](https://github.com/second-state/wasmedge_wasi_socket/tree/main/examples/http_client) for the HTTP client is available as follows. @@ -74,7 +74,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/nonblock_http_client.wasm nonblock_http_client.wasm # Run the example -wasmedge nonblock_http_client.wasm +wasmedge --run-mode=aot nonblock_http_client.wasm ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/server.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/server.md index 2a4045de5..5c466c30e 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/server.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/socket_networking/server.md @@ -28,7 +28,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/http_server.wasm http_server.wasm # Run the example -$wasmedge http_server.wasm +$wasmedge --run-mode=aot http_server.wasm new connection at 1234 ``` @@ -122,7 +122,7 @@ cargo build --target wasm32-wasip1 --release wasmedge compile target/wasm32-wasip1/release/poll_tcp_listener.wasm poll_tcp_listener.wasm # Run the example -wasmedge poll_tcp_listener.wasm +wasmedge --run-mode=aot poll_tcp_listener.wasm ``` You can submit an HTTP request via `curl` to test the HTTP server. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/llm_inference.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/llm_inference.md index 34f5eb38f..7ff4bb2a7 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/llm_inference.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/llm_inference.md @@ -149,7 +149,7 @@ You can make the inference program run faster by AOT compiling the wasm file fir ```bash wasmedge compile llama-chat.wasm llama-chat.wasm -wasmedge --dir .:. --nn-preload default:GGML:AUTO:Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf llama-chat.wasm -p llama-3-chat +wasmedge --run-mode=aot --dir .:. --nn-preload default:GGML:AUTO:Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf llama-chat.wasm -p llama-3-chat ``` ## Understand the code diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md index 85bdf8aaf..0c62b5026 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md @@ -31,7 +31,7 @@ Run the inference application against an image. The input `example.jpg` image is ![The input image](https://raw.githubusercontent.com/juntao/demo-object-detection/main/example.jpg) ```bash -wasmedge --dir .:. demo-object-detection.wasm example.jpg output.jpg +wasmedge --run-mode=aot --dir .:. demo-object-detection.wasm example.jpg output.jpg ``` The inference result `output.jpg` image is shown below. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/openvino.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/openvino.md index e2a66daf5..89c229a08 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/openvino.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/openvino.md @@ -73,7 +73,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-mobilenet.wasm out.wasm -wasmedge --dir .:. out.wasm mobilenet.xml mobilenet.bin input.jpg +wasmedge --run-mode=aot --dir .:. out.wasm mobilenet.xml mobilenet.bin input.jpg ``` ## Understand the code diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/pytorch.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/pytorch.md index 5357d956f..2f4770552 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/pytorch.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/pytorch.md @@ -69,7 +69,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-mobilenet.wasm out.wasm -wasmedge --dir .:. out.wasm mobilenet.pt input.jpg +wasmedge --run-mode=aot --dir .:. out.wasm mobilenet.pt input.jpg ``` ## Understand the code diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/tensorflow_lite.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/tensorflow_lite.md index 671ffe24d..e2ebf4bae 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/tensorflow_lite.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/tensorflow_lite.md @@ -69,7 +69,7 @@ You can make the inference program run faster by AOT compiling the `wasm` file f ```bash wasmedge compile wasmedge-wasinn-example-tflite-bird-image.wasm out.wasm -wasmedge --dir .:. out.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg +wasmedge --run-mode=aot --dir .:. out.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg ``` ## Understand the code diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/aot.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/aot.md index c59904b3f..0c2aef895 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/aot.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/aot.md @@ -83,7 +83,7 @@ wasmedge compile fibonacci.wasm fibonacci_aot.so # 在 Linux 上 然后,你可以使用 `wasmedge` 执行输出文件并测量执行时间: ```bash -time wasmedge --reactor fibonacci_aot.wasm fib 30 +time wasmedge --run-mode=aot --reactor fibonacci_aot.wasm fib 30 ``` 输出将会是: @@ -125,7 +125,7 @@ sys 0m0.012s ```bash wasmedge compile app.wasm app_aot.wasm -wasmedge app_aot.wasm +wasmedge --run-mode=aot app_aot.wasm ``` ## 输出格式:共享库 @@ -136,5 +136,5 @@ wasmedge app_aot.wasm ```bash wasmedge compile app.wasm app_aot.so -wasmedge app_aot.so +wasmedge --run-mode=aot app_aot.so ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md index b72bccc33..fe4a06244 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md @@ -301,7 +301,7 @@ $ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge [2022-07-07 08:15:50.421] [info] compile done [2022-07-07 08:15:50.422] [info] output start -$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge hello.aot.wasm world +$ docker run -it --rm -v $PWD:/app wasmedge/slim:{{ wasmedge_version }} wasmedge --run-mode=aot hello.aot.wasm world hello world ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start.md index 8779ca999..7b7032050 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start.md @@ -52,7 +52,7 @@ Hello WasmEdge! ```bash $ wasmedgec hello.wasm hello_aot.wasm -$ wasmedge hello_aot.wasm +$ wasmedge --run-mode=aot hello_aot.wasm Hello WasmEdge! ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md index 8f35ec6a2..7cf392487 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md @@ -102,7 +102,7 @@ dnf install wasmedge - `wasmedgec` 工具是提前(AOT)编译器,用于将 `.wasm` 文件编译成本机的 `.so` 文件(在 MacOS 上则编译成 `.dylib`,在 Windows 上则编译成 `.dll`,或编译成在各平台上通用的 `.wasm` 格式)。`wasmedge` 可以执行编译后的文件。 - 使用 AOT 编译 WASM 文件:`wasmedgec app.wasm app.so` - - 以 AOT 模式运行 WASM:`wasmedge --dir .:. app.so` + - 以 AOT 模式运行 WASM:`wasmedge --run-mode=aot --dir .:. app.so` :::note