Skip to content

Commit

Permalink
#104: Add ttrt functional and performance tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tapspatel committed Aug 7, 2024
1 parent 47a7453 commit c37568c
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/ttrt-flatbuffer-ttnn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: TTRT Flatbuffer TTNN Tests

on:
workflow_dispatch:
workflow_call:
schedule:
- cron: "0 */2 * * *" # This cron schedule runs the workflow every 2 hours
push:
branches: [ "tpatel/issue-104" ]

jobs:
build:
strategy:
fail-fast: false
matrix:
build: [
{name: "TTRT TTNN n150 runtime tests", runs-on: n150, c_compiler: clang, cpp_compiler: clang++, build_type: Release, enable_runtime: ON, enable_perf: OFF},
{name: "TTRT TTNN n150 perf tests", runs-on: n150, c_compiler: clang, cpp_compiler: clang++, build_type: Release, enable_runtime: ON, enable_perf: ON},
{name: "TTRT TTNN n300 runtime tests", runs-on: n300, c_compiler: clang, cpp_compiler: clang++, build_type: Release, enable_runtime: ON, enable_perf: OFF},
{name: "TTRT TTNN n300 perf tests", runs-on: n300, c_compiler: clang, cpp_compiler: clang++, build_type: Release, enable_runtime: ON, enable_perf: ON},
]
name: ${{ matrix.build.name }}
runs-on: ${{ matrix.build.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history and tags

- name: Install build dependencies
uses: ./.github/actions/install-deps
with:
os: ${{ matrix.build.runs-on }}

- name: Build and cache ttmlir-toolchain
uses: ./.github/actions/build-toolchain
with:
os: ${{ matrix.build.runs-on }}
sdk: ${{ env.SDK_VERSION }}

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
shell: bash
run: |
source env/activate
cmake -G Ninja \
-B ${{ steps.strings.outputs.build-output-dir }} \
-DCMAKE_CXX_COMPILER=${{ matrix.build.cpp_compiler }} \
-DCMAKE_C_COMPILER=${{ matrix.build.c_compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build.build_type }} \
-DTTMLIR_ENABLE_RUNTIME=${{ matrix.build.enable_runtime }} \
-DTTMLIR_ENABLE_RUNTIME_TESTS=${{ matrix.build.enable_runtime }} \
-DTT_RUNTIME_ENABLE_PERF_TRACE=${{ matrix.build.enable_perf }} \
-S ${{ github.workspace }}
- name: Set perf env variables
if: ${{ matrix.build.enable_perf }} == 'ON'
shell: bash
run: |
export ENABLE_TRACY=1
- name: Build
shell: bash
run: |
source env/activate
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }}
- name: Run Test
shell: bash
run: |
source env/activate
export SYSTEM_DESC_PATH=${{ github.workspace }}/test/system_desc/${{ matrix.build.runs-on }}.ttsys
llvm-lit -v ${{ github.workspace }}/build/test/ttmlir/Silicon
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }} -- check-ttmlir
- name: Build ttrt
shell: bash
run: |
source env/activate
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build.build_type }} -- ttrt
pip install torch
pip install loguru
pip install pandas
pip install seaborn
- name: Run ttrt functional tests
if: ${{ matrix.build.enable_perf }} == 'OFF'
shell: bash
run: |
source env/activate
ttrt run ${{ steps.strings.outputs.build-output-dir }}/test/ttmlir/Silicon
- name: Run ttrt performance tests
if: ${{ matrix.build.enable_perf }} == 'ON'
shell: bash
run: |
source env/activate
ttrt perf ${{ steps.strings.outputs.build-output-dir }}/test/ttmlir/Silicon
Binary file added test/system_desc/n150.ttsys
Binary file not shown.
43 changes: 43 additions & 0 deletions test/system_desc/n300.ttsys
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": {
"major": 0,
"minor": 0,
"patch": 49
},
"ttmlir_git_hash": "47a54b1c4e19cdc39bdd6ab6468d9b63ce11f5cd",
"product_identifier": "unknown",
"system_desc": {
"chip_descs": [
{
"arch": "Wormhole_b0",
"grid_size": {
"y": 8,
"x": 8
},
"l1_size": 1048576,
"num_dram_channels": 12,
"dram_channel_size": 1048576,
"noc_l1_address_align_bytes": 16,
"pcie_address_align_bytes": 32,
"noc_dram_address_align_bytes": 32
}
],
"chip_desc_indices": [
0
],
"chip_capabilities": [
3
],
"chip_coords": [
{
"rack": 0,
"shelf": 0,
"y": 0,
"x": 0
}
],
"chip_channels": [

]
}
}

0 comments on commit c37568c

Please sign in to comment.