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

Add Blackhole CI #1352

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions .github/workflows/on-blackhole-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: On push

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

jobs:
docker-build:
uses: ./.github/workflows/build-image.yml
secrets: inherit
build:
needs: docker-build
uses: ./.github/workflows/build.yml
secrets: inherit
with:
docker-image: ${{ needs.docker-build.outputs.docker-image }}
test:
needs:
- docker-build
- build
uses: ./.github/workflows/test.yml
secrets: inherit
with:
test_mark: 'push'
test_group_cnt: 2
test_group_ids: '[1,2]'
docker-image: ${{ needs.docker-build.outputs.docker-image }}
runs-on: '[{"runs-on": "p150"}]'
1 change: 1 addition & 0 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
test_group_cnt: 2
test_group_ids: '[1,2]'
docker-image: ${{ needs.docker-build.outputs.docker-image }}
runs-on: '[{"runs-on": "n150"}, {"runs-on": "n300"}, {"runs-on": "p150"}]'

check-all-green:
if: always()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
test_group_cnt: 2
test_group_ids: '[1,2]'
docker-image: ${{ needs.docker-build.outputs.docker-image }}
runs-on: '[{"runs-on": "n150"}, {"runs-on": "n300"}, {"runs-on": "p150"}]'
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
description: 'Runs on'
required: false
type: string
default: '[{"runs-on": "n150"}, {"runs-on": "n300"}]'
default: '[{"runs-on": "n150"}, {"runs-on": "n300"}, {"runs-on": "p150"}]'

permissions:
packages: write
Expand Down
10 changes: 10 additions & 0 deletions forge/test/mlir/mnist/training/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# SPDX-License-Identifier: Apache-2.0

import os
import pytest
import time

Expand Down Expand Up @@ -332,6 +333,9 @@ def test_forge_vs_torch():

@pytest.mark.push
def test_loss_device():
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

# Config
num_epochs = 3
batch_size = 1
Expand Down Expand Up @@ -406,6 +410,9 @@ def test_loss_device():

@pytest.mark.push
def test_lora():
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

# Config
num_epochs = 3
batch_size = 128
Expand Down Expand Up @@ -468,6 +475,9 @@ def test_lora():

@pytest.mark.push
def test_optimizer_device():
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

# Config
num_epochs = 32
batch_size = 1024
Expand Down
4 changes: 4 additions & 0 deletions forge/test/mlir/operators/matmul/test_matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

import os
import pytest
import torch
from torch import nn
Expand All @@ -16,6 +17,9 @@
@pytest.mark.parametrize("inner_dim", [1, 7, 32, 41, 64])
@pytest.mark.push
def test_matmul(batch_size, outer_dim_x, outer_dim_y, inner_dim):
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

class Matmul(nn.Module):
def __init__(self):
super().__init__()
Expand Down
9 changes: 9 additions & 0 deletions forge/test/mlir/operators/tm/test_tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

import os
import pytest
import torch
from torch import nn
Expand Down Expand Up @@ -395,6 +396,11 @@ def forward(self, a):
@pytest.mark.parametrize("shape", [(1, 32, 64, 64), (32, 64, 64), (64, 64)])
@pytest.mark.push
def test_indexing(dim, start, stop, stride, shape):
# test_indexing[shape0-4-32-0--1] hangs when running `pytest forge/test/mlir/operators/tm/test_tm.py`,
# but passes for `pytest forge/test/mlir/operators/tm/test_tm.py::test_indexing`.
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

if len(shape) == 2 and dim == -3:
pytest.skip("Skipping since indexing on dim=-3, 2D tensor doesn't make sense")
if stop > shape[dim]:
Expand Down Expand Up @@ -672,6 +678,9 @@ def forward(
@pytest.mark.parametrize("length", [4, 16])
@pytest.mark.parametrize("stride", [16, 32])
def test_select(shape, dim, begin, length, stride):
if os.environ["ARCH_NAME"] == "blackhole":
pytest.xfail()

if stride <= begin + length:
pytest.skip("Skipping since stride <= begin + length")

Expand Down
4 changes: 4 additions & 0 deletions forge/test/mlir/test_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

import os
import pytest
import torch
from torch import nn
Expand Down Expand Up @@ -49,6 +50,9 @@ def test_l1_loss(prediction_shape, reduction):
)
@pytest.mark.push
def test_cross_entropy_loss(prediction_shape):
if os.environ["ARCH_NAME"] == "blackhole" and prediction_shape == (3, 5):
pytest.xfail()

forge_loss = forge.op.loss.CrossEntropyLoss("cross_entropy_loss")
torch_loss = torch.nn.CrossEntropyLoss()

Expand Down
Loading