Skip to content

Commit

Permalink
Merge branch 'main' into experimental/cmsis-nn-min-max
Browse files Browse the repository at this point in the history
  • Loading branch information
suleshahid authored Feb 5, 2025
2 parents 81d16ea + 9b79b9f commit b79cb43
Show file tree
Hide file tree
Showing 179 changed files with 12,402 additions and 2,074 deletions.
25 changes: 22 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,22 @@ build --cxxopt -std=c++17
# Treat warnings as errors
build --copt -Werror

# Common options for --config=ci
build:ci --action_env=CC=clang
build:ci --action_env=CXX=clang++
build:ci --curses=no
build:ci --color=no
build:ci --noshow_progress
build:ci --noshow_loading_progress
build:ci --show_timestamps
build:ci --terminal_columns=0
build:ci --verbose_failures
build:ci --test_output=errors

# When building with the address sanitizer
# E.g., bazel build --config asan
build:asan --repo_env CC=clang
build:asan --action_env=CC=clang
build:asan --action_env=CXX=clang++
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
Expand All @@ -46,7 +59,8 @@ build:asan --linkopt -fsanitize=address

# When building with the memory sanitizer
# E.g., bazel build --config msan
build:msan --repo_env CC=clang
build:msan --action_env=CC=clang
build:msan --action_env=CXX=clang++
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DADDRESS_SANITIZER
Expand All @@ -57,11 +71,16 @@ build:msan --linkopt -fsanitize=memory

# When building with the undefined behavior sanitizer
# E.g., bazel build --config ubsan
build:ubsan --repo_env CC=clang
build:ubsan --action_env=CC=clang
build:ubsan --action_env=CXX=clang++
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -g
build:ubsan --copt -O3
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -lubsan

# Hooks for defining local configuration
try-import ../bazelrc.local
try-import bazelrc.local
104 changes: 101 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel.sh
bazel_tests_tflite_tools:
bazel_tests_with_compression:
runs-on: ubuntu-latest

name: Bazel TFLite Tools (presubmit)
name: Bazel with Compression (presubmit)
steps:
- uses: actions/setup-python@v4
with:
Expand All @@ -58,7 +58,7 @@ jobs:
pip3 install numpy
- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel_tflite_tools.sh
tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression.sh
bazel_msan:
runs-on: ubuntu-latest
Expand All @@ -85,6 +85,31 @@ jobs:
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel_msan.sh
bazel_with_compression_msan:
runs-on: ubuntu-latest

name: Bazel with Compression [msan] (presubmit)
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}
- name: Install dependencies
run: |
sudo ci/install_bazelisk.sh
pip3 install Pillow
pip3 install numpy
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression_msan.sh
bazel_asan:
runs-on: ubuntu-latest

Expand All @@ -110,6 +135,58 @@ jobs:
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel_asan.sh
bazel_with_compression_asan:
runs-on: ubuntu-latest

name: Bazel with Compression [asan] (presubmit)
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}
- name: Install dependencies
run: |
sudo ci/install_bazelisk.sh
pip3 install Pillow
pip3 install numpy
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression_asan.sh
# TODO(b/178621680): enable ubsan once bazel + clang + ubsan errors are fixed.
# bazel_ubsan:
# runs-on: ubuntu-latest
#
# name: Bazel ubsan (presubmit)
# steps:
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - uses: actions/checkout@v3
# with:
# ref: ${{ inputs.trigger-sha }}
# - name: Install dependencies
# run: |
# sudo ci/install_bazelisk.sh
# pip3 install Pillow
# pip3 install numpy
# - name: Fix kernel mmap rnd bits
# # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# # high-entropy ASLR in much newer kernels that GitHub runners are
# # using leading to random crashes: https://reviews.llvm.org/D148280
# run: sudo sysctl vm.mmap_rnd_bits=28
# - name: Test
# run: |
# tensorflow/lite/micro/tools/ci_build/test_bazel_ubsan.sh

cortex_m_bluepill_release:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -264,6 +341,27 @@ jobs:
cd ../
tflite-micro/tensorflow/lite/micro/tools/ci_build/test_x86_default.sh tflite-micro/
x86_default_with_compression:
runs-on: ubuntu-latest

name: Makefile x86 with Compression (presubmit)
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}
- name: Install dependencies
run: |
pip3 install Pillow
pip3 install numpy
- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_makefile.sh
cd ../
tflite-micro/tensorflow/lite/micro/tools/ci_build/test_x86_default_with_compression.sh tflite-micro/
x86_out_of_tree:
runs-on: ubuntu-latest

Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/cortex_m.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ name: Cortex-M

# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
on:
schedule:
- cron: '0 4 * * *'

# Allow manually triggering of the workflow.
workflow_dispatch: {}
Expand Down Expand Up @@ -44,7 +42,11 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v2

- uses: actions/checkout@v4
with:
ref: ${{ inputs.trigger-sha }}

- name: Install dependencies
run: |
pip3 install Pillow
Expand All @@ -68,7 +70,11 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v2

- uses: actions/checkout@v4
with:
ref: ${{ inputs.trigger-sha }}

- name: Install dependencies
run: |
pip3 install Pillow
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/cortex_m_arm_compiler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Cortex-M / Arm Compiler 6
on:

# Allow manually triggering of the workflow.
workflow_dispatch: {}

pull_request_target:
types:
- closed
- labeled

workflow_call:
inputs:
trigger-sha:
required: true
type: string
secrets:
tflm-bot-token:
required: true

jobs:
cortex_m_generic:
runs-on: ubuntu-latest

if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' &&
github.repository == 'tensorflow/tflite-micro') ||
(github.event.action == 'labeled' &&
github.event.label.name == 'ci:run_full')
name: Cortex-M Generic
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.trigger-sha }}

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
pip3 install Pillow
pip3 install numpy
- name: Install Arm tools
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: "tensorflow/lite/micro/tools/github/arm/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1

- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_cortex_m_generic.sh armclang
cortex_m_corstone_300:
runs-on: ubuntu-latest

if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' &&
github.repository == 'tensorflow/tflite-micro') ||
(github.event.action == 'labeled' &&
github.event.label.name == 'ci:run_full')
name: Cortex-M Corstone 300 (FVP)
steps:

- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.trigger-sha }}

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
pip3 install Pillow
pip3 install numpy
- name: Install Arm tools
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: "tensorflow/lite/micro/tools/github/arm/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1

- name: Test
run: |
tensorflow/lite/micro/tools/ci_build/test_cortex_m_corstone_300.sh armclang
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: |
tensorflow/
gen/
issue-on-error:
needs: [cortex_m_generic, cortex_m_corstone_300]
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: ./.github/workflows/issue_on_error.yml
with:
repo: ${{ github.repository }}
workflow: ${{ github.workflow }}
run_id: ${{ github.run_id }}
run_number: ${{ github.run_number }}
flag_label: ci:bot_issue
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

Loading

0 comments on commit b79cb43

Please sign in to comment.