預祝龍年吉祥! 2023 年是 ChatGPT 和 LLM(大型語言模型)之年。 2024 年將是開源 LLM 之年! 僅 Huggingface 上就有超過 10,000 個開源 LLM 發佈,其中最好的模型已經接近 GPT4 性能,且資源需求少得多,用戶的隱私/控制也好得多。
你是否嘗試過在本地運行開源 LLM,例如 Llama2、Mistral、Yi、Mixtral MoE? 借助由 Rust 和 WasmEdge[1] 提供支持的 LlamaEdge[2],你現在可以在幾分鐘內在自己的計算機上啟動並運行 LLM 應用程序。 此外,該應用程序可跨 CPU 和 GPU 平臺移植! 可以在 M3 MacBook 上進行開發和測試,並在 NVIDIA 邊緣服務器上進行部署。
對 AI 的雲和邊緣基礎設施感興趣的小夥伴,我們邀請你申請 WasmEdge 參加的2024 春季 Linux 基金會 LFX Mentorship 的四個項目。
我們有四個 Mentorship 項目,專註於通過支持新的 AI 運行時引擎來擴展 WasmEdge 的跨平臺運行 LLM 的能力:
- burn.rs - 基於 Rust 的 AI 推理框架
- Whisper.cpp - C 中的多語言語音識別
- Intel Extension for Transformers - 針對 Intel 芯片優化的基於 CPU 的推理運行時
- MLX - 蘋果最新的人工智能框架
WasmEdge 已經支持 llama.cpp 作為推理運行時。 現在我們想要添加更多後端,從而讓 WasmEdge 應用程序可以在更多硬件和軟件堆棧上運行。
我們的目標是讓 WebAssembly 代碼在專用硬件及其推理框架上運行,而無需更改代碼甚至重新編譯。 例如,當 Wasm 文件在 Intel 芯片上運行時,它會自動檢測並使用 Intel Extension for Transformer。 當它運行在 Apple 芯片時,它會自動檢測並使用 MLX。
立即申請加入 WasmEdge 的 LFX Mentorship,在開源領域嶄露頭角,同時獲得 3000 美元到 6600 美元的津貼!
集成 burn.rs 作為新的 WASI-NN 後端
burn.rs 是一個用 Rust 編寫的新興深度學習框架,專註於跨設備的極高靈活性、效率和可移植性。 它已經為 Llama2、Whisper 和 Stable Diffusion 等模型提供支持。
在此項目中,你需要添加 burn.rs作為 WasmEdge WASI-NN 插件的新後端。 由於 burn 是用 Rust 編寫的,因此 mentee 需要具備 Rust 和 Wasm 的應用知識。
查看詳情[3] | Pretest[4] | 申請鏈接[5]
集成 whisper.cpp 作為新的 WASI-NN 後端
與 Llama.cpp 一樣,whisper.cpp 是 OpenAI 的 Whisper 模型在 C/C 中的端口。 Whisper 是一個在多語言語音識別、語音翻譯和語言識別方面表現出色的模型。 添加它可以使 WasmEdge 運行語音工作負載。
在此項目中,你將添加 whisper.cpp 作為 WasmEdge WASI-NN 插件的新後端。 此任務的一個很好的參考是 llama.cpp[6] 的實現。 mentee 需要熟悉 C 和 Wasm。
查看詳情[7] | Pretest[8] | 申請鏈接[9]
集成 Intel Extension for Transformers 作為新的 WASI-NN 後端
Intel® Extension for Transformers 是一個基於 Transformer 的工具包,可加速 Intel 芯片(包括 CPU 和 GPU)上的 LLM 推理。 如今 GPU 資源緊缺,Intel 芯片上的推理框架對於在沒有 GPU 的情況下獲得高性能至關重要。
在此項目中,你將添加 Intel® Extension for Transformers 作為 WasmEdge WASI-NN 插件的新後端。 mentee 需要具備 C 和 Wasm 的應用知識。
查看詳情[10] | Pretest[11] | 申請鏈接[12]
將 MLX 集成為新的 WASI-NN 後端
MLX 是 Apple 芯片上用於機器學習的陣列框架。 與 Intel® Extension for Transformers 類似,MLX 可以加速 Apple 芯片上的推理性能。
在此項目中,你將添加 MLX 作為 WasmEdge WASI-NN 插件的新後端。 mentee 需要具備 C 和 Wasm 的應用知識。
查看詳情[13] | Pretest[14] | 申請鏈接[15]
如何申請?
- 在 LFX mentorship[16]平臺上申請你最喜歡的項目,申請從2024年1月29日開始,到2月13日結束。
- 在 2 月 20 日 5:00 PDT (21:00 HKT) 之前完成 pretest[17]
- 等待結果。
關於 WasmEdge
WasmEdge 是專為服務器、雲和邊緣環境設計優化的 WebAssembly 運行時。 它支持雲原生開發的關鍵功能,例如高吞吐量、低延遲和原生架構集成。
WasmEdge 最近通過 llama.cpp 運行時作為 WASI-NN 插件的後端添加了對大型語言模型 (LLM) 推理的支持。 這讓我們能在 CPU 和 GPU 上使用一樣的 Wasm 模塊進行推理。
查看基於 WasmEdge 構建的 LlamaEdge 項目,以便在本地輕松運行開源 LLM 或使用 OpenAI 的 API 接口將它們集成到你的應用程序中。
通過利用 Wasm 的高效字節碼格式和編譯器工具鏈集成,WasmEdge 為 AI/LLM 推理等工作負載提供了強大的優勢,同時通過可移植性簡化了部署復雜性。
探索 WasmEdge 的源代碼[18],了解更多信息。歡迎大傢的開源貢獻!
有疑問?歡迎參加WasmEdge[19]2 月 6 日的[20]社區會議,直接與 mentor 交流吧。
參考資料
[1]
WasmEdge: https://github.com/WasmEdge/WasmEdge
[2]
LlamaEdge: https://github.com/second-state/LlamaEdge
[3]
查看詳情: https://github.com/WasmEdge/WasmEdge/issues/3172
[4]
Pretest: https://github.com/WasmEdge/WasmEdge/discussions/3182
[5]
申請鏈接: https://mentorship.lfx.linuxfoundation.org/project/16b35930-5b29-43af-b02c-cdf851069c85
[6]
llama.cpp: https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_nn
[7]
查看詳情: https://github.com/WasmEdge/WasmEdge/issues/3170
[8]
Pretest: https://github.com/WasmEdge/WasmEdge/discussions/3182
[9]
申請鏈接: https://mentorship.lfx.linuxfoundation.org/project/a5c2cc3e-a8fe-4fcb-b74f-be74b65a6385
[10]
查看詳情: https://github.com/WasmEdge/WasmEdge/issues/3169
[11]
Pretest: https://github.com/WasmEdge/WasmEdge/discussions/3182
[12]
申請鏈接: https://mentorship.lfx.linuxfoundation.org/project/8b592388-6a17-4a8f-82e4-121131c217d0
[13]
查看詳情: https://github.com/ml-explore/mlx
[14]
Pretest: https://github.com/WasmEdge/WasmEdge/discussions/3182
[15]
申請鏈接: https://mentorship.lfx.linuxfoundation.org/project/395d3659-e7c2-413f-8f95-42d079c9d0bc
[16]
LFX mentorship: https://mentorship.lfx.linuxfoundation.org/
[17]
pretest: https://github.com/WasmEdge/WasmEdge/discussions/3182
[18]
WasmEdge 的源代碼: https://github.com/WasmEdge/WasmEdge/discussions/3182
[19]
WasmEdge: https://community.cncf.io/events/details/cncf-wasmedgeruntime-community-presents-wasmedge-community-meeting-2024-02-06/
[20]
2 月 6 日的: https://community.cncf.io/events/details/cncf-wasmedgeruntime-community-presents-wasmedge-community-meeting-2024-02-06/