-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit for WasmScore" * add github actions to compile and test x64 benchmarks (#1) * Add github actions to compile and test x64 benchmarks * Refactor driver to match refactored sightglass * Continue refactor and cleanup. Better use of df * Prints out efficiency and wasm scores * Remove unneeded comments * Add printing of results to a file and the screen * Improve quiet printing * Add simdscore placeholder and validate runall * Update tag for docker images * Update workflow to include running of all available benchmarks * Update wasmtime commit * Add code of conduct Code of conduct is a copy from wasmtime repo. * Add contributor documentation * Add license agreement * Update security policy * Add dependabot support for pip * Update simplify config.inc * Use a local benchmarks directory instead of the Sightglass version * Fix for failures caused by missing results directory on some runs * Remove unnecessary installs in Dockerfile * Separate security section to it's own file * Update printed comments * Update container entry point and build message * Update README and add example screenshots in asset folder
- Loading branch information
Showing
310 changed files
with
270,300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This is a workflow triggered by PR or triggered manually | ||
# Runs quick performance tests and reports the comparison against HEAD | ||
# Test should take less than 10 minutes to run on current self-hosted devices | ||
name: "Compile and Run on x64" | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
|
||
# Env variables | ||
env: | ||
SG_COMMIT: 2ab01ac | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
|
||
jobs: | ||
Compile_and_Run_All: | ||
name: Compile and run wasm-score benchmarks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: echo "$GITHUB_CONTEXT" | ||
- run: | | ||
# Create and Push Branch | ||
./build.sh | ||
docker run -i wasmscore /bin/bash wasmscore.sh | ||
docker run -i wasmscore /bin/bash wasmscore.sh -t quickrun_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
*Note*: this Code of Conduct pertains to individuals' behavior. Please also see the [Organizational Code of Conduct][OCoC]. | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Bytecode Alliance CoC team at [[email protected]](mailto:[email protected]). The CoC team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The CoC team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the Bytecode Alliance's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[OCoC]: https://github.com/bytecodealliance/wasmtime/blob/main/ORG_CODE_OF_CONDUCT.md | ||
[homepage]: https://www.contributor-covenant.org | ||
[version]: https://www.contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Contributing to WasmScore | ||
|
||
Wasmscore is a [Bytecode Alliance] project. It follows the Bytecode | ||
Alliance's [Code of Conduct] and [Organizational Code of Conduct]. | ||
|
||
For more information about contributing to this project you can consult the | ||
[online documentation] which should cover all sorts of topics. | ||
|
||
[Bytecode Alliance]: https://bytecodealliance.org/ | ||
[Code of Conduct]: CODE_OF_CONDUCT.md | ||
[Organizational Code of Conduct]: ORG_CODE_OF_CONDUCT.md | ||
[online documentation]: https://bytecodealliance.github.io/wasmtime/contributing.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
FROM ubuntu:20.04 | ||
ARG ARCH | ||
ENV LD_LIBRARY_PATH=/usr/local/lib | ||
ENV PATH=/usr/local/bin:$PATH | ||
CMD ["/bin/bash"] | ||
ENV DEBIAN_FRONTEND="noninteractive" TZ="America" | ||
ARG RUST_VERSION="nightly-2023-04-01" | ||
ARG WASMTIME_REPO="https://github.com/bytecodealliance/wasmtime/" | ||
ARG WASMTIME_COMMIT="1bfe4b5" # v9.0.1 | ||
ARG SIGHTGLASS_REPO="https://github.com/bytecodealliance/sightglass.git" | ||
ARG SIGHTGLASS_BRANCH="main" | ||
ARG SIGHTGLASS_COMMIT="e89fce0" | ||
|
||
# Get some prerequisites | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apt-utils build-essential gpg-agent \ | ||
curl ca-certificates wget software-properties-common \ | ||
psmisc lsof git nano zlib1g-dev libedit-dev time yasm \ | ||
libssl-dev pkg-config | ||
|
||
# Bionic does not carry a recent enough cmake needed for wamr but upgrading | ||
# to Focal causes other build issues so the straight forward solution is to just | ||
# install a version of cmake that is recent enough from a separate repository | ||
RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - | ||
RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' | ||
RUN apt-get update && apt-get install --yes cmake | ||
|
||
# Install wabt | ||
WORKDIR /opt | ||
RUN git clone --recurse-submodules https://github.com/WebAssembly/wabt.git \ | ||
&& cd wabt \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake .. \ | ||
&& cmake --build . \ | ||
&& make | ||
ENV PATH=$PATH:/opt/wabt/bin/ | ||
|
||
# Install rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${RUST_VERSION} -y | ||
ENV PATH=/root/.cargo/bin:${PATH} | ||
|
||
# Install clang | ||
RUN apt-get install -y --no-install-recommends clang | ||
|
||
# Install python | ||
RUN apt-get install -y --no-install-recommends python3.8 libpython3.8 python3-distutils python3-pip | ||
RUN python3 -m pip install termgraph \ | ||
&& python3 -m pip install pandas \ | ||
&& python3 -m pip install termcolor \ | ||
&& python3 -m pip install pyyaml | ||
|
||
# Install sightglass | ||
WORKDIR / | ||
RUN git clone --recurse-submodules ${SIGHTGLASS_REPO} sightglass | ||
WORKDIR /sightglass | ||
RUN git checkout ${SIGHTGLASS_COMMIT} -b ${SIGHTGLASS_COMMIT} | ||
COPY add_time_metric.diff /sightglass/add_time_metric.diff | ||
RUN git apply add_time_metric.diff | ||
RUN cargo build --release | ||
RUN mkdir results | ||
|
||
# Build wasmtime engine for sightglass | ||
WORKDIR / | ||
RUN git clone --recurse-submodule ${WASMTIME_REPO} wasmtime | ||
WORKDIR /wasmtime | ||
RUN git checkout ${WASMTIME_COMMIT} -b ${WASMTIME_COMMIT} | ||
RUN git submodule update --init --recursive | ||
RUN cargo build -p wasmtime-bench-api --release | ||
RUN cp target/release/libwasmtime_bench_api.so /sightglass/engines/wasmtime/libengine.so | ||
|
||
# Build native engine for sightglass | ||
WORKDIR /sightglass/engines/native/libengine | ||
RUN cargo build --release | ||
RUN cp target/release/libnative_bench_api.so ../libengine.so | ||
|
||
# Replace sightglass benchmarks folder with custom version | ||
WORKDIR / | ||
RUN rm -rf /sightglass/benchmarks | ||
ADD benchmarks /sightglass/benchmarks | ||
|
||
# Copy driver/helpers into the image | ||
WORKDIR / | ||
COPY wasmscore.py /sightglass/wasmscore.py | ||
COPY wasmscore.sh / | ||
|
||
# Set default entry and command | ||
ENTRYPOINT ["/bin/bash", "/wasmscore.sh"] | ||
CMD ["-t", "wasmscore"] |
Oops, something went wrong.