Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Haoliang Zhang <[email protected]>
Co-authored-by: Vamsi Krishna Manchala <[email protected]>
Co-authored-by: wrighkv1 <[email protected]>
Co-authored-by: Advait Jain <[email protected]>
Co-authored-by: Majid Dadashi <[email protected]>
Co-authored-by: T.J. Alumbaugh <[email protected]>
Co-authored-by: hheydary <[email protected]>
Co-authored-by: Pauline Sho <[email protected]>
Co-authored-by: marialyu <[email protected]>
Co-authored-by: Eric Yang <[email protected]>
Co-authored-by: Jun Jiang <[email protected]>
Co-authored-by: Matthew Soulanille <[email protected]>
Co-authored-by: Pulkit Bhuwalka <[email protected]>
Co-authored-by: Yasir Modak <[email protected]>
Co-authored-by: Arian Arfaian <[email protected]>
Co-authored-by: Kristen Wright <[email protected]>
Co-authored-by: qihqi <[email protected]>
Co-authored-by: suleshahid <[email protected]>
Co-authored-by: yishuangP <[email protected]>
Co-authored-by: zeekco <[email protected]>
  • Loading branch information
20 people committed May 13, 2024
0 parents commit 8533016
Show file tree
Hide file tree
Showing 208 changed files with 55,570 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Tensorflow needs remote repo
common --experimental_repo_remote_exec

# Basic build settings
build --jobs 128
build --enable_platform_specific_config

build --define xnnpack_use_latest_ops=true

# Linux
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:linux --copt=-w

# Android configs.
build:android --crosstool_top=//external:android/crosstool
build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build:android --copt=-DABSL_FLAGS_STRIP_NAMES=0
build:android --linkopt=-landroid
build:android --linkopt=-ldl
build:android --linkopt=-llog
build:android --linkopt=-lm
build:android --linkopt=-Wl,--gc-sections
# TODO: Remove this flag once we updated to NDK 25
build:android --define=xnn_enable_arm_i8mm=false

build:android_arm --config=android
build:android_arm --cpu=armeabi-v7a
build:android_arm --fat_apk_cpu=armeabi-v7a
build:android_arm --platforms=//build_config:android_arm

build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a
build:android_arm64 --fat_apk_cpu=arm64-v8a
build:android_arm64 --platforms=//build_config:android_arm64
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Bug report
description: Use this template to report bugs
labels: ["type:bug", "component:converter", "component:quantization"]
body:
- type: textarea
id: description
attributes:
label: >
Description of the bug:
- type: textarea
id: behavior
attributes:
label: >
Actual vs expected behavior:
- type: textarea
id: info
attributes:
label: >
Any other information you'd like to share?
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Feature request
description: Use this template to report feature requests
labels: ["type:feature request", "component:converter", "component:quantization"]
body:
- type: textarea
id: description
attributes:
label: >
Description of the bug:
- type: textarea
id: behavior
attributes:
label: >
Actual vs expected behavior:
- type: textarea
id: info
attributes:
label: >
Any other information you'd like to share?
35 changes: 35 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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/
#
# This workflow will run nightly or when triggered from PR comment

name: Formatting

on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string

jobs:
check-code-style:
runs-on: ubuntu-latest

name: Code Style
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}
- name: Install dependencies
run: |
pip3 install pyink isort
- name: Check code style
run: |
ci/test_code_style.sh
58 changes: 58 additions & 0 deletions .github/workflows/generative_api_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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/
#
# This workflow will run nightly or when triggered from PR comment

name: Generative API Examples

on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string

jobs:
check-examples:
runs-on:
labels: Linux_runner_8_core

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: false
# Share repository cache between workflows.
repository-cache: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r21e
add-to-path: false
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- uses: android-actions/setup-android@v3
- run: |
sdkmanager "build-tools;30.0.3" "platform-tools"
sdkmanager "platforms;android-30" "extras;android;m2repository"
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}
- name: Install python dependencies
run: |
pip3 install numpy
- name: Build
run: |
ci/test_examples_build.sh
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
48 changes: 48 additions & 0 deletions .github/workflows/mark_stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
# Scheduled to run at 1.30 UTC everyday
- cron: '30 1 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
actions: write

