-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem when trying to use Runwasi + WasmEdge over Kind and Docker Image #647
Comments
Running the image using docker might give you better insight on what went wrong. You might also want to check the containerd logs. However, in this case that's expected. The versions of the shim that we release do not support plugins with the wasmedge runtime.
It is possible, but not something we currently support as it comes with some downsides, like making distribution more complex. Another option would be linking the wasi-nn plugin statically, but that would require some non-trivial changes on the wasmedge codebase. @hydai could wasmedge provide a way of statically linking plugins with the runtime? e.g., a way of registering a plugin that is statically linked to the binary. It's not the first time this comes up, so it makes me think this might actually be useful. Another consideration is that the wasi-nn workflows would be running using CPU rather than GPU, although we are working on that (see this AI_dev presentation) |
Hi @jprendes We are looking for a solution to register a statically linked plugin. However, it is a challenging task at the current stage.
As it stands, the current runwasi is unable to utilize WasmEdge plugins. To address this, you will likely need to construct the shim using the steps provided by Jorge. Unfortunately, WasmEdge doesn't provide a document to leverage runwasi+WasmEdge for the LLM workload at this moment. Let me loop @CaptainVincent in. He may know how to use runwasi+WasmEdge to run the llama workload. I believe the steps will be similar to what we do for the crun+WasmEdge integration and it should work with k8s smoothly. |
IIUC Wasmedge has two plugin registration api, one for C++ and one for C. Adapting the C API to register statically linked "plugins" looks straight forward. The Rust plugins use the C API, so it shouldn't be that hard, I'm happy to give it a go. This functionality doesn't mean that wasmedge has to ship static (and versioned) wasi-nn plugins every day. But it would allow runwasi to include builtin plugins. We can build the statically linked plugin before each release of runwasi (at least on the docker side). As to how it would work long term, I would like to see a webgpu WIT, and a wasmedge plugin that implement it, then llama.cpp / burn.rs can be compiled to wasm using the webgpu bindings. What version of those libraries to use would be deferred to the container developer instead of being hardcoded in the shim. |
We can focus on the C API because the C and Rust plugins are using this.
I see. It provides an alternative way for users to choose whether to use a dynamically linked or statically linked one. This makes sense. |
Hi again, Thanks all of you for the fast answer. Hi @jprendes:
Its imposible to run the image in docker because the entrypoint and the image i use:
Anyways, i try to use Ubuntu and Debian images and try to get a Shell, but the problem isn´t the module .wasm because if you install natively WasmEdge with this comand:
All works perfect in the Docker image, because WasmEdge its instaled with the WasiNN plugin.
All the logs of the Kubernetes pod are empty. When i use "kubectl logs llama-simple-app" nothing appears on the screen. About containerd logs, inside wasm-control-plane of Kind and using
For now i will try to do this:
And see the links @hydai provided me. If i make any advance i will tell it here. I also send an email to @CaptainVincent asking him for help when i use the forked version of runwasi that he provides. Thanks for all the info, |
I would like to have WasmEdge shim capable of running plugins and wasi-nn workloads. Even if we only provide documentation like @jprendes described, I'd be happy:
Likely this could unblock a lot of the use cases for WasmEdge side. @CaptainVincent , do you want to take a look at this one? |
I will double-check this, but in my memory, the current WasmEdge should be fine with plugins when using the dynamic linking WasmEdge approach. The upgrade to WasmEdge 0.14.1 (which requires the release of wasmedge-sdk 0.14.2) was aimed at addressing issues with using plugins via dlopen when statically linking the WasmEdge lib. However, since we’re still quite behind version 0.14, I’d prefer to validate the functionality directly on the newer versions. I will provide further testing results later. |
Do you have any updates on this one, @CaptainVincent ? |
Hi @Mossaka Due to the |
Hi,
I've had a problem for several days trying to change the Kubernetes runtime to runwasi: WasmEdge.
I am trying to orchestrate the module llama-simple.wasm (https://github.com/second-state/llamaedge/releases/latest/download/llama-simple.wasm) for which I know that it is necessary to previously use the --nn-preload flag to indicate the LLM to execute.
The problem is that when I modify the runtime of containerd to run with wasmedge I always get the same error: kubelet Back-off restarting failed container...
I have tried to use the runtime of this other runwasi repository (https://github.com/second-state/runwasi), without success, giving me a different error in this case:
I don't know if anyone has tried to run a .wasm module that requires wasi-nn to work that can guide me to see what I'm doing wrong.
I test a simple HTTP server on RUST and it works perfect, so the problem is only with the modules that requires wasi-nn and the flag of --nn-preload to work:
If anyone can help me I appreciate it!.
Regrats,
David.
The text was updated successfully, but these errors were encountered: