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

Fix TTIR to TTNN conversion for all gather #1182

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Fix TTIR to TTNN conversion for all gather

0c10623
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Draft

Fix TTIR to TTNN conversion for all gather #1182

Fix TTIR to TTNN conversion for all gather
0c10623
Select commit
Loading
Failed to load commit list.
GitHub Actions / MLIR Tests failed Nov 6, 2024 in 0s

219 tests run, 210 passed, 8 skipped, 1 failed.

Annotations

Check failure on line 5 in ttmlir/Dialect/TTNN/ccl

See this annotation in the file changed.

@github-actions github-actions / MLIR Tests

ttmlir/Dialect/TTNN/ccl.all_gather.mlir

Exit Code: 1
Raw output
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /__w/tt-mlir/tt-mlir/build/bin/ttmlir-opt --ttir-to-ttnn-backend-pipeline /__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir | /opt/ttmlir-toolchain/bin/FileCheck /__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir
+ /opt/ttmlir-toolchain/bin/FileCheck /__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir
+ /__w/tt-mlir/tt-mlir/build/bin/ttmlir-opt --ttir-to-ttnn-backend-pipeline /__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir
/__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir:5:12: error: CHECK: expected string not found in input
 // CHECK: %[[C:.*]] = "ttnn.empty"[[C:.*]]
           ^
<stdin>:1:1: note: scanning from here
#device = #tt.device<workerGrid = #tt.grid<8x8, (d0, d1) -> (0, d0, d1)>, l1Map = (d0, d1)[s0, s1] -> (0, d0 floordiv s0, d1 floordiv s1, (d0 mod s0) * s1 + d1 mod s1), dramMap = (d0, d1)[s0, s1] -> (0, 0, ((((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 8192) mod 12, (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 98304 + (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) mod 8192), meshShape = , chipIds = [0]>
^
<stdin>:12:45: note: possible intended match here
 %1 = "ttnn.to_device"(%arg0, %0) <{memory_config = #ttnn.memory_config<<interleaved>, <dram>, <<1x1>>>}> : (tensor<1x1x32x32xbf16, #layout>, !tt.device<#device>) -> tensor<1x1x32x32xbf16, #layout2>
                                            ^

Input file: <stdin>
Check file: /__w/tt-mlir/tt-mlir/test/ttmlir/Dialect/TTNN/ccl/all_gather.mlir

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: #device = #tt.device<workerGrid = #tt.grid<8x8, (d0, d1) -> (0, d0, d1)>, l1Map = (d0, d1)[s0, s1] -> (0, d0 floordiv s0, d1 floordiv s1, (d0 mod s0) * s1 + d1 mod s1), dramMap = (d0, d1)[s0, s1] -> (0, 0, ((((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 8192) mod 12, (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 98304 + (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) mod 8192), meshShape = , chipIds = [0]> 
check:5'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: #dram = #tt.memory_space<dram> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: #system = #tt.memory_space<system> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: #system_desc = #tt.system_desc<[{arch = <wormhole_b0>, grid = 8x8, l1_size = 1499136, num_dram_channels = 12, dram_channel_size = 1073741824, noc_l1_address_align_bytes = 16, pcie_address_align_bytes = 32, noc_dram_address_align_bytes = 32, l1_unreserved_base = 1024, erisc_l1_unreserved_base = 1024, dram_unreserved_base = 1024, dram_unreserved_end = 1073741824, physical_cores = {worker = [ 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 1x0, 1x1, 1x2, 1x3, 1x4, 1x5, 1x6, 1x7, 2x0, 2x1, 2x2, 2x3, 2x4, 2x5, 2x6, 2x7, 3x0, 3x1, 3x2, 3x3, 3x4, 3x5, 3x6, 3x7, 4x0, 4x1, 4x2, 4x3, 4x4, 4x5, 4x6, 4x7, 5x0, 5x1, 5x2, 5x3, 5x4, 5x5, 5x6, 5x7, 6x0, 6x1, 6x2, 6x3, 6x4, 6x5, 6x6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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: #layout = #tt.layout<(d0, d1, d2, d3) -> (d0 * 32 + d1 * 32 + d2, d3), undef, <1x1>, memref<32x32xbf16, #system>> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: #layout1 = #tt.layout<(d0, d1, d2, d3) -> (d0 * 32 + d1 * 32 + d2, d3), undef, <1x1>, memref<32x128xbf16, #system>> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: #layout2 = #tt.layout<(d0, d1, d2, d3) -> (d0 * 32 + d1 * 32 + d2, d3), undef, <1x1>, memref<1x1x!tt.tile<32x32, bf16>, #dram>, interleaved> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: #layout3 = #tt.layout<(d0, d1, d2, d3) -> (d0 * 32 + d1 * 32 + d2, d3), undef, <1x1>, memref<32x128xbf16, #dram>, interleaved> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           9: module attributes {tt.device = #device, tt.system_desc = #system_desc} { 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          10:  func.func @forward(%arg0: tensor<1x1x32x32xbf16, #layout>) -> tensor<1x1x32x128xbf16, #layout1> { 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          11:  %0 = "ttnn.get_device"() <{mesh_shape = #ttnn<mesh_shape 1x1>}> : () -> !tt.device<#device> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          12:  %1 = "ttnn.to_device"(%arg0, %0) <{memory_config = #ttnn.memory_config<<interleaved>, <dram>, <<1x1>>>}> : (tensor<1x1x32x32xbf16, #layout>, !tt.device<#device>) -> tensor<1x1x32x32xbf16, #layout2> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:5'1                                                 ?                                                                                                                                                           possible intended match
          13:  %2 = "ttnn.to_layout"(%1) <{layout = #ttnn.layout<tile>}> : (tensor<1x1x32x32xbf16, #layout2>) -> tensor<1x1x32x32xbf16, #layout2> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          14:  "ttnn.dealloc"(%1) : (tensor<1x1x32x32xbf16, #layout2>) -> () 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          15:  %3 = "ttnn.all_gather"(%2) <{dim = 3 : si32, num_links = 1 : si32}> : (tensor<1x1x32x32xbf16, #layout2>) -> tensor<1x1x32x128xbf16, #layout3> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  "ttnn.dealloc"(%2) : (tensor<1x1x32x32xbf16, #layout2>) -> () 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          17:  %4 = "ttnn.from_device"(%3) : (tensor<1x1x32x128xbf16, #layout3>) -> tensor<1x1x32x128xbf16, #layout1> 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--