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

Transpose WH on Blackhole: Incorrect output #18522

Open
mywoodstock opened this issue Feb 28, 2025 · 2 comments
Open

Transpose WH on Blackhole: Incorrect output #18522

mywoodstock opened this issue Feb 28, 2025 · 2 comments
Assignees
Labels

Comments

@mywoodstock
Copy link
Contributor

mywoodstock commented Feb 28, 2025

The following unit test gives PCC error when run on Blackhole, but is correct on Wormhole.

@pytest.mark.parametrize(
    "n, c, h, w, dim0, dim1",
    [
        (16, 128, 8, 256, 2, 3),
    ],
)
def test_resnet50_fold(device, n, c, h, w, dim0, dim1):
    torch.manual_seed(0)
    input_shape = (n, c, h, w)
    torch_input = torch.randn(input_shape, dtype=torch.bfloat16)

    ## WH -> HW
    torch_output = torch_input.transpose(dim0, dim1)

    core_grid = ttnn.CoreGrid(y=8, x=8)
    mem_config = ttnn.create_sharded_memory_config(
        input_shape,
        core_grid=core_grid,
        strategy=ttnn.ShardStrategy.HEIGHT,
        orientation=ttnn.ShardOrientation.ROW_MAJOR,
    )

    tt_input = ttnn.from_torch(
        torch_input,
        layout=ttnn.ROW_MAJOR_LAYOUT,
        device=device,
        memory_config=mem_config,
    )
    tt_output = ttnn.transpose(tt_input, dim0, dim1)
    tt_output = ttnn.to_torch(tt_output.cpu())

    assert_with_pcc(torch_output, tt_output, 0.9999)

This particular case appears in the fold op for Resnet50, and is giving PCC error on Blackhole.

@mywoodstock
Copy link
Contributor Author

cc: @cmaryanTT @ejouretTT

@llongTT
Copy link
Contributor

llongTT commented Feb 28, 2025

I can quickly check if the sharding process is correct or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants