Skip to content

Commit

Permalink
misc: Update workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
iabdalkader committed Jul 25, 2024
1 parent 3d397e9 commit 1501f8b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tflm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
id: cache
with:
path: ~/cache/gcc
key: 'arm-gnu-toolchain-13.2.rel1'
key: 'arm-gnu-toolchain-13.2.rel0'

- name: '🛠 Install toolchain '
if: steps.cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
if-no-files-found: error

push-artifacts:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [build-tflm]
if: github.event_name == 'push'
permissions:
Expand Down
26 changes: 19 additions & 7 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@
TFLM_REPO_PATH=tflite-micro
TOOLCHAIN_PATH=${HOME}/cache/gcc
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
MAKE_URL="https://ftp.gnu.org/gnu/make/make-4.4.tar.gz"
TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz"

ci_install_arm_gcc() {
MAKE_PATH=make-build
mkdir -p ${TOOLCHAIN_PATH}
wget --no-check-certificate -O - ${TOOLCHAIN_URL} | tar --strip-components=1 -Jx -C ${TOOLCHAIN_PATH}
wget --no-check-certificate -O - ${MAKE_URL} | tar --strip-components=1 -xz -C ${MAKE_PATH}

pushd ${MAKE_PATH}
./configure --prefix=${TOOLCHAIN_PATH}
make -j$(nproc)
make install
popd

# extract and build make then copy to ${TOOLCHAIN_PATH}
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
arm-none-eabi-gcc --version
make --version
}

# Update Submodules.
Expand All @@ -38,14 +50,14 @@ ci_build_target() {

ETHOSU_CONFIG="-DNPU_QCONFIG=0 -DNPU_REGIONCFG_0=0 -DAXI_LIMIT0_MAX_BEATS_BYTES=1 -DAXI_LIMIT0_MEM_TYPE=2 -DAXI_LIMIT1_MAX_BEATS_BYTES=1 -DAXI_LIMIT1_MEM_TYPE=2 -DAXI_LIMIT2_MAX_BEATS_BYTES=1 -DAXI_LIMIT2_MEM_TYPE=2 -DAXI_LIMIT3_MAX_BEATS_BYTES=1 -DAXI_LIMIT3_MEM_TYPE=2"

echo "make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \
${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \
KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \
TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \
ETHOSU_EXTRA_FLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite"

pushd ${TFLM_REPO_PATH}
echo "make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \
${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \
KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \
TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \
ETHOSU_EXTRA_FLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite"

make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \
${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \
Expand Down

0 comments on commit 1501f8b

Please sign in to comment.