Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Update from upstream Sep 20, 2023 #294

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ad78165
Bump 3rd_party/marian-dev from `199201e` to `e88c1aa` (#416)
dependabot[bot] May 18, 2022
61d2c35
Set up python packaging for pypi distribution (#424)
jerinphilip Jun 20, 2022
8771078
Basic HTML property testing for WebAssembly (#425)
jerinphilip Jun 21, 2022
05a8778
Bump version to 0.4.5 (#427)
jerinphilip Jun 21, 2022
3ef85e1
Python package: pyyaml >= 5.1 (#429)
jerinphilip Jun 24, 2022
84c761b
Python: Work offline if models are available (#431)
jerinphilip Jun 25, 2022
7f79128
MacOS Wheels (#432)
graemenail Jun 29, 2022
06c31af
update download path
XapaJIaMnu Jan 17, 2023
21eff44
try to update coding_styles workflow
XapaJIaMnu Jan 17, 2023
6cefc43
Latest and greatest clang-format
XapaJIaMnu Jan 18, 2023
620c8b0
Bump qs and express in /wasm/test_page (#444)
dependabot[bot] Jan 18, 2023
6f2659f
Arm updated (#443)
XapaJIaMnu Jan 18, 2023
7d24908
Apply security update and formatting
XapaJIaMnu Jan 18, 2023
2834f04
Expand the node-test.js example code with documentation (#434)
jelmervdl Jan 18, 2023
8d5f877
More portable WASM demo (#437)
jelmervdl Jan 18, 2023
1ba7461
Fix compilation on x86
XapaJIaMnu Jan 19, 2023
82c276a
Fix path to example program
kpu Mar 1, 2023
eb0fe1b
Bump 3rd_party/marian-dev from `69e27d2` to `8ceb051` (#446)
dependabot[bot] May 4, 2023
fceb713
Update workflows
XapaJIaMnu May 4, 2023
3c2a667
Try harder to install gperftools
XapaJIaMnu May 4, 2023
b3d36bc
Bump 3rd_party/marian-dev from `8ceb051` to `bb65f47` (#447)
dependabot[bot] May 10, 2023
ada8c39
Fix compilation on newer gcc
XapaJIaMnu Jun 6, 2023
eaa2562
Sentencepiece windows compilation
XapaJIaMnu Jul 12, 2023
e333208
Bump 3rd_party/marian-dev from `6a6bbb6` to `aa0221e` (#452)
dependabot[bot] Jul 31, 2023
becb6e2
Fix Python formatting (Black) (#453)
graemenail Jul 31, 2023
cbfa839
Fix CI (#454)
graemenail Jul 31, 2023
8011f9c
Bump bergamot-translator-tests from `7984d14` to `a04432d` (#455)
dependabot[bot] Jul 31, 2023
4b0da8d
Enables model ensembles (#450)
graemenail Aug 1, 2023
2bdc493
Bump 3rd_party/ssplit-cpp from `ad2c5a5` to `a311f98` (#456)
dependabot[bot] Aug 8, 2023
ca95467
Bump 3rd_party/marian-dev from `aa0221e` to `8dbde0f` (#458)
dependabot[bot] Aug 11, 2023
534ed37
Remove wormhole references (#459)
XapaJIaMnu Aug 14, 2023
47024ec
Add more things to the gitignore that are not being ignored (#462)
gregtatum Aug 16, 2023
62770bb
Generate a compile_commands.json by default with cmake (#461)
gregtatum Aug 16, 2023
db38262
Report the wasm size on builds (#460)
gregtatum Aug 17, 2023
0b069ac
Bump 3rd_party/marian-dev from `300a50f` to `780df27` (#464)
dependabot[bot] Sep 11, 2023
321be8a
Bump 3rd_party/marian-dev from `780df27` to `11c6ae7` (#466)
dependabot[bot] Sep 20, 2023
73182d4
Pull in marian-dev with fixed CI and clang
kpu Dec 7, 2023
7774029
clang: marian-dev with newer fbgemm
kpu Dec 7, 2023
0367ae0
Fix MKL key URL
kpu Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 8 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
version: 2.1
jobs:
build-with-wormhole:
docker:
- image: 'emscripten/emsdk:3.1.8'
resource_class: medium

working_directory: ~/checkout

steps:
- checkout

- run:
name: Build WASM WORMHOLE
command: |
bash build-wasm.sh WORMHOLE

- run:
name: Check artifacts
working_directory: build-wasm
command: |
ARTIFACT_BASE="bergamot-translator-worker"
ARTIFACT_SUFFIX="with-wormhole"
ARTIFACT_FINAL=$ARTIFACT_BASE-$ARTIFACT_SUFFIX

if [[ -f "$ARTIFACT_BASE.js" && -f "$ARTIFACT_BASE.wasm" ]]; then
echo "Artifacts Successfully Generated"
mkdir ../artifacts
cp $ARTIFACT_BASE.wasm ../artifacts/$ARTIFACT_FINAL.wasm
cp $ARTIFACT_BASE.js ../artifacts/$ARTIFACT_FINAL.js
cd ../artifacts
shasum -a 256 $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize-$ARTIFACT_SUFFIX
ls -lsa $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize-$ARTIFACT_SUFFIX
cp ../BERGAMOT_VERSION .
else
echo "Failure: Artifacts Not Present"
exit 1
fi

- persist_to_workspace:
root: .
paths:
- artifacts/*

- store_artifacts:
path: "artifacts"
destination: "wasm-wormhole"

build-without-wormhole:
build:
docker:
- image: 'emscripten/emsdk:3.1.8'
resource_class: medium
Expand All @@ -66,17 +20,16 @@ jobs:
working_directory: build-wasm
command: |
ARTIFACT_BASE="bergamot-translator-worker"
ARTIFACT_SUFFIX="without-wormhole"
ARTIFACT_FINAL=$ARTIFACT_BASE-$ARTIFACT_SUFFIX
ARTIFACT_FINAL=$ARTIFACT_BASE

if [[ -f "$ARTIFACT_BASE.js" && -f "$ARTIFACT_BASE.wasm" ]]; then
echo "Artifacts Successfully Generated"
mkdir ../artifacts
cp $ARTIFACT_BASE.wasm ../artifacts/$ARTIFACT_FINAL.wasm
cp $ARTIFACT_BASE.js ../artifacts/$ARTIFACT_FINAL.js
cd ../artifacts
shasum -a 256 $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize-$ARTIFACT_SUFFIX
ls -lsa $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize-$ARTIFACT_SUFFIX
shasum -a 256 $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize
ls -lsa $ARTIFACT_FINAL.wasm $ARTIFACT_FINAL.js >> sha256-filesize
else
echo "Failure: Artifacts Not Present"
exit 1
Expand All @@ -89,7 +42,7 @@ jobs:

- store_artifacts:
path: "artifacts"
destination: "wasm-without-wormhole"
destination: "wasm"

publish_to_github:
docker:
Expand All @@ -106,18 +59,13 @@ jobs:
name: "Publish Release on GitHub"
command: |
export TAG_VERSION=$(cat ./artifacts/BERGAMOT_VERSION)
cat ./artifacts/sha256-filesize-without-wormhole ./artifacts/sha256-filesize-with-wormhole >> ./artifacts/sha256-filesize
rm ./artifacts/sha256-filesize-without-wormhole ./artifacts/sha256-filesize-with-wormhole ./artifacts/BERGAMOT_VERSION
rm ./artifacts/BERGAMOT_VERSION
ghr -t ${GHTOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${TAG_VERSION} ./artifacts/

workflows:
build:
jobs:
- build-with-wormhole:
filters:
tags:
only: /^v.*/
- build-without-wormhole:
- build:
filters:
tags:
only: /^v.*/
Expand All @@ -128,7 +76,6 @@ workflows:
branches:
ignore: /.*/
requires:
- build-without-wormhole
- build-with-wormhole
- build


139 changes: 139 additions & 0 deletions .github/workflows/arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: ARM
'on':
push:
branches:
- main
- ci-sandbox
pull_request:
branches:
- '**'
env:
ccache_basedir: ${{ github.workspace }}
ccache_dir: "${{ github.workspace }}/.ccache"
ccache_compilercheck: content
ccache_compress: 'true'
ccache_compresslevel: 9
ccache_maxsize: 200M
ccache_cmake: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
ndk: "${{ github.workspace }}/android-ndk-r23b"
abi: "arm64-v8a"
minsdk_version : 28
android_platform: 28

jobs:
ubuntu:
name: "arm-v8a cross-compile via Android NDK"
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install prerequisites
run: |
wget -c --quiet https://dl.google.com/android/repository/android-ndk-r23b-linux.zip
unzip -qq android-ndk-r23b-linux.zip
sudo apt-get -y install ccache cmake

- name: Generate ccache_vars for ccache based on machine
shell: bash
id: ccache_vars
run: |-
echo "::set-output name=hash::$(echo ${{ env.ccache_compilercheck }})"
echo "::set-output name=timestamp::$(date '+%Y-%m-%dT%H.%M.%S')"

- name: Cache-op for build-cache through ccache
uses: actions/cache@v2
with:
path: ${{ env.ccache_dir }}
key: ccache-${{ matrix.identifier }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
restore-keys: |-
ccache-${{ matrix.identifier }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}
ccache-${{ matrix.identifier }}-${{ steps.ccache_vars.outputs.hash }}
ccache-${{ matrix.identifier }}

- name: ccache environment setup
run: |-
echo "CCACHE_COMPILER_CHECK=${{ env.ccache_compilercheck }}" >> $GITHUB_ENV
echo "CCACHE_BASEDIR=${{ env.ccache_basedir }}" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=${{ env.ccache_compress }}" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=${{ env.ccache_compresslevel }}" >> $GITHUB_ENV
echo "CCACHE_DIR=${{ env.ccache_dir }}" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=${{ env.ccache_maxsize }}" >> $GITHUB_ENV

- name: ccache prolog
run: |-
ccache -s # Print current cache stats
ccache -z # Zero cache entry

- name: Generate buildfiles for bergamot-translator on android via cmake
run: |-
mkdir -p build
cd build
NDK=${{ env.ndk }}
ABI=${{ env.abi }}
MINSDK_VERSION=${{ env.minsdk_version }}
ANDROID_PLATFORM=android-${{ env.android_platform }}
OTHER_ANDROID_ARGS=(
-DANDROID_ARM_NEON=TRUE
)
OTHER_MARIAN_ARGS=(
-DCOMPILE_CUDA=off
-DCOMPILE_CPU=on
-DCMAKE_HAVE_THREADS_LIBRARY=1
-DCMAKE_USE_WIN32_THREADS_INIT=0
-DCMAKE_USE_PTHREADS_INIT=1
-DTHREADS_PREFER_PTHREAD_FLAG=ON
-DBUILD_ARCH=armv8-a
# -DCOMPILE_WITHOUT_EXCEPTIONS=on # Apparently this can reduce the binary size, let's see.
-DSSPLIT_USE_INTERNAL_PCRE2=ON
)
# Additionally list variables finally configured.
cmake -L \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_ABI=$ABI \
-DANDROID_PLATFORM=$ANDROID_PLATFORM \
-DANDROID_NATIVE_API_LEVEL=$MINSDKVERSION \
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.8 \
-DANDROID_STL=c++_static \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache \
"${OTHER_ANDROID_ARGS[@]}" "${OTHER_MARIAN_ARGS[@]}" \
..


- name : Build bergamot-translator for android
working-directory: build
run: |-
make -j2

- name: ccache epilog
run: 'ccache -s # Print current cache stats'

- uses: actions/upload-artifact@v2
with:
path: ${{github.workspace}}/build/app/bergamot


# Disable release for now.
# release:
# name: Release Latest Build
# runs-on: ubuntu-latest
# needs: [ubuntu]
# if: github.ref == 'refs/heads/master'
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v2
#
# - name: Update GitHub prerelease
# uses: marvinpinto/action-automatic-releases@latest
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# automatic_release_tag: latest
# prerelease: true
# title: "Latest Build"
# files: |
# artifact/marian-decoder
Loading