Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: PeterD1524 <[email protected]>
  • Loading branch information
PeterD1524 committed Jul 11, 2024
2 parents 38fa810 + 872e691 commit 3e8a299
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 75 deletions.
166 changes: 131 additions & 35 deletions docs/contribute/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,166 @@
sidebar_position: 8
---

# Contributing Steps
# Contributing Guide

## Setup Development Environment

The WasmEdge is developed on Ubuntu 20.04 to take advantage of advanced LLVM features for the AOT compiler. The WasmEdge team also builds and releases statically linked WasmEdge binaries for older Linux distributions.
* [New Contributor Guide](#contributing-guide)
* [Ways to Contribute](#ways-to-contribute)
* [Find an Issue](#find-an-issue)
* [Ask for Help](#ask-for-help)
* [Pull Request Lifecycle](#pull-request-lifecycle)
* [Development Environment Setup](#development-environment-setup)
* [Sign Your Commits](#sign-your-commits)
* [Pull Request Checklist](#pull-request-checklist)

Our development environment requires `libLLVM-12` and `>=GLIBCXX_3.4.26`.
Welcome! We are glad that you want to contribute to our project! 💖

If you use an operating system older than Ubuntu 20.04, please use our [special docker image] to build WasmEdge. If you are looking for the pre-built binaries for the older operating system, we also provide several pre-built binaries based on the `manylinux2014` distribution.
As you get started, you are in the best position to give us feedback on areas of
the project that we need help with includes:

To build WasmEdge from the source, please refer to: [Build WasmEdge from source](/category/build-wasmedge-from-source).
* Problems found during setting up a new developer environment
* Gaps in our Quickstart Guide or documentation
* Bugs in our automation scripts

If anything doesn't make sense, or doesn't work when you run it, please open a
bug report and let us know!

## Ways to Contribute

We welcome many different types of contributions including:

* New features
* Report a bug
* Builds, CI/CD
* Bug fixes
* Documentation
* Issue Triage
* Answering questions on Slack/Mailing List/GitHub issues
* Web design
* Communications / Social Media / Blog Posts
* Release management

Not everything happens through a GitHub pull request. Please come to our
[meetings](https://docs.google.com/document/d/1iFlVl7R97Lze4RDykzElJGDjjWYDlkI8Rhf8g4dQ5Rk/edit?usp=sharing) or [contact us](https://groups.google.com/g/wasmedge) and let's discuss how we can work
together.

### Come to Meetings


Absolutely everyone is welcome to come to any of our meetings. You never need an
invite to join us. In fact, we want you to join us, even if you don’t have
anything you feel like you want to contribute. Just being there is enough!

You can find out more about our meetings [here](https://docs.google.com/document/d/1iFlVl7R97Lze4RDykzElJGDjjWYDlkI8Rhf8g4dQ5Rk/edit?usp=sharing). You don’t have to turn on
your video. The first time you come, introducing yourself is more than enough.
Over time, we hope that you feel comfortable voicing your opinions, giving
feedback on others’ ideas, and even sharing your own ideas, and experiences.

## Contribution Workflow
## Find an Issue

We have good first issues for new contributors and help wanted issues suitable
for any contributor. [good first issue](https://github.com/WasmEdge/WasmEdge/labels/good%20first%20issue) has extra information to
help you make your first contribution. [help wanted](https://github.com/WasmEdge/WasmEdge/labels/help%20wanted) are issues
suitable for someone who isn't a core maintainer and is good to move onto after
your first pull request.

Sometimes there won’t be any issues with these labels. That’s ok! There is
likely still something for you to work on. If you want to contribute but
don’t know where to start or can't find a suitable issue, you can leave a comment under this issue like "I'd like to work on this. Can you tell XYZ (list the stuff you want to communicate)" or send your questions to our discord server or slack channel.

Once you see an issue that you'd like to work on, please post a comment saying
that you want to work on it. Something like "I want to work on this" is fine.

## Ask for Help

The best way to reach us with a question when contributing is to ask on:

* The original github issue
* Mailing list: Send an email to [our email list](https://groups.google.com/g/wasmedge)
* Discord: Join the [WasmEdge Discord server](https://discord.gg/h4KDyB8XTt)
* Slack: Join the #WasmEdge channel on the [CNCF Slack](https://slack.cncf.io/)

Before opening any issue, please look up the existing [issues](https://github.com/WasmEdge/WasmEdge/issues) to avoid submitting a duplication. If you find a match, you can "subscribe" to it to get notified of updates. If you have additional helpful information about the issue, please leave a comment.

When reporting issues, always include:

- Version of your system
- Configuration files of WasmEdge

Because the issues are open to the public, when submitting the log and configuration files, be sure to remove any sensitive information, e.g. user name, password, IP address, and company name. You can replace those parts with "REDACTED" or other strings like "\*\*\*\*". Be sure to include the steps to reproduce the problem if applicable. It can help us understand and fix your issue faster.


## Pull Request Lifecycle

Pull requests are always welcome, even if they only contain minor fixes like typos or a few lines of code. If there will be a significant effort, please document it as an issue and get a discussion going before starting to work on it.

Please submit a pull request broken down into small changes bit by bit. A pull request consisting of many features and code changes may take a lot of work to review. It is recommended to submit pull requests incrementally.

<!-- prettier-ignore -->
:::note
If you split your pull request into small changes, please ensure any changes that go to the main branch will not break anything. Otherwise, it can only be merged once this feature is complete.
:::
Generally, once your pull request has been opened, it will be assigned to one or more reviewers. Those reviewers will do a thorough code review, looking for correctness, bugs, opportunities for improvement, documentation and comments, and coding style. If your PR is not ready to review, please mark your PR as a draft.

### Fork and Clone the Repository
The reviewers will give you some feedback in three work days.

Fork [the WasmEdge repository](https://github.com/WasmEdge/WasmEdge) and clone the code to your local workspace
After the first review is done, the PR contributor is expected to review and make some changes based on the review in 5 workdays.

### Branches and Commits
If you have finished the adjustments, mark the problem as solved, then the reviewers will review your PR again in 2 workdays.

Changes should be made on your own fork in a new branch. Pull requests should be rebased on the top of the main branch.
If the PR contributor doesn't respond to the PR in 30 days, the maintainer will close the PR. The original PR contributor is welcome to open it again.

The WasmEdge project adopts [DCO](https://www.secondstate.io/articles/dco/) to manage all contributions. Please ensure you add your `sign-off-statement` through the `-s` or `--signoff` flag or the GitHub Web UI before committing the pull request message.
If the PR contributor doesn't want to maintain the PR due to some reason, please enable maintainers to edit this PR if you still want this PR to be merged.

### Develop, Build, and Test
When your PR is merged, your contribution will be implemented in the next release. And we will add the contributors' GitHub name in the release note.

Write code on the new branch in your fork, and [build from source code](/category/build-wasmedge-from-source) with the option `-DWASMEDGE_BUILD_TESTS=ON`.
## Development Environment Setup

Then you can use these tests to verify the correctness of WasmEdge binaries.
The WasmEdge is developed on Ubuntu 20.04 to take advantage of advanced LLVM features for the AOT compiler. The WasmEdge team also builds and releases statically linked WasmEdge binaries for older Linux distributions.

```bash
cd <path/to/wasmedge/build_folder>
LD_LIBRARY_PATH=$(pwd)/lib/api ctest
```
Our development environment requires `libLLVM-12` and `>=GLIBCXX_3.4.26`.

### Push and Create A Pull Request
If you use an operating system older than Ubuntu 20.04, please use our [special docker image] to build WasmEdge. If you are looking for the pre-built binaries for the older operating system, we also provide several pre-built binaries based on the `manylinux2014` distribution.

When ready for review, push your branch to your fork repository on github.
To build WasmEdge from the source, please refer to: [Build WasmEdge from source](/category/build-wasmedge-from-source).

Then visit your fork at <https://github.com/$user/WasmEdge> and click the `Compare & Pull Request` button next to your branch to create a new pull request. The pull request description should refer to all the issues it addresses. Remember to reference issues (such as Closes #XXX and Fixes #XXX) in the comment so that the issues can be closed when the PR is merged. After creating a pull request, please check that the CI passes with your code changes.
## Sign Your Commits

Once your pull request has been opened, it will be assigned to one or more reviewers. Those reviewers will do a thorough code review, looking for correctness, bugs, opportunities for improvement, documentation and comments, and coding style.
### DCO
Licensing is important to open source projects. It provides some assurances that
the software will continue to be available based under the terms that the
author(s) desired. We require that contributors sign off on commits submitted to
our project's repositories. The [Developer Certificate of Origin
(DCO)](https://probot.github.io/apps/dco/) is a way to certify that you wrote and
have the right to contribute the code you are submitting to the project.

Commit changes made in response to review comments to the same branch on your fork.
You sign-off by adding the following to your commit messages. Your sign-off must
match the git user and email associated with the commit.

## Reporting issues
This is my commit message

It is a great way to contribute to WasmEdge by reporting an issue. Well-written and complete bug reports are always welcome! Please open an issue on GitHub.
Signed-off-by: Your Name <[email protected]>

Before opening any issue, please look up the existing [issues](https://github.com/WasmEdge/WasmEdge/issues) to avoid submitting a duplication. If you find a match, you can "subscribe" to it to get notified of updates. If you have additional helpful information about the issue, please leave a comment.
Git has a `-s` command line option to do this automatically:

When reporting issues, always include:
git commit -s -m 'This is my commit message'

- Version of your system
- Configuration files of WasmEdge
If you forgot to do this and have not yet pushed your changes to the remote
repository, you can amend your commit with the sign-off by running

git commit --amend -s


## Pull Request Checklist

When you submit your pull request, or you push new commits to it, our automated
systems will run some checks on your new code. We require that your pull request
passes these checks, but we also have more criteria than just that before we can
accept and merge it. We recommend that you check the following things locally
before you submit your code:

* DCO: Did you sign off your commit
* Code of conduct: Did you follow the CNCF code of conduct


## Reporting issues

Because the issues are open to the public, when submitting the log and configuration files, be sure to remove any sensitive information, e.g. user name, password, IP address, and company name. You can replace those parts with "REDACTED" or other strings like "\*\*\*\*". Be sure to include the steps to reproduce the problem if applicable. It can help us understand and fix your issue faster.

## Documenting

Expand All @@ -78,3 +172,5 @@ Update the documentation if you are creating or changing features. Good document
You can propose new designs for existing WasmEdge features. You can also design new features; please submit a proposal via the GitHub issues.

WasmEdge maintainers will review this proposal as soon as possible to ensure the overall architecture is consistent and to avoid duplicated work in the roadmap.

New features of WasmEdge will be discussed via a GitHub issue or the community meeting.
59 changes: 21 additions & 38 deletions docs/contribute/source/plugin/wasi_nn.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,22 +277,29 @@ cmake --build build
cmake --install build
```

#### Apple Silicon Model
### Appendix

You can build and install WasmEdge from source directly on the macOS arm64 platform. It will use the built-in GPU by default.
<!-- prettier-ignore -->
:::note
If the built `wasmedge` CLI tool cannot find the WASI-NN plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/` or the built plugin path `build/plugins/wasi_nn/`) to try to fix this issue.
:::

```bash
cd <path/to/your/wasmedge/source/folder>
# Enable METAL on arm64 macOS.
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release \
-DWASMEDGE_PLUGIN_WASI_NN_BACKEND="GGML" \
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_METAL=ON \
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF \
.
cmake --build build
# For the WASI-NN plugin, you should install this project.
cmake --install build
```
<!-- prettier-ignore -->
:::note
We also provided the pre-built ggml plugins on the following platforms:

- darwin\_x86\_64: Intel Model macOS
- darwin\_arm64: Apple Silicon Model macOS
- ubuntu20.04\_x86\_64: x86\_64 Linux (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_aarch64: aarch64 Linux (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_blas\_x86\_64: x86\_64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_blas\_aarch64: aarch64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_cuda\_x86\_64: x86\_64 Linux with CUDA 12 support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_cuda\_aarch64: aarch64 Linux with CUDA 11 support (the glibc is using Ubuntu20.04 one), for NVIDIA Jetson AGX Orin
- manylinux2014\_x86\_64: x86\_64 Linux (the glibc is using CentOS 7 one)
- manylinux2014\_aarch64: aarch64 Linux (the glibc is using CentOS 7 one)

:::

## Build WasmEdge with WASI-NN Neural Speed Backend

Expand Down Expand Up @@ -321,30 +328,6 @@ cmake --install build

Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-NN with Neural Speed backend plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiNN.so` after installation.

### Appendix

<!-- prettier-ignore -->
:::note
If the built `wasmedge` CLI tool cannot find the WASI-NN plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/` or the built plugin path `build/plugins/wasi_nn/`) to try to fix this issue.
:::

<!-- prettier-ignore -->
:::note
We also provided the pre-built ggml plugins on the following platforms:

- darwin\_x86\_64: Intel Model macOS
- darwin\_arm64: Apple Silicon Model macOS
- ubuntu20.04\_x86\_64: x86\_64 Linux (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_aarch64: aarch64 Linux (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_blas\_x86\_64: x86\_64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_blas\_aarch64: aarch64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_cuda\_x86\_64: x86\_64 Linux with CUDA 12 support (the glibc is using Ubuntu20.04 one)
- ubuntu20.04\_cuda\_aarch64: aarch64 Linux with CUDA 11 support (the glibc is using Ubuntu20.04 one), for NVIDIA Jetson AGX Orin
- manylinux2014\_x86\_64: x86\_64 Linux (the glibc is using CentOS 7 one)
- manylinux2014\_aarch64: aarch64 Linux (the glibc is using CentOS 7 one)

:::

## Build WasmEdge with WASI-NN Piper Backend

Build and install WasmEdge from source:
Expand Down
9 changes: 9 additions & 0 deletions docs/develop/deploy/gpu/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Manage LLM workloads on GPU",
"position": 7,
"link": {
"type": "generated-index",
"description": "In this chapter, we will demonstrate how to use container tools to mange LLM WasmEdge workloads on GPU."
}
}

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/develop/python/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Develop WASM Apps in Python",
"position": 9,
"position": 6,
"link": {
"type": "generated-index",
"description": "In this chapter, we will learn how to create WASM apps in Python."
Expand Down
6 changes: 6 additions & 0 deletions docs/start/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ Yes, WasmEdge can use Tensorflow as its [inference](https://wasmedge.org/docs/em

WasmEdge provides the WASI (WebAssembly System Interface) API for interacting with the host system, including file operations. You can use the [WASI API](https://wasmedge.org/docs/embed/go/reference/0.11.x?_highlight=wasi&_highlight=api#preregistrations) to open and read files from the host system.

## 8. What's the relationship between WasmEdge and Second State

The relationship between WasmEdge and Second State is rooted in the latter contributing their WasmEdge Runtime project to the Cloud Native Computing Foundation (CNCF). Subsequently, Second State became one of the maintainers for WasmEdge. As WasmEdge seeks to broaden its community, it continues to search for additional maintainers.

Please remember, this FAQ page is not exhaustive, and the WasmEdge community is always ready to help with any questions or issues you may have. Don't hesitate to reach out if you need assistance in our [Discord server](https://discord.gg/h4KDyB8XTt).


2 changes: 1 addition & 1 deletion docs/start/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ WasmEdge plug-ins are pre-built native modules that provide additional functiona
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasi_nn-ggml
```

To install multiple plug-ins, you can pass a list of plug-ins with the `--plugins` option. For example, the following command installs the `wasi_logging`` and the `wasi_nn-ggml` plug-ins. The `wasi_logging` plug-in allows the Rust [log::Log](https://crates.io/crates/log) API to compile into Wasm and run in WasmEdge.
To install multiple plug-ins, you can pass a list of plug-ins with the `--plugins` option. For example, the following command installs the `wasi_logging` and the `wasi_nn-ggml` plug-ins. The `wasi_logging` plug-in allows the Rust [log::Log](https://crates.io/crates/log) API to compile into Wasm and run in WasmEdge.

```bash
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasi_logging wasi_nn-ggml
Expand Down

0 comments on commit 3e8a299

Please sign in to comment.