Skip to content

Commit

Permalink
Resolve merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
uazizTT committed Nov 8, 2024
1 parent 7edf47c commit 03d0e8a
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 15 deletions.
8 changes: 6 additions & 2 deletions .github/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit
build-and-test:
uses: ./.github/workflows/build-and-test.yml
build:
uses: ./.github/workflows/run-build.yml
secrets: inherit
test:
needs: build
uses: ./.github/workflows/run-tests.yml
secrets: inherit
8 changes: 6 additions & 2 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit
build-and-test:
uses: ./.github/workflows/build-and-test.yml
build:
uses: ./.github/workflows/run-build.yml
secrets: inherit
test:
needs: build
uses: ./.github/workflows/run-tests.yml
secrets: inherit
8 changes: 6 additions & 2 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
spdx:
uses: ./.github/workflows/spdx.yml
secrets: inherit
build-and-test:
uses: ./.github/workflows/build-and-test.yml
build:
uses: ./.github/workflows/run-build.yml
secrets: inherit
test:
needs: build
uses: ./.github/workflows/run-tests.yml
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ jobs:
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

- name: ccache
uses: hendrikmuhs/[email protected]
with:
Expand All @@ -134,6 +137,7 @@ jobs:
source env/activate
cmake -G Ninja \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.install-output-dir }} \
-B ${{ steps.strings.outputs.build-output-dir }} \
-S ${{ steps.strings.outputs.work-dir }}
Expand All @@ -144,16 +148,42 @@ jobs:
cmake --build ${{ steps.strings.outputs.build-output-dir }}
cmake --install ${{ steps.strings.outputs.build-output-dir }}
- name: Run PyTorch tests
- name: Copy tt-metal binaries
shell: bash
run: |
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${LD_LIBRARY_PATH}"
source env/activate
pytest -v tests/torch
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: cp ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/*.so lib/

- name: Copy libfmt
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: cp ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal-build/_deps/fmt-build/*.so* lib/

- name: Copy libnng
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: cp ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal-build/_deps/nanomsg-build/*.so* lib/

- name: Run ONNX tests
- name: Copy libuv
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: cp ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal-build/_deps/libuv-build/*.so* lib/

- name: Copy tt-metal directories
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: |
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${LD_LIBRARY_PATH}"
source env/activate
pytest -v tests/onnx
mkdir tt-metal
cp -r ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal tt-metal/
cp -r ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn tt-metal/
cp -r ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal/runtime tt-metal/
- name: 'Tar install directory'
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: tar cvf artifact.tar .

- name: Upload install folder to archive
uses: actions/upload-artifact@v4
with:
name: install-artifacts
path: ${{ steps.strings.outputs.install-output-dir }}/artifact.tar
84 changes: 84 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Test

on:
workflow_dispatch:
workflow_call:
workflow_run:
workflows: [Build]
types: [completed]

jobs:
tests:
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150, name: "run"},
]

runs-on:
- in-service
- ${{ matrix.build.runs-on }}

container:
image: ghcr.io/tenstorrent/tt-torch/tt-torch-ci-ubuntu-22-04:latest
options: --user root --device /dev/tenstorrent/0
volumes:
- /dev/hugepages:/dev/hugepages
- /dev/hugepages-1G:/dev/hugepages-1G
- /etc/udev/rules.d:/etc/udev/rules.d
- /lib/modules:/lib/modules
- /opt/tt_metal_infra/provisioning/provisioning_env:/opt/tt_metal_infra/provisioning/provisioning_env

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
lfs: true

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: install-artifacts
path: ${{ steps.strings.outputs.install-output-dir }}

- name: 'Untar install directory'
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: tar xvf artifact.tar

- name: make tt-metal directory
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: mkdir -p ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal

- name: copy tt-metal dirs
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: |
cp -r ${{ steps.strings.outputs.install-output-dir }}/tt-metal/* ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal
- name: Run PyTorch tests
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${{ steps.strings.outputs.build-output-dir }}/lib:./lib/:${LD_LIBRARY_PATH}"
pytest -v tests/torch
- name: Run ONNX tests
shell: bash
run: |
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${{ steps.strings.outputs.build-output-dir }}/lib:./lib/:${LD_LIBRARY_PATH}"
pytest -v tests/onnx

0 comments on commit 03d0e8a

Please sign in to comment.