Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gh CI workflows #66

Merged
merged 1 commit into from
Nov 15, 2024
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
20 changes: 20 additions & 0 deletions .github/on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: On PR

on:
workflow_dispatch:
pull_request:
branches: [ "main" ]

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit

spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit

build-and-test:
needs: [pre-commit, spdx]
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
30 changes: 16 additions & 14 deletions .github/workflows/nightly-uplift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,39 @@ name: Nighty Uplift

on:
schedule:
- cron: '0 8 * * *' # Runs at 08:00 UTC every day
- cron: '0 6 * * *' # Runs at 06:00 UTC every day
workflow_dispatch: # Manual trigger

jobs:
uplift-pr:
runs-on: ubuntu-latest

env:
SUBMODULE_PATH: third_party/tt-mlir
MLIR_VERSION: origin/main
TT_MLIR_SUBMODULE_PATH: third_party/tt-mlir

steps:

- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch all history and tags
fetch-depth: 0
ref: main

- name: Set env variable
- name: Set env variable for today's date
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Update tt-mlir reference
- name: Fetch latest SHA of tt-mlir submodule
id: get_sha
run: |
LATEST_TT_MLIR_VERSION=$(gh api repos/tenstorrent/tt-mlir/commits/main --jq '.sha')
echo "LATEST_TT_MLIR_VERSION=$LATEST_TT_MLIR_VERSION" >> $GITHUB_ENV

- name: Update tt-mlir reference in third_party/CMakeLists.txt
env:
GH_TOKEN: ${{ github.token }}
run: |
# Fetch the latest SHA using GitHub CLI
LATEST_SHA=$(gh api repos/tenstorrent/tt-mlir/commits/main --jq '.sha')
# Update the CMakeLists.txt file with the new SHA
sed -i "s/set(TT_MLIR_VERSION \".*\")/set(TT_MLIR_VERSION \"${LATEST_SHA}\")/" third_party/CMakeLists.txt
echo "Updating tt-mlir to SHA: $LATEST_TT_MLIR_VERSION"
sed -i "s/set(TT_MLIR_VERSION \".*\")/set(TT_MLIR_VERSION \"${LATEST_TT_MLIR_VERSION}\")/" third_party/CMakeLists.txt

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
Expand All @@ -45,9 +47,9 @@ jobs:
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
base: main
commit-message: "Uplift ${{ env.SUBMODULE_PATH }} to ${{ env.SUBMODULE_VERSION }} ${{ env.TODAY }}"
title: "Uplift ${{ env.SUBMODULE_PATH }} to ${{ env.SUBMODULE_VERSION }} ${{ env.TODAY }}"
body: "This PR uplifts the ${{ env.SUBMODULE_PATH }} to the ${{ env.SUBMODULE_VERSION }}"
commit-message: "Uplift ${{ env.TT_MLIR_SUBMODULE_PATH }} to ${{ env.LATEST_TT_MLIR_VERSION }} ${{ env.TODAY }}"
title: "Uplift ${{ env.TT_MLIR_SUBMODULE_PATH }} to ${{ env.LATEST_TT_MLIR_VERSION }} ${{ env.TODAY }}"
body: "This PR uplifts the ${{ env.TT_MLIR_SUBMODULE_PATH }} to the ${{ env.LATEST_TT_MLIR_VERSION }}"
labels: uplift
delete-branch: true
token: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ on:
branches: [ "main" ]

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit
spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit
build-and-test:
needs: [pre-commit, spdx]
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: On push

on:
workflow_dispatch:
push:
branches: [ "main" ]

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit

spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit

build-and-test:
needs: [pre-commit, spdx]
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pre-commit

on:
workflow_dispatch:
workflow_call:

jobs:
pre-commit:

timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Run pre-commit
uses: pre-commit/[email protected]
2 changes: 0 additions & 2 deletions tests/TTIR/test_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
(1, 256, 64, 56, 56, 1, 1, 2, 2, 0),
),
)

@pytest.mark.skip("AssertionError.")
def test_conv2d(
batch_size,
Expand All @@ -55,7 +54,6 @@ def test_conv2d(
stride_w,
padding,
):

def module_conv(img, weights):
return jax.lax.conv_general_dilated(
img,
Expand Down
Loading