steps:
- uses: actions/stale@v9
with:
days-before-issue-stale: 7
days-before-issue-close: 7
stale-issue-label: "status:stale"
close-issue-reason: completed
any-of-labels: "status:awaiting user response,status:more data needed"
stale-issue-message: >
Marking this issue as stale since it has been open for 7 days with no activity.
This issue will be closed if no further activity occurs.
close-issue-message: >
This issue was closed because it has been inactive for 14 days.
Please post a new issue if you need further assistance. Thanks!
days-before-pr-stale: 14
days-before-pr-close: 14
stale-pr-label: "status:stale"
stale-pr-message: >
Marking this pull request as stale since it has been open for 14 days with no activity.
This PR will be closed if no further activity occurs.
close-pr-message: >
This pull request was closed because it has been inactive for 28 days.
Please open a new pull request if you need further assistance. Thanks!
# Label that can be assigned to issues to exclude them from being marked as stale
exempt-issue-labels: 'override-stale'
# Label that can be assigned to PRs to exclude them from being marked as stale
exempt-pr-labels: "override-stale"
57 changes: 57 additions & 0 deletions .github/workflows/model_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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/
#
# This workflow will run nightly or when triggered from PR comment

name: Model Coverage

on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string

jobs:
test-model-coverage:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on:
labels: Linux_runner_8_core
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}

- name: Checkout benchmark repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.PYTORCH_BENCHMARK_REPO }}
path: ${{ github.workspace }}/benchmark
token: ${{ secrets.PYTORCH_BENCHMARK_REPO_READER }}

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/*requirements.txt"

- run: python -m pip install --upgrade pip setuptools

- name: Setup benchmark repository
run: |
bash ${{ github.workspace }}/benchmark/ci_ai_edge_torch/ci_setup.sh
- name: Install ai-edge-torch
run: |
python -m pip install -r dev-requirements.txt --force-reinstall
python -m pip install . --no-cache-dir
- name: Run tests
run: |
cd ${{ github.workspace }}/benchmark
python -m pytest ci_ai_edge_torch -n 4
18 changes: 18 additions & 0 deletions .github/workflows/nightly_generative_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Generative API (nightly)

on:
schedule:
# 10 am UTC is 3am or 4am PT depending on daylight savings.
- cron: '0 10 * * *'

workflow_dispatch: {}

jobs:
run-generative-api-examples:
name: Generative API Examples
uses: ./.github/workflows/generative_api_examples.yml
with:
trigger-sha: ${{ github.sha }}
19 changes: 19 additions & 0 deletions .github/workflows/nightly_model_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Model Coverage (nightly)

on:
schedule:
# 10 am UTC is 3am or 4am PT depending on daylight savings.
- cron: '0 10 * * *'

workflow_dispatch: {}

jobs:
run-model-coverage:
name: Model Coverage (nightly)
uses: ./.github/workflows/model_coverage.yml
secrets: inherit
with:
trigger-sha: ${{ github.sha }}
32 changes: 32 additions & 0 deletions .github/workflows/nightly_pip_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: pip Install Test (nightly)

on:
schedule:
# 10 am UTC is 3am or 4am PT depending on daylight savings.
- cron: '0 10 * * *'

workflow_dispatch: {}

jobs:
run-pip-install:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r https://raw.githubusercontent.com/google-ai-edge/ai-edge-torch/main/requirements.txt
- name: Install ai-edge-torch
run: |
pip install ai-edge-torch
- name: Import ai-edge-torch
run: |
python -c "import ai_edge_torch"
18 changes: 18 additions & 0 deletions .github/workflows/nightly_unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Unit Tests (nightly)

on:
schedule:
# 10 am UTC is 3am or 4am PT depending on daylight savings.
- cron: '0 10 * * *'

workflow_dispatch: {}

jobs:
run-unittests-python:
name: Unit Tests Python
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.sha }}
18 changes: 18 additions & 0 deletions .github/workflows/run_post_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Run Post Merge

on:
push:
branches:
- 'main'
- 'releases/**'

jobs:
run-model-coverage:
name: Model Coverage
uses: ./.github/workflows/model_coverage.yml
secrets: inherit
with:
trigger-sha: ${{ github.event.after }}
Loading

0 comments on commit 8533016

Please sign in to comment.