Skip to content

Commit

Permalink
Produce TFLite NuGet package
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lissy committed Jan 30, 2020
1 parent 0428c84 commit f3b4e7a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
2 changes: 2 additions & 0 deletions taskcluster/scriptworker-task-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ build:
- "android-armv7-cpu-opt"
- "win-amd64-cpu-opt"
- "win-amd64-gpu-opt"
- "win-amd64-tflite-opt"
java_aar:
- "android-java-opt"
nuget:
- "win-amd64-cpu-opt"
- "win-amd64-gpu-opt"
- "win-amd64-tflite-opt"
metadata:
name: "DeepSpeech GitHub Packages"
description: "Trigger Uploading of DeepSpeech Packages to GitHub release page"
2 changes: 2 additions & 0 deletions taskcluster/scriptworker-task-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build:
# Make sure builds are ready
- "win-amd64-cpu-opt"
- "win-amd64-gpu-opt"
- "win-amd64-tflite-opt"
allowed:
- "tag"
ref_match: "refs/tags/"
Expand All @@ -20,6 +21,7 @@ build:
nuget:
- "win-amd64-cpu-opt"
- "win-amd64-gpu-opt"
- "win-amd64-tflite-opt"
metadata:
name: "DeepSpeech NuGet Packages"
description: "Trigger Uploading of DeepSpeech .Net Framework bindings to NuGet"
7 changes: 5 additions & 2 deletions taskcluster/tc-netframework-ds-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

set -xe

cuda=$1
bitrate=$1
package_option=$2

source $(dirname "$0")/tc-tests-utils.sh

bitrate=$1
set_ldc_sample_filename "${bitrate}"

if [ "${cuda}" = "--cuda" ]; then
if [ "${package_option}" = "--cuda" ]; then
PROJECT_NAME="DeepSpeech-GPU"
elif [ "${package_option}" = "--tflite" ]; then
PROJECT_NAME="DeepSpeech-TFLite"
else
PROJECT_NAME="DeepSpeech"
fi
Expand Down
11 changes: 11 additions & 0 deletions taskcluster/test-netframework-win-tflite-opt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build:
template_file: test-win-opt-base.tyml
dependencies:
- "win-amd64-tflite-opt"
- "test-training_16k-linux-amd64-py36m-opt"
test_model_task: "test-training_16k-linux-amd64-py36m-opt"
args:
tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/taskcluster/tc-netframework-ds-tests.sh 16k --tflite"
metadata:
name: "DeepSpeech Windows AMD64 TFLite .Net Framework tests"
description: "Testing DeepSpeech .Net Framework for Windows/AMD64, TFLite, optimized version"
2 changes: 1 addition & 1 deletion taskcluster/win-amd64-tflite-opt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
- "notify.irc-channel.${notifications.irc}.on-failed"
tensorflow: "https://community-tc.services.mozilla.com/api/index/v1/task/project.deepspeech.tensorflow.pip.r1.15.ceb46aae5836a0f648a2c3da5942af2b7d1b98bf.win/artifacts/public/home.tar.xz"
scripts:
build: "taskcluster/win-build.sh tflite"
build: "taskcluster/win-build.sh --tflite"
package: "taskcluster/win-package.sh"
nc_asset_name: "native_client.amd64.tflite.win.tar.xz"
maxRunTime: 14400
Expand Down
20 changes: 10 additions & 10 deletions taskcluster/win-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

set -xe

cuda=$1
runtime=$1
package_option=$1

source $(dirname "$0")/tc-tests-utils.sh

Expand All @@ -14,24 +13,25 @@ BAZEL_TARGETS="
//native_client:generate_trie
"

if [ "${cuda}" = "--cuda" ]; then
if [ "${package_option}" = "--cuda" ]; then
BAZEL_ENV_FLAGS="TF_NEED_CUDA=1 ${TF_CUDA_FLAGS}"
BAZEL_BUILD_FLAGS="${BAZEL_CUDA_FLAGS} ${BAZEL_EXTRA_FLAGS} ${BAZEL_OPT_FLAGS}"
PROJECT_NAME="DeepSpeech-GPU"
elif [ "${package_option}" = "--tflite" ]; then
PROJECT_NAME="DeepSpeech-TFLite"
BAZEL_BUILD_FLAGS="--define=runtime=tflite ${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
else
PROJECT_NAME="DeepSpeech"
if [ "${runtime}" = "tflite" ]; then
BAZEL_BUILD_TFLITE="--define=runtime=tflite"
fi;
BAZEL_BUILD_FLAGS="${BAZEL_BUILD_TFLITE} ${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
BAZEL_BUILD_FLAGS="${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
fi

SYSTEM_TARGET=host-win

do_bazel_build

if [ "${cuda}" = "--cuda" ]; then
if [ "${package_option}" = "--cuda" ]; then
cp ${DS_ROOT_TASK}/DeepSpeech/tf/bazel-bin/native_client/liblibdeepspeech.so.ifso ${DS_ROOT_TASK}/DeepSpeech/tf/bazel-bin/native_client/libdeepspeech.so.if.lib
fi

Expand All @@ -44,10 +44,10 @@ export SUPPORTED_PYTHON_VERSIONS="3.5.4 3.6.8 3.7.6 3.8.1"
if [ "${runtime}" = "tflite" ]; then
do_deepspeech_python_build "--tflite"
else
do_deepspeech_python_build "${cuda}"
do_deepspeech_python_build "${package_option}"
fi

do_deepspeech_nodejs_build "${cuda}"
do_deepspeech_nodejs_build "${package_option}"

do_deepspeech_netframework_build

Expand Down

0 comments on commit f3b4e7a

Please sign in to comment.