Skip to content

Commit

Permalink
Merge branch 'main' into brosko/soc_new_api4
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoTT committed Feb 26, 2025
2 parents 3d4ac91 + e0585b2 commit f548105
Show file tree
Hide file tree
Showing 1,132 changed files with 44,862 additions and 22,404 deletions.
17 changes: 17 additions & 0 deletions .github/actions/generate-gtest-failure-message/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Generate gtest failure message"
description: "Generate gtest failure message for Github workflow annotations"

inputs:
path:
description: "Paths to pass containing gtest XML files"
required: true

runs:
using: "composite"
steps:
- name: Generate gtest failure messages
id: generate-gtest-message
shell: bash
run: |
set +e
python3 .github/scripts/data_analysis/print_gtest_annotations.py ${{ inputs.path }}
69 changes: 69 additions & 0 deletions .github/scripts/data_analysis/print_gtest_annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import argparse
import xml.etree.ElementTree as ET
import glob
import os
from typing import Union


def _build_workflow_command(
command_name: str,
file: str,
line: int,
end_line: Union[int, None] = None,
column: Union[int, None] = None,
end_column: Union[int, None] = None,
title: Union[str, None] = None,
message: Union[str, None] = None,
):
result = f"::{command_name} "

entries = [
("file", file),
("line", line),
("endLine", end_line),
("col", column),
("endColumn", end_column),
("title", title),
]

result = result + ",".join(f"{k}={v}" for k, v in entries if v is not None)

if message is not None:
result = result + "::" + _escape(message)

return result


def _escape(s: str) -> str:
return s.replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A")


if __name__ == "__main__":
# Get xml dir path from cmdline
parser = argparse.ArgumentParser()
parser.add_argument("directory", type=str, help="Path to the GoogleTest XML directory")
args = parser.parse_args()

# Path to the directory containing XML files
xml_dir = args.directory

# Use glob to find all XML files in the directory
xml_files = glob.glob(os.path.join(xml_dir, "*.xml"))

