Skip to content

Commit

Permalink
V2 (#89)
Browse files Browse the repository at this point in the history
V2 (1.2.0)
  • Loading branch information
mchinen authored Sep 30, 2022
1 parent 91173db commit c2395ff
Show file tree
Hide file tree
Showing 387 changed files with 5,880 additions and 27,771 deletions.
96 changes: 95 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

build --cxxopt=-std=gnu++17
build --linkopt=-lm
build --cxxopt=-Wno-sign-compare
# Use the default C++ toolchain to build the tools used during the
# build.
build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
Expand Down Expand Up @@ -49,3 +48,98 @@ build:android_arm64 --copt=-Os
# use rules_jvm_external. After that, this might be removeable, and we can use
# androidx and more recent deps instead of deprecated ones.
build:android_arm64 --strict_java_deps=OFF


# Start Tensorflow
# The below is to allow tensorflow to build.
# Inspired by TensorFlow serving's .bazelrc to build from the source.
# It also may be useful to refer to TensorFlow .bazelrc for more details:
# https://github.com/tensorflow/tensorflow/blob/master/.bazelrc

# Optimizations used for TF Serving release builds.
build:release --copt=-mavx
build:release --copt=-msse4.2

# Options used to build with CUDA.
build:cuda --repo_env TF_NEED_CUDA=1
build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
build:cuda --@local_config_cuda//:enable_cuda
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true
build:cuda --action_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"

# Options used to build with TPU support.
build:tpu --distinct_host_configuration=false
build:tpu --define=with_tpu_support=true --define=framework_shared_object=false

# Please note that MKL on MacOS or windows is still not supported.
# If you would like to use a local MKL instead of downloading, please set the
# environment variable "TF_MKL_ROOT" every time before build.
build:mkl --define=build_with_mkl=true --define=enable_mkl=true --define=build_with_openmp=true
build:mkl --define=tensorflow_mkldnn_contraction_kernel=0

# This config option is used to enable MKL-DNN open source library only,
# without depending on MKL binary version.
build:mkl_open_source_only --define=build_with_mkl_dnn_only=true
build:mkl_open_source_only --define=build_with_mkl=true --define=enable_mkl=true
build:mkl_open_source_only --define=tensorflow_mkldnn_contraction_kernel=0

# Processor native optimizations (depends on build host capabilities).
build:nativeopt --copt=-march=native
build:nativeopt --host_copt=-march=native
build:nativeopt --copt=-O3

build --keep_going
build --verbose_failures=true
build --spawn_strategy=standalone
build --genrule_strategy=standalone

build --define=grpc_no_ares=true

# Sets the default Apple platform to macOS.
build --apple_platform_type=macos

build --experimental_repo_remote_exec

# Enable platform specific config (e.g. by default use --config=windows when on windows, and --config=linux when on linux)
build --enable_platform_specific_config

# End Tensorflow

## Windows config
startup --windows_enable_symlinks
build:windows --enable_runfiles

# These settings below allow for compilation using MSVC
build:windows --copt=/D_USE_MATH_DEFINES
build:windows --host_copt=/D_USE_MATH_DEFINES
build:windows --cxxopt=-D_HAS_DEPRECATED_RESULT_OF=1

build:windows --cxxopt=/Zc:__cplusplus
# c++20 needed in MSVC for designated initializers (llvm libc++
# and gnu stc++ provides them in c++17).
build:windows --cxxopt=/std:c++20
build:windows --linkopt=-ldl
build:windows --host_cxxopt=/std:c++20

# Make sure to include as little of windows.h as possible
build:windows --copt=-DWIN32_LEAN_AND_MEAN
build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
build:windows --copt=-DNOGDI
build:windows --host_copt=-DNOGDI

# MSVC (Windows): Standards-conformant preprocessor mode
# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
build:windows --copt=/Zc:preprocessor
build:windows --host_copt=/Zc:preprocessor

# Misc build options we need for windows according to tensorflow
build:windows --linkopt=/DEBUG
build:windows --host_linkopt=/DEBUG
build:windows --linkopt=/OPT:REF
build:windows --host_linkopt=/OPT:REF
build:windows --linkopt=/OPT:ICF
build:windows --host_linkopt=/OPT:ICF
# This is a workaround for this magic preprocessor constant/macro not existing
# in MSVC
build:windows --host_copt=-D__PRETTY_FUNCTION__=__FUNCSIG__
build:windows --copt=-D__PRETTY_FUNCTION__=__FUNCSIG__
2 changes: 1 addition & 1 deletion .github/actions/lyra-builder/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
- shell: bash
run: |
mkdir action-product
cp -r wavegru action-product/
cp -r model_coeffs action-product/
cp bazel-bin/encoder_main action-product/lyra-encoder
cp bazel-bin/decoder_main action-product/lyra-decoder
- uses: actions/upload-artifact@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: setup-ndk
name: setup-lyra-deps

description: Setup NDK for lyra build
description: Setup NDK and python for lyra build

runs:
using: composite
steps:
- shell: bash
run: |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529"
python -m pip install --upgrade pip
pip install numpy
32 changes: 24 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup NDK
uses: ./.github/actions/setup-ndk
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Lyra dependencies
uses: ./.github/actions/setup-lyra-deps
- name: Build Android App
shell: bash
run: |
Expand All @@ -31,8 +35,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup NDK
uses: ./.github/actions/setup-ndk
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Lyra dependencies
uses: ./.github/actions/setup-lyra-deps
- name: Build and upload
uses: ./.github/actions/lyra-builder
with:
Expand All @@ -45,8 +53,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup NDK
uses: ./.github/actions/setup-ndk
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Lyra dependencies
uses: ./.github/actions/setup-lyra-deps
- name: Build and upload
uses: ./.github/actions/lyra-builder
with:
Expand All @@ -58,8 +70,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup NDK
uses: ./.github/actions/setup-ndk
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Lyra dependencies
uses: ./.github/actions/setup-lyra-deps
- name: Build and upload
uses: ./.github/actions/lyra-builder
with:
Expand Down
Loading

0 comments on commit c2395ff

Please sign in to comment.