Skip to content

Commit

Permalink
Merge pull request #48 from mchinen/lyra0.0.2
Browse files Browse the repository at this point in the history
Lyra 0.0.2
  • Loading branch information
aluebs authored Jun 28, 2021
2 parents 7f967b9 + b2701d5 commit 4d759ef
Show file tree
Hide file tree
Showing 121 changed files with 16,176 additions and 1,347 deletions.
22 changes: 17 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# By default, the linux x86 platform is targeted.
# By default, the host platform is targeted with the default c toolchain,
# likely using gcc/libstdc++ on Linux.
#
# To select the android ARM64 platform, build with `--config=android_arm64`
#
# Both platforms require an external toolchain (NDK or clang/libc++) that
# The Android platform and the clang toolchain requires an external
# toolchain (NDK with clang/libc++) that
# needs setup by the user. See README.md for instructions.
#
# If clang/libc++ is installed to /usr/local/ it can be used with linux builds
# instead of the default (gcc) by building with `--config=clang_toolchain`.
# Since this will provide no specific advantages for most users, and the process
# of installing a specific clang toolchain is a bit involved, the documentation
# for clang toolchain setup is in toolchain/

build --crosstool_top=//toolchain:clang_suite
build --cpu=k8

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

build:clang_toolchain --crosstool_top=//toolchain:clang_suite
build:clang_toolchain --cpu=k8

# Android
build:android_arm64 --cpu=arm64-v8a
build:android_arm64 --fat_apk_cpu=arm64-v8a
Expand Down
81 changes: 24 additions & 57 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# [internal] load cc_fuzz_target.bzl
# [internal] load cc_proto_library.bzl
# [internal] load android_cc_test:def.bzl
# [internal] load open_source_rules.bzl

package(default_visibility = [":__subpackages__"])

Expand Down Expand Up @@ -48,7 +47,7 @@ cc_library(
name = "layer_wrapper_interface",
hdrs = ["layer_wrapper_interface.h"],
deps = [
":sparse_inference_matrixvector",
"//sparse_matmul",
],
)

Expand All @@ -58,7 +57,7 @@ cc_library(
deps = [
":dsp_util",
":layer_wrapper_interface",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_glog//:glog",
],
)
Expand All @@ -68,7 +67,7 @@ cc_library(
hdrs = ["conv1d_layer_wrapper.h"],
deps = [
":layer_wrapper",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_glog//:glog",
],
Expand All @@ -79,7 +78,7 @@ cc_library(
hdrs = ["dilated_convolutional_layer_wrapper.h"],
deps = [
":layer_wrapper",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_glog//:glog",
],
Expand All @@ -90,7 +89,7 @@ cc_library(
hdrs = ["transpose_convolutional_layer_wrapper.h"],
deps = [
":layer_wrapper",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_glog//:glog",
],
Expand All @@ -114,7 +113,7 @@ cc_library(
":dsp_util",
":layer_wrappers_lib",
":lyra_types",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:span",
Expand All @@ -128,14 +127,12 @@ cc_library(
hdrs = ["benchmark_decode_lib.h"],
deps = [
":architecture_utils",
":dsp_util",
":generative_model_interface",
":log_mel_spectrogram_extractor_impl",
":lyra_config",
":wavegru_model_impl",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
"@com_google_absl//absl/flags:usage",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -246,7 +243,7 @@ cc_library(
":generative_model_interface",
":lyra_types",
":lyra_wavegru",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -275,7 +272,7 @@ cc_library(
":generative_model_interface",
":lyra_types",
":lyra_wavegru",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -656,7 +653,7 @@ cc_library(
copts = ["-O3"],
deps = [
":layer_wrapper",
":sparse_inference_matrixvector",
"//sparse_matmul",
],
)

Expand Down Expand Up @@ -690,8 +687,8 @@ cc_library(
],
data = glob(["wavegru/**"]),
deps = [
":sparse_inference_matrixvector",
":vector_quantizer_interface",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:optional",
Expand Down Expand Up @@ -733,7 +730,7 @@ cc_library(
":layer_wrappers_lib",
":lyra_types",
":project_and_sample",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/time",
"@com_google_absl//absl/types:span",
Expand All @@ -750,7 +747,7 @@ cc_library(
copts = ["-O3"],
deps = [
":lyra_types",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -827,36 +824,6 @@ cc_test(
],
)

cc_test(
name = "sparse_inference_matrixvector_test",
size = "small",
timeout = "short",
srcs = ["sparse_inference_matrixvector_test.cc"],
deps = [
":sparse_inference_matrixvector",
"@com_google_googletest//:gtest_main",
],
)

cc_library(
name = "sparse_inference_matrixvector",
srcs = select({
":android_config": ["lib/android_arm64/libsparse_inference.so"],
"//conditions:default": ["lib/linux_x86_64/libsparse_inference.so"],
}),
hdrs = ["sparse_inference_matrixvector.h"],
defines = [
"ACCURATE_TRANSCENDENTAL_APPROX",
"FAST_SAMPLING",
"FAST_TRANSCENDENTALS",
"SIGMOID_AS_TANH",
],
deps = [
"@com_google_absl//absl/status",
"@com_google_glog//:glog",
],
)

cc_binary(
name = "encoder_main",
srcs = [
Expand Down Expand Up @@ -926,7 +893,7 @@ cc_test(
":exported_layers_test",
":lyra_config",
":lyra_wavegru",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
Expand All @@ -945,7 +912,7 @@ cc_test(
deps = [
":lyra_config",
":lyra_wavegru",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
Expand All @@ -964,7 +931,7 @@ cc_test(
deps = [
":lyra_config",
":lyra_wavegru",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
Expand Down Expand Up @@ -998,7 +965,7 @@ cc_test(
":exported_layers_test",
":lyra_types",
":project_and_sample",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
Expand Down Expand Up @@ -1095,7 +1062,7 @@ cc_library(
deps = [
":layer_wrappers_lib",
":lyra_types",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/random",
"@com_google_googletest//:gtest",
"@gulrak_filesystem//:filesystem",
Expand Down Expand Up @@ -1341,7 +1308,7 @@ cc_test(
":exported_layers_test",
":lyra_config",
":lyra_types",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
Expand All @@ -1357,7 +1324,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":layer_wrappers_lib",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/memory",
"@com_google_googletest//:gtest",
],
Expand All @@ -1381,7 +1348,7 @@ cc_test(
":conv1d_layer_wrapper",
":layer_wrapper",
":layer_wrapper_test_common",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
],
Expand All @@ -1405,7 +1372,7 @@ cc_test(
":dilated_convolutional_layer_wrapper",
":layer_wrapper",
":layer_wrapper_test_common",
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
],
Expand All @@ -1428,8 +1395,8 @@ cc_test(
deps = [
":layer_wrapper",
":layer_wrapper_test_common",
":sparse_inference_matrixvector",
":transpose_convolutional_layer_wrapper",
"//sparse_matmul",
"@com_google_googletest//:gtest_main",
"@gulrak_filesystem//:filesystem",
],
Expand Down Expand Up @@ -1483,7 +1450,7 @@ cc_library(
],
hdrs = ["dsp_util.h"],
deps = [
":sparse_inference_matrixvector",
"//sparse_matmul",
"@com_google_absl//absl/types:optional",
"@com_google_absl//absl/types:span",
"@com_google_audio_dsp//audio/dsp:signal_vector_util",
Expand Down
Loading

0 comments on commit 4d759ef

Please sign in to comment.