# Iterate through each XML file
for xml_file in xml_files:
tree = ET.parse(xml_file)
root = tree.getroot()
for testsuite in root.findall("testsuite"):
for testcase in testsuite.findall("testcase"):
failure = testcase.find("failure")
# If failure exists, print the failure message
if failure is not None:
failure_message = failure.attrib.get("message")
msg = _build_workflow_command(
command_name="error",
file=testcase.attrib.get("file", "").lstrip("/work/"),
line=int(testcase.attrib["line"]),
message=failure_message,
)
print(msg)
1 change: 1 addition & 0 deletions .github/workflows/_produce-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ on:
- "Blackhole post-commit tests"
- "Custom test dispatch"
- "PR Gate"
- "Nightly tt-metal L2 tests"
types:
- completed

Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/_test-wheels-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
matrix:
os: ${{ fromJson(inputs.from-precompiled && '["ubuntu-20.04"]' || '["ubuntu-20.04", "ubuntu-22.04"]') }}
runner-hw-info: [
{arch: grayskull},
{arch: wormhole_b0}
]
runs-on: ${{ matrix.os }}
Expand All @@ -46,29 +45,3 @@ jobs:
source tests/end_to_end_tests/env/bin/activate
cd tests/end_to_end_tests
pytest -c conftest.py . -m eager_host_side
test-wheels-silicon:
strategy:
matrix:
# We only have this for non-Docker silicon runners right now
os: [ubuntu-20.04]
runner-hw-info: [
{arch: grayskull, type: E150},
{arch: wormhole_b0, type: N150},
{arch: wormhole_b0, type: N300}
]
runs-on: ["cloud-virtual-machine", "${{ matrix.runner-hw-info.type }}", "in-service"]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: eager-dist-${{ matrix.os }}-any
- name: Set up end-to-end tests environment
run: ./tests/scripts/set_up_end_to_end_tests_env.sh
- name: Activate env and run release tests - silicon
timeout-minutes: 2
shell: bash
run: |
source tests/end_to_end_tests/env/bin/activate
python3 -m ttnn.examples.usage.run_op_on_device
cd tests/end_to_end_tests
pytest -c conftest.py . -m eager_package_silicon
31 changes: 17 additions & 14 deletions .github/workflows/all-post-commit-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ jobs:
build-type: ${{ inputs.build-type || 'Release' }}
tracy: true
secrets: inherit
test-wheels:
needs: build-artifact
uses: ./.github/workflows/_test-wheels-impl.yaml
with:
from-precompiled: true
secrets: inherit
# Slow Dispatch Unit Tests
sd-unit-tests:
needs: build-artifact
Expand All @@ -64,7 +58,6 @@ jobs:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand All @@ -80,7 +73,6 @@ jobs:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand All @@ -89,6 +81,21 @@ jobs:
os: ubuntu-20.04
arch: ${{ matrix.test-group.arch }}
runner-label: ${{ matrix.test-group.runner-label }}
# Fabric Unit Tests
fabric-unit-tests:
needs: build-artifact
secrets: inherit
strategy:
fail-fast: false
matrix:
test-group: [
{ arch: wormhole_b0, runner-label: N300 },
]
uses: ./.github/workflows/fabric-build-and-unit-tests.yaml
with:
os: ubuntu-20.04
arch: ${{ matrix.test-group.arch }}
runner-label: ${{ matrix.test-group.runner-label }}
# TTNN FD Unit tests
ttnn-unit-tests:
needs: build-artifact
Expand All @@ -97,7 +104,6 @@ jobs:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand All @@ -113,7 +119,6 @@ jobs:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand All @@ -129,7 +134,6 @@ jobs:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand All @@ -150,20 +154,19 @@ jobs:
matrix:
test-group: [
{ arch: wormhole_b0, runner-label: N150 },
# Disabled due to https://github.com/tenstorrent/tt-metal/issues/16012
# { arch: wormhole_b0, runner-label: N300 },
{ arch: wormhole_b0, runner-label: N300 },
]
uses: ./.github/workflows/tt-train-post-commit.yaml
with:
arch: ${{ matrix.test-group.arch }}
runner-label: ${{ matrix.test-group.runner-label }}
docker-image: ${{ needs.build-artifact.outputs.ci-build-docker-image }}
run-profiler-regression:
needs: build-artifact-profiler
strategy:
fail-fast: false
matrix:
test-group: [
{ arch: grayskull, runner-label: E150 },
{ arch: wormhole_b0, runner-label: N150 },
{ arch: wormhole_b0, runner-label: N300 },
]
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/all-static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ jobs:
run: sudo apt-get install -y aspell
- name: Run checks on docs
run: TT_METAL_HOME=$(pwd) docs/spellcheck.sh
check-docs-links:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
clean: false
- name: Link Checker
uses: lycheeverse/lychee-action@v2
with:
args: --verbose './README.md' './INSTALLING.md' './docs/source/**/*.rst' './docs/source/**/*.md'
fail: true
check-forbidden-imports:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -104,7 +117,7 @@ jobs:
- uses: lukka/get-cmake@b516803a3c5fac40e2e922349d15cdebdba01e60
if: steps.changed-cmake-files.outputs.any_changed == 'true'
with:
cmakeVersion: "~3.19.0"
cmakeVersion: "~3.24.0"
- name: Check CMake version
if: steps.changed-cmake-files.outputs.any_changed == 'true'
run: cmake --version
Expand All @@ -119,5 +132,4 @@ jobs:
# TODO: Use a lukka/run-cmake with a preset after upgrading to a more modern CMake
run: |
echo "Checking compatibility with $(cmake --version)"
# FIXME: Why is HAVE_STD_REGEX needed? Clean up when we solve it.
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/x86_64-linux-clang-17-libcpp-toolchain.cmake -DHAVE_STD_REGEX=ON -B build .
cmake -D BUILD_PROGRAMMING_EXAMPLES=ON -D TT_METAL_BUILD_TESTS=ON -B build .
56 changes: 47 additions & 9 deletions .github/workflows/bisect-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,33 @@ on:
- grayskull
- wormhole_b0
- blackhole
tracy:
required: true
type: boolean
default: false
description: "Build with tracy enabled"
build-wheel:
required: true
type: boolean
default: false
description: "Build Python Wheel"
runner-label:
required: true
type: choice
options:
- E150
- N150
- N300
- P150
- config-t3000
- config-tg
- config-tgg
description: "Runner Type Label"
extra-label:
required: true
type: string
default: "in-service"
description: "Secondary tag to filter runners"
good-commit:
required: true
type: string
Expand All @@ -22,39 +46,53 @@ on:
command:
required: true
type: string
description:
timeout:
required: true
type: string
default: "Git bisect dispatch"
description: "Timeout (eg: 5m, 1h)"
patch:
required: false
type: string
description: "Commit-ish to cherry-pick for each step"

run-name: ${{ inputs.description }}
run-name: "Bisect on ${{ inputs.runner-label }}"
jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
with:
tracy: ${{ inputs.tracy }}
build-wheel: ${{ inputs.build-wheel }}
test-dispatch:
needs: build-artifact
timeout-minutes: 1440
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
ARCH_NAME: ${{ inputs.arch }}
runs-on:
- ${{ inputs.runner-label }}
- "in-service"
- ${{ inputs.extra-label }}
steps:
- uses: tenstorrent/tt-metal/.github/actions/checkout-with-submodule-lfs@main
- name: ⬇️ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up dyanmic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_any
name: ${{ needs.build-artifact.outputs.build-artifact-name }}
- name: Extract files
run: tar -xvf ttm_any.tar
- uses: ./.github/actions/install-python-deps
- name: Run pre/post regression tests in a loop
- name: Run Git Bisect
shell: bash
env:
GIT_COMMITTER_NAME: "GitHub Actions"
GIT_COMMITTER_EMAIL: "actions@github.com"
run: |
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
./tests/scripts/tt_bisect.sh -f "${{ inputs.command }}" -b ${{ inputs.bad-commit }} -g ${{ inputs.good-commit }}
./tests/scripts/tt_bisect.sh -t ${{ inputs.timeout }} -f "${{ inputs.command }}" -b ${{ inputs.bad-commit }} -g ${{ inputs.good-commit }} -p "${{ inputs.patch }}"
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.from-precompiled }}
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
with:
build-wheel: true
test-wheels:
needs: build-artifact
if: ${{ always() }}
Expand Down
Loading

0 comments on commit f548105

Please sign in to comment.