mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-09-11 05:35:33 +03:00
Update marian-dev submodule to master
- Earlier it was using 'wasm' branch - CMakefile changes - Github workflow change
This commit is contained in:
parent
f38a0bfbcc
commit
fdbce5705b
32
.github/workflows/macos-custom-marian-native.yml
vendored
32
.github/workflows/macos-custom-marian-native.yml
vendored
@ -1,32 +0,0 @@
|
||||
name: MacOS Native (Custom)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, ci-sandbox ]
|
||||
pull_request:
|
||||
branches: [ main, ci-sandbox ]
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
name: Native (With Custom Marian)
|
||||
runs-on: macos-10.15
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
mkdir -p build-native
|
||||
cd build-native
|
||||
cmake ..
|
||||
|
||||
- name: Compile
|
||||
working-directory: build-native
|
||||
run: make -j2
|
||||
|
||||
- name: Print versions
|
||||
working-directory: build-native
|
||||
run: ./app/bergamot-translator-app --version
|
51
.github/workflows/ubuntu-custom-marian-wasm.yml
vendored
Normal file
51
.github/workflows/ubuntu-custom-marian-wasm.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: WASM on Ubuntu
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build-wasm:
|
||||
name: WASM (With Custom Marian)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Setup Emscripten toolchain
|
||||
uses: mymindstorm/setup-emsdk@v8
|
||||
|
||||
- name: Verify Emscripten setup
|
||||
run: emcc -v
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure builds
|
||||
run: |
|
||||
mkdir -p build-wasm
|
||||
cd build-wasm
|
||||
emcmake cmake -DCOMPILE_WASM=on ..
|
||||
|
||||
- name: Compile
|
||||
working-directory: build-wasm
|
||||
run: emmake make -j2
|
||||
|
||||
- name: Instantiate simd wormhole
|
||||
working-directory: build-wasm
|
||||
run: bash ../wasm/patch-artifacts-enable-wormhole.sh
|
||||
|
||||
- name: Check artifacts
|
||||
working-directory: build-wasm
|
||||
run: |
|
||||
export WASM_ARTIFACTS_DIR=wasm
|
||||
ls -all ${WASM_ARTIFACTS_DIR}
|
||||
if ls ${WASM_ARTIFACTS_DIR}/*.wasm &>/dev/null && ls ${WASM_ARTIFACTS_DIR}/*.js &>/dev/null
|
||||
then
|
||||
echo "Artifacts Successfully Generated"
|
||||
else
|
||||
echo "Failure: Artifacts Not Present"
|
||||
exit 1
|
||||
fi
|
2
3rd_party/marian-dev
vendored
2
3rd_party/marian-dev
vendored
@ -1 +1 @@
|
||||
Subproject commit 370fdb5a212cfcd2d1c5fca9fffc041d2787a432
|
||||
Subproject commit 9337105c9f905e2e2b04ee4141a564af4523b96e
|
@ -16,26 +16,17 @@ option(COMPILE_WASM "Compile for WASM" OFF)
|
||||
option(USE_WASM_COMPATIBLE_SOURCES "Use wasm compatible sources" ON)
|
||||
SET(PACKAGE_DIR "" CACHE STRING "Directory including all the files to be packaged (pre-loaded) in wasm builds")
|
||||
|
||||
# Set marian (3rd party submodule) cmake options to compile for this project
|
||||
# Set 3rd party submodule specific cmake options for this project
|
||||
SET(COMPILE_CUDA OFF CACHE BOOL "Compile GPU version")
|
||||
SET(USE_SENTENCEPIECE ON CACHE BOOL "Download and compile SentencePiece")
|
||||
SET(USE_STATIC_LIBS ON CACHE BOOL "Link statically against non-system libs")
|
||||
if (USE_WASM_COMPATIBLE_SOURCES)
|
||||
# If using wasm compatible marian then set following flags
|
||||
# Setting the marian submodule specific cmake options for wasm
|
||||
SET(COMPILE_LIBRARY_ONLY ON CACHE BOOL "Build only the Marian library and exclude all executables.")
|
||||
SET(USE_MKL OFF CACHE BOOL "Compile with MKL support")
|
||||
SET(COMPILE_DECODER_ONLY ON CACHE BOOL "Compile marian-decoder only")
|
||||
SET(COMPILE_WITH_PTHREADS OFF CACHE BOOL "Compile with pthreads support")
|
||||
SET(USE_WASM_COMPATIBLE_BLAS ON CACHE BOOL "Compile with a WASM compatible blas for decoder only builds")
|
||||
SET(COMPILE_WITHOUT_EXCEPTIONS ON CACHE BOOL "Compile without exceptions")
|
||||
if(COMPILE_WASM)
|
||||
# Set WORMHOLE to ON for marian whenever compiling for wasm platform
|
||||
SET(WORMHOLE ON CACHE BOOL "Use WASM wormhole in intgemm https://bugzilla.mozilla.org/show_bug.cgi?id=1672160")
|
||||
endif()
|
||||
# # Setting the ssplit-cpp submodule specific cmake options for wasm
|
||||
SET(USE_INTERNAL_PCRE2 ON CACHE BOOL "Use internal PCRE2 instead of system PCRE2")
|
||||
endif()
|
||||
# Set ssplit (3rd party submodule) cmake options to compile for this project
|
||||
CMAKE_DEPENDENT_OPTION(USE_INTERNAL_PCRE2 "Use internal PCRE2 instead of system PCRE2" ON
|
||||
"USE_WASM_COMPATIBLE_SOURCES" OFF)
|
||||
|
||||
# Documentation: https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html
|
||||
# Ensures the submodules are set correctly during a build.
|
||||
|
@ -13,10 +13,6 @@ add_library(bergamot-translator STATIC
|
||||
sentence_ranges.cpp
|
||||
service.cpp
|
||||
)
|
||||
if (COMPILE_DECODER_ONLY)
|
||||
# A dirty hack because of marian's bad cmake practices
|
||||
target_compile_definitions(bergamot-translator PUBLIC DECODER_ONLY)
|
||||
endif()
|
||||
|
||||
if(COMPILE_WASM)
|
||||
# A dirty hack because of marian's bad cmake practices
|
||||
|
Loading…
Reference in New Issue
Block a user