Merge pull request #2706 from lissyx/win-tflite
Produce TFLite NuGet package
This commit is contained in:
commit
3d18ab8058
|
@ -51,11 +51,13 @@ build:
|
||||||
- "android-armv7-cpu-opt"
|
- "android-armv7-cpu-opt"
|
||||||
- "win-amd64-cpu-opt"
|
- "win-amd64-cpu-opt"
|
||||||
- "win-amd64-gpu-opt"
|
- "win-amd64-gpu-opt"
|
||||||
|
- "win-amd64-tflite-opt"
|
||||||
java_aar:
|
java_aar:
|
||||||
- "android-java-opt"
|
- "android-java-opt"
|
||||||
nuget:
|
nuget:
|
||||||
- "win-amd64-cpu-opt"
|
- "win-amd64-cpu-opt"
|
||||||
- "win-amd64-gpu-opt"
|
- "win-amd64-gpu-opt"
|
||||||
|
- "win-amd64-tflite-opt"
|
||||||
metadata:
|
metadata:
|
||||||
name: "DeepSpeech GitHub Packages"
|
name: "DeepSpeech GitHub Packages"
|
||||||
description: "Trigger Uploading of DeepSpeech Packages to GitHub release page"
|
description: "Trigger Uploading of DeepSpeech Packages to GitHub release page"
|
||||||
|
|
|
@ -4,6 +4,7 @@ build:
|
||||||
# Make sure builds are ready
|
# Make sure builds are ready
|
||||||
- "win-amd64-cpu-opt"
|
- "win-amd64-cpu-opt"
|
||||||
- "win-amd64-gpu-opt"
|
- "win-amd64-gpu-opt"
|
||||||
|
- "win-amd64-tflite-opt"
|
||||||
allowed:
|
allowed:
|
||||||
- "tag"
|
- "tag"
|
||||||
ref_match: "refs/tags/"
|
ref_match: "refs/tags/"
|
||||||
|
@ -20,6 +21,7 @@ build:
|
||||||
nuget:
|
nuget:
|
||||||
- "win-amd64-cpu-opt"
|
- "win-amd64-cpu-opt"
|
||||||
- "win-amd64-gpu-opt"
|
- "win-amd64-gpu-opt"
|
||||||
|
- "win-amd64-tflite-opt"
|
||||||
metadata:
|
metadata:
|
||||||
name: "DeepSpeech NuGet Packages"
|
name: "DeepSpeech NuGet Packages"
|
||||||
description: "Trigger Uploading of DeepSpeech .Net Framework bindings to NuGet"
|
description: "Trigger Uploading of DeepSpeech .Net Framework bindings to NuGet"
|
||||||
|
|
|
@ -2,15 +2,21 @@
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
cuda=$1
|
bitrate=$1
|
||||||
|
package_option=$2
|
||||||
|
|
||||||
source $(dirname "$0")/tc-tests-utils.sh
|
source $(dirname "$0")/tc-tests-utils.sh
|
||||||
|
|
||||||
bitrate=$1
|
bitrate=$1
|
||||||
set_ldc_sample_filename "${bitrate}"
|
set_ldc_sample_filename "${bitrate}"
|
||||||
|
|
||||||
if [ "${cuda}" = "--cuda" ]; then
|
if [ "${package_option}" = "--cuda" ]; then
|
||||||
PROJECT_NAME="DeepSpeech-GPU"
|
PROJECT_NAME="DeepSpeech-GPU"
|
||||||
|
elif [ "${package_option}" = "--tflite" ]; then
|
||||||
|
PROJECT_NAME="DeepSpeech-TFLite"
|
||||||
|
model_source=${DEEPSPEECH_TEST_MODEL//.pb/.tflite}
|
||||||
|
model_name=$(basename "${model_source}")
|
||||||
|
model_name_mmap=$(basename "${model_source}")
|
||||||
else
|
else
|
||||||
PROJECT_NAME="DeepSpeech"
|
PROJECT_NAME="DeepSpeech"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -614,8 +614,11 @@ install_nuget()
|
||||||
mkdir -p "${TASKCLUSTER_TMP_DIR}/repo/"
|
mkdir -p "${TASKCLUSTER_TMP_DIR}/repo/"
|
||||||
mkdir -p "${TASKCLUSTER_TMP_DIR}/ds/"
|
mkdir -p "${TASKCLUSTER_TMP_DIR}/ds/"
|
||||||
|
|
||||||
${WGET} -O - "${DEEPSPEECH_ARTIFACTS_ROOT}/${nuget}" | gunzip > "${TASKCLUSTER_TMP_DIR}/${PROJECT_NAME}.${DS_VERSION}.nupkg"
|
nuget_pkg_url=$(get_dep_nuget_pkg_url "${nuget}")
|
||||||
${WGET} -O - "${DEEPSPEECH_ARTIFACTS_ROOT}/DeepSpeechConsole.exe" | gunzip > "${TASKCLUSTER_TMP_DIR}/ds/DeepSpeechConsole.exe"
|
console_pkg_url=$(get_dep_nuget_pkg_url "DeepSpeechConsole.exe")
|
||||||
|
|
||||||
|
${WGET} -O - "${nuget_pkg_url}" | gunzip > "${TASKCLUSTER_TMP_DIR}/${PROJECT_NAME}.${DS_VERSION}.nupkg"
|
||||||
|
${WGET} -O - "${console_pkg_url}" | gunzip > "${TASKCLUSTER_TMP_DIR}/ds/DeepSpeechConsole.exe"
|
||||||
|
|
||||||
nuget sources add -Name repo -Source $(cygpath -w "${TASKCLUSTER_TMP_DIR}/repo/")
|
nuget sources add -Name repo -Source $(cygpath -w "${TASKCLUSTER_TMP_DIR}/repo/")
|
||||||
|
|
||||||
|
@ -1207,6 +1210,25 @@ get_dep_npm_pkg_url()
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Will inspect this task's dependencies for one that provides a matching NuGet package
|
||||||
|
get_dep_nuget_pkg_url()
|
||||||
|
{
|
||||||
|
local deepspeech_pkg=$1
|
||||||
|
local all_deps="$(curl -s https://community-tc.services.mozilla.com/api/queue/v1/task/${TASK_ID} | python -c 'import json; import sys; print(" ".join(json.loads(sys.stdin.read())["dependencies"]));')"
|
||||||
|
|
||||||
|
for dep in ${all_deps}; do
|
||||||
|
local has_artifact=$(curl -s https://community-tc.services.mozilla.com/api/queue/v1/task/${dep}/artifacts | python -c 'import json; import sys; has_artifact = True in [ e["name"].find("'${deepspeech_pkg}'") > 0 for e in json.loads(sys.stdin.read())["artifacts"] ]; print(has_artifact)')
|
||||||
|
if [ "${has_artifact}" = "True" ]; then
|
||||||
|
echo "https://community-tc.services.mozilla.com/api/queue/v1/task/${dep}/artifacts/public/${deepspeech_pkg}"
|
||||||
|
exit 0
|
||||||
|
fi;
|
||||||
|
done;
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
# This should not be reached, otherwise it means we could not find a matching nodejs package
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
extract_python_versions()
|
extract_python_versions()
|
||||||
{
|
{
|
||||||
# call extract_python_versions ${pyver_full} pyver pyver_pkg py_unicode_type pyconf pyalias
|
# call extract_python_versions ${pyver_full} pyver pyver_pkg py_unicode_type pyconf pyalias
|
||||||
|
|
|
@ -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"
|
|
@ -8,7 +8,7 @@ build:
|
||||||
- "notify.irc-channel.${notifications.irc}.on-failed"
|
- "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"
|
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:
|
scripts:
|
||||||
build: "taskcluster/win-build.sh tflite"
|
build: "taskcluster/win-build.sh --tflite"
|
||||||
package: "taskcluster/win-package.sh"
|
package: "taskcluster/win-package.sh"
|
||||||
nc_asset_name: "native_client.amd64.tflite.win.tar.xz"
|
nc_asset_name: "native_client.amd64.tflite.win.tar.xz"
|
||||||
maxRunTime: 14400
|
maxRunTime: 14400
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
cuda=$1
|
package_option=$1
|
||||||
runtime=$1
|
|
||||||
|
|
||||||
source $(dirname "$0")/tc-tests-utils.sh
|
source $(dirname "$0")/tc-tests-utils.sh
|
||||||
|
|
||||||
|
@ -14,16 +13,17 @@ BAZEL_TARGETS="
|
||||||
//native_client:generate_trie
|
//native_client:generate_trie
|
||||||
"
|
"
|
||||||
|
|
||||||
if [ "${cuda}" = "--cuda" ]; then
|
if [ "${package_option}" = "--cuda" ]; then
|
||||||
BAZEL_ENV_FLAGS="TF_NEED_CUDA=1 ${TF_CUDA_FLAGS}"
|
BAZEL_ENV_FLAGS="TF_NEED_CUDA=1 ${TF_CUDA_FLAGS}"
|
||||||
BAZEL_BUILD_FLAGS="${BAZEL_CUDA_FLAGS} ${BAZEL_EXTRA_FLAGS} ${BAZEL_OPT_FLAGS}"
|
BAZEL_BUILD_FLAGS="${BAZEL_CUDA_FLAGS} ${BAZEL_EXTRA_FLAGS} ${BAZEL_OPT_FLAGS}"
|
||||||
PROJECT_NAME="DeepSpeech-GPU"
|
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
|
else
|
||||||
PROJECT_NAME="DeepSpeech"
|
PROJECT_NAME="DeepSpeech"
|
||||||
if [ "${runtime}" = "tflite" ]; then
|
BAZEL_BUILD_FLAGS="${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
|
||||||
BAZEL_BUILD_TFLITE="--define=runtime=tflite"
|
|
||||||
fi;
|
|
||||||
BAZEL_BUILD_FLAGS="${BAZEL_BUILD_TFLITE} ${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
|
|
||||||
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
|
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ SYSTEM_TARGET=host-win
|
||||||
|
|
||||||
do_bazel_build
|
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
|
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
|
fi
|
||||||
|
|
||||||
|
@ -44,10 +44,10 @@ export SUPPORTED_PYTHON_VERSIONS="3.5.4 3.6.8 3.7.6 3.8.1"
|
||||||
if [ "${runtime}" = "tflite" ]; then
|
if [ "${runtime}" = "tflite" ]; then
|
||||||
do_deepspeech_python_build "--tflite"
|
do_deepspeech_python_build "--tflite"
|
||||||
else
|
else
|
||||||
do_deepspeech_python_build "${cuda}"
|
do_deepspeech_python_build "${package_option}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
do_deepspeech_nodejs_build "${cuda}"
|
do_deepspeech_nodejs_build "${package_option}"
|
||||||
|
|
||||||
do_deepspeech_netframework_build
|
do_deepspeech_netframework_build
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue