Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/build_intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# This is a basic workflow to help you get started with Actions

name: Bitbake intel

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
branches: [ walnascar ]
pull_request:
branches: [ walnascar ]
schedule:
- cron: '0 12 * * 5'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
TARGET_VERSION: walnascar
TARGET_INTEL_VERSION: walnascar
WORKING_DIR: /home/runner/work
BUILD_DIR: /mnt/build
DOWNLOAD_DIR: /mnt/build/downloads
SSTATE_DIR: /mnt/build/sstate-cache

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
bitbake-intel:

strategy:
matrix:
target_machine: [genericx86-64, intel-corei7-64, intel-skylake-64]
tensorflow_version: [2.19.0]
fail-fast: false

# The type of runner that the job will run on
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Install essential host packages
- name: Install Packages
run: |
sudo apt-get update
sudo apt-get -y install gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file \
locales libacl1
sudo apt-get clean
sudo apt-get autoclean -y
sudo locale-gen en_US.UTF-8

- name: Prepare build directory
run: |
sudo mkdir -p ${BUILD_DIR}
sudo chown runner ${BUILD_DIR}
- name: Restore cache
id: ccache-restore
uses: actions/cache/restore@v4
with:
path: |
${{ env.DOWNLOAD_DIR }}
${{ env.SSTATE_DIR }}
key: cache-${{ matrix.target_machine }}-${{ env.TARGET_VERSION }}

# checkout repository
- name: Clone poky, meta-intel, meta-openembedded
run: |
sudo chown runner /mnt
git clone --depth 1 -b ${TARGET_VERSION} git://git.yoctoproject.org/poky.git
git clone --depth 1 -b ${TARGET_INTEL_VERSION} https://git.yoctoproject.org/meta-intel.git
git clone --depth 1 -b ${TARGET_VERSION} git://git.openembedded.org/meta-openembedded
working-directory: /home/runner/work

# Run bitbake
- name: Bitbake MACHINE=${{ matrix.target_machine }}, TensorFlow-Lite version ${{ matrix.tensorflow_version }}
run: |
source ${WORKING_DIR}/poky/oe-init-build-env ${BUILD_DIR}
bitbake-layers add-layer ${WORKING_DIR}/meta-openembedded/meta-oe/
bitbake-layers add-layer ${WORKING_DIR}/meta-openembedded/meta-python/
bitbake-layers add-layer ${WORKING_DIR}/meta-tensorflow-lite/meta-tensorflow-lite/
bitbake-layers add-layer ${WORKING_DIR}/meta-intel/
cat <<EOF> conf/auto.conf
BB_NUMBER_THREADS = "8"
EOF
cat conf/auto.conf
MACHINE=${{matrix.target_machine}} bitbake python3-tensorflow-lite libtensorflow-lite \
libtensorflow-lite-c python3-tensorflow-lite-example tensorflow-lite-label-image \
tensorflow-lite-minimal tensorflow-lite-benchmark libedgetpu-std
df -h
working-directory: /mnt

# Remove all files that hasn't been access in 10 days
- name: Clean SState Cache
run: |
find ${SSTATE_DIR} -type f -mtime +10 -delete
- name: Save cache
uses: actions/cache/save@v4
if: always()
with:
path: |
${{ env.DOWNLOAD_DIR }}
${{ env.SSTATE_DIR }}
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Please note that it is not official support.
| :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------- |
| [meta-raspberrypi](https://github.com/agherzan/meta-raspberrypi) | [![Bitbake raspberrypi](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_rpi.yml/badge.svg?branch=walnascar)](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_rpi.yml) |
| [meta-riscv](https://github.com/riscv/meta-riscv) | [![Bitbake qemuriscv](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_riscv.yml/badge.svg?branch=walnascar)](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_riscv.yml) |
| [meta-intel](https://git.yoctoproject.org/meta-intel) | [![Bitbake intel](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_intel.yml/badge.svg?branch=walnascar)](https://github.com/NobuoTsukamoto/meta-tensorflow-lite/actions/workflows/build_intel.yml) |

## Available recipes
- framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ EXTRA_OECMAKE:append:arm = " -DTFLITE_ENABLE_RUY=ON"
EXTRA_OECMAKE:append:aarch64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv32 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:x86-64 = " -DTFLITE_ENABLE_XNNPACK=ON"

TENSORFLOW_TARGET_ARCH = "${TARGET_ARCH}"
TENSORFLOW_TARGET_ARCH:raspberrypi = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0 = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0-wifi = "armv6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ EXTRA_OECMAKE:append:arm = " -DTFLITE_ENABLE_RUY=ON"
EXTRA_OECMAKE:append:aarch64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv32 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:x86-64 = " -DTFLITE_ENABLE_XNNPACK=ON"

TENSORFLOW_TARGET_ARCH = "${TARGET_ARCH}"
TENSORFLOW_TARGET_ARCH:raspberrypi = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0 = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0-wifi = "armv6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ DEPENDS += "\
python3-pybind11 \
protobuf-native \
flatbuffers-native \
patchelf-native \
"

RDEPENDS:${PN} += " \
Expand Down Expand Up @@ -62,7 +63,9 @@ EXTRA_OECMAKE:append:arm = " -DTFLITE_ENABLE_RUY=ON"
EXTRA_OECMAKE:append:aarch64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv32 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:x86-64 = " -DTFLITE_ENABLE_XNNPACK=ON"

TENSORFLOW_TARGET_ARCH = "${TARGET_ARCH}"
TENSORFLOW_TARGET_ARCH:raspberrypi = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0 = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0-wifi = "armv6"
Expand Down Expand Up @@ -158,6 +161,8 @@ do_install() {
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} -m pip install --disable-pip-version-check -v \
-t ${D}/${PYTHON_SITEPACKAGES_DIR} --no-cache-dir --no-deps \
${S}/tensorflow/lite/tools/pip_package/gen/tflite_pip/python3/dist/tflite_runtime-${DPV}*.whl

patchelf --clear-execstack ${D}${PYTHON_SITEPACKAGES_DIR}/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
}

FILES:${PN}-dev = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ EXTRA_OECMAKE:append:arm = " -DTFLITE_ENABLE_RUY=ON"
EXTRA_OECMAKE:append:aarch64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv32 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:riscv64 = " -DTFLITE_ENABLE_XNNPACK=ON"
EXTRA_OECMAKE:append:x86-64 = " -DTFLITE_ENABLE_XNNPACK=ON"

TENSORFLOW_TARGET_ARCH = "${TARGET_ARCH}"
TENSORFLOW_TARGET_ARCH:raspberrypi = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0 = "armv6"
TENSORFLOW_TARGET_ARCH:raspberrypi0-wifi = "armv6"
Expand Down
Loading