Skip to content

Commit

Permalink
Merge branch 'develop' into shorten-xf-options
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpoluektov authored Aug 31, 2023
2 parents 7059dd5 + 13ef589 commit d29b4a2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/build_linux_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ git config --global --add safe.directory /ai_tools/third_party/lib_tflite_micro/
git describe --tags

CC=/dt9/usr/bin/gcc CXX=/dt9/usr/bin/g++ make -C third_party/lib_tflite_micro patch
CC=/dt9/usr/bin/gcc CXX=/dt9/usr/bin/g++ ./build.sh -T xinterpreter -b
CC=/dt9/usr/bin/gcc CXX=/dt9/usr/bin/g++ ./build.sh -T xinterpreter-nozip -b


# Build xcore-opt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
make patch
cd $GITHUB_WORKSPACE
./build.sh -T xinterpreter -b
./build.sh -T xinterpreter-nozip -b
cd $GITHUB_WORKSPACE/xformer
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
make patch
cd $GITHUB_WORKSPACE
./build.sh -T xinterpreter -b
./build.sh -T xinterpreter-nozip -b
cd $GITHUB_WORKSPACE/xformer
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
make patch
cd $GITHUB_WORKSPACE
./build.sh -T xinterpreter -b
./build.sh -T xinterpreter-nozip -b
cd $GITHUB_WORKSPACE/xformer
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
make patch
cd $GITHUB_WORKSPACE
./build.sh -T xinterpreter -b
./build.sh -T xinterpreter-nozip -b
cd $GITHUB_WORKSPACE/xformer
if [[ -n $GOOGLE_APPLICATION_CREDENTIALS ]]; then
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pipeline {
sh "make patch"
}
// build dll_interpreter for python interface
sh "./build.sh -T xinterpreter -b"
sh "./build.sh -T xinterpreter-nozip -b"
// build xformer
dir("xformer") {
sh "wget https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
Expand Down
46 changes: 34 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

set -e
OS=$(uname)

if [ "$OS" = "Linux" ]; then
Expand Down Expand Up @@ -27,17 +30,17 @@ fi

help() {
echo "Usage: $(basename "$0") [ACTIONS]..."
echo " -b, --build Build (default)"
echo " -c, --clean Clean build"
echo " -t, --test Test build"
echo " -d, --debug Enable debug"
echo " -j, --jobs [N] Set number of jobs (default: nproc)"
echo " -T, --target [T] Set target:"
echo " init Initialise repository (update submodules and patch ltflm)"
echo " all Build everything"
echo " xinterpreter Build interpreter only"
echo " xformer Build compiler only"
echo " -h, --help Show this help message"
echo " -b Build (default)"
echo " -c Clean build"
echo " -t Test build"
echo " -d Enable debug"
echo " -j [NUM_PROCS] Set number of jobs (default: nproc)"
echo " -T [TARGET] Set target:"
echo " init Initialise repository (update submodules and patch ltflm)"
echo " all Build everything"
echo " xinterpreter Build interpreter only"
echo " xformer Build compiler only"
echo " -h Show this help message"
exit 1
}

Expand Down Expand Up @@ -111,7 +114,7 @@ unsupported_action() {
exit 1
}

build_xinterpreter() {
create_zip() {
cd third_party/lib_tflite_micro
mkdir -p build
cd build
Expand All @@ -124,6 +127,10 @@ build_xinterpreter() {
unzip release_archive.zip
rm release_archive.zip
cd $SCRIPT_DIR
}

build_xinterpreter() {
cd $SCRIPT_DIR
if [ "$LSP" = "true" ] ; then
bear make -C python/xmos_ai_tools/xinterpreters/host install -j$NUM_PROCS
else
Expand Down Expand Up @@ -167,6 +174,7 @@ case $TARGET in
case $ACTION in
--build)
version_check
create_zip
build_xinterpreter
;;
--clean)
Expand All @@ -180,10 +188,24 @@ case $TARGET in
;;
esac
;;
# this is a mess: xinterpreter-nozip only used for CI
xinterpreter-nozip)
case $ACTION in
--build)
version_check
build_xinterpreter
;;
*)
unsupported_action
;;
esac
;;
all)
case $ACTION in
--build)
version_check
build_xformer
create_zip
build_xinterpreter
;;
--clean)
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def finalize_options(self):
# add device lib and headers as package data
device_files = {
root.replace(os.sep, "."): ["*.h", "*.a", "*.make", "*.cmake"]
for root, d, f in os.walk(os.path.join("xmos_ai_tools", "xinterpreters", "device"))
for root, d, f in os.walk(os.path.join("xmos_ai_tools", "runtime"))
}

# add host interpreter lib
Expand Down
Empty file.

0 comments on commit d29b4a2

Please sign in to comment.