-
Notifications
You must be signed in to change notification settings - Fork 17
Use IREE's MLIR builder Python bindings for gemmbench IR generation #57
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ tqdm | |
| matplotlib | ||
| torch>=2.3.0 | ||
| pytest>=8.3.5 | ||
| PyYAML>=6.0.2 # Required by iree.compiler.dialects.linalg | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,9 +34,7 @@ def test_n_t_f16_f32_f16(): | |
| "%cst = arith.constant 0.000000e+00 : f32", | ||
| "%0 = tensor.empty() : tensor<512x4096xf32>", | ||
| "%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<512x4096xf32>) -> tensor<512x4096xf32>", | ||
| "%2 = linalg.matmul_transpose_b ins(%arg0, %arg1 : tensor<512x14336xf16>, tensor<4096x14336xf16>)", | ||
| "outs(%1 : tensor<512x4096xf32>)", | ||
| "-> tensor<512x4096xf32>", | ||
| "%2 = linalg.matmul_transpose_b {cast = #linalg.type_fn<cast_signed>} ins(%arg0, %arg1 : tensor<512x14336xf16>, tensor<4096x14336xf16>) outs(%1 : tensor<512x4096xf32>) -> tensor<512x4096xf32>", | ||
|
||
| "%3 = arith.truncf %2 : tensor<512x4096xf32> to tensor<512x4096xf16>", | ||
| "return %3 : tensor<512x4096xf16>", | ||
| ], | ||
|
|
@@ -64,9 +62,7 @@ def test_n_t_bf16_f32_bf16(): | |
| "%cst = arith.constant 0.000000e+00 : f32", | ||
| "%0 = tensor.empty() : tensor<2x1280xf32>", | ||
| "%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<2x1280xf32>) -> tensor<2x1280xf32>", | ||
| "%2 = linalg.matmul_transpose_b ins(%arg0, %arg1 : tensor<2x8192xbf16>, tensor<1280x8192xbf16>)", | ||
| "outs(%1 : tensor<2x1280xf32>)", | ||
| "-> tensor<2x1280xf32>", | ||
| "%2 = linalg.matmul_transpose_b {cast = #linalg.type_fn<cast_signed>} ins(%arg0, %arg1 : tensor<2x8192xbf16>, tensor<1280x8192xbf16>) outs(%1 : tensor<2x1280xf32>) -> tensor<2x1280xf32>", | ||
| "%3 = arith.truncf %2 : tensor<2x1280xf32> to tensor<2x1280xbf16>", | ||
| "return %3 : tensor<2x1280xbf16>", | ||
| ], | ||
|
|
@@ -94,9 +90,7 @@ def test_t_n_f16_f32_f16(): | |
| "%cst = arith.constant 0.000000e+00 : f32", | ||
| "%0 = tensor.empty() : tensor<32000x1xf32>", | ||
| "%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<32000x1xf32>) -> tensor<32000x1xf32>", | ||
| "%2 = linalg.matmul_transpose_a ins(%arg0, %arg1 : tensor<5120x32000xf16>, tensor<5120x1xf16>)", | ||
| "outs(%1 : tensor<32000x1xf32>)", | ||
| "-> tensor<32000x1xf32>", | ||
| "%2 = linalg.matmul_transpose_a {cast = #linalg.type_fn<cast_signed>} ins(%arg0, %arg1 : tensor<5120x32000xf16>, tensor<5120x1xf16>) outs(%1 : tensor<32000x1xf32>) -> tensor<32000x1xf32>", | ||
| "%3 = arith.truncf %2 : tensor<32000x1xf32> to tensor<32000x1xf16>", | ||
| "return %3 : tensor<32000x1xf16>", | ||
| ], | ||
|
|
@@ -124,9 +118,7 @@ def test_t_n_bf16_f32_bf16(): | |
| "%cst = arith.constant 0.000000e+00 : f32", | ||
| "%0 = tensor.empty() : tensor<32000x1xf32>", | ||
| "%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<32000x1xf32>) -> tensor<32000x1xf32>", | ||
| "%2 = linalg.matmul_transpose_a ins(%arg0, %arg1 : tensor<5120x32000xbf16>, tensor<5120x1xbf16>)", | ||
| "outs(%1 : tensor<32000x1xf32>)", | ||
| "-> tensor<32000x1xf32>", | ||
| "%2 = linalg.matmul_transpose_a {cast = #linalg.type_fn<cast_signed>} ins(%arg0, %arg1 : tensor<5120x32000xbf16>, tensor<5120x1xbf16>) outs(%1 : tensor<32000x1xf32>) -> tensor<32000x1xf32>", | ||
| "%3 = arith.truncf %2 : tensor<32000x1xf32> to tensor<32000x1xbf16>", | ||
| "return %3 : tensor<32000x1xbf16>", | ||
| ], | ||
|
|
@@ -154,9 +146,7 @@ def test_n_n_f16_f32_f16(): | |
| "%cst = arith.constant 0.000000e+00 : f32", | ||
| "%0 = tensor.empty() : tensor<2048x2048xf32>", | ||
| "%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<2048x2048xf32>) -> tensor<2048x2048xf32>", | ||
| "%2 = linalg.matmul ins(%arg0, %arg1 : tensor<2048x1024xf16>, tensor<1024x2048xf16>)", | ||
| "outs(%1 : tensor<2048x2048xf32>)", | ||
| "-> tensor<2048x2048xf32>", | ||
| "%2 = linalg.matmul ins(%arg0, %arg1 : tensor<2048x1024xf16>, tensor<1024x2048xf16>) outs(%1 : tensor<2048x2048xf32>) -> tensor<2048x2048xf32>", | ||
| "%3 = arith.truncf %2 : tensor<2048x2048xf32> to tensor<2048x2048xf16>", | ||
| "return %3 : tensor<2048x2048xf16>", | ||
| ], | ||
|
|
@@ -181,12 +171,10 @@ def test_n_t_i8_i32_i8(): | |
| [ | ||
| "module {", | ||
| "func.func @main(%arg0: tensor<128x128xi8>, %arg1: tensor<128x128xi8>) -> tensor<128x128xi8> {", | ||
| "%cst = arith.constant 0 : i32", | ||
| "%c0_i32 = arith.constant 0 : i32", | ||
| "%0 = tensor.empty() : tensor<128x128xi32>", | ||
| "%1 = linalg.fill ins(%cst : i32) outs(%0 : tensor<128x128xi32>) -> tensor<128x128xi32>", | ||
| "%2 = linalg.matmul_transpose_b ins(%arg0, %arg1 : tensor<128x128xi8>, tensor<128x128xi8>)", | ||
| "outs(%1 : tensor<128x128xi32>)", | ||
| "-> tensor<128x128xi32>", | ||
| "%1 = linalg.fill ins(%c0_i32 : i32) outs(%0 : tensor<128x128xi32>) -> tensor<128x128xi32>", | ||
| "%2 = linalg.matmul_transpose_b {cast = #linalg.type_fn<cast_signed>} ins(%arg0, %arg1 : tensor<128x128xi8>, tensor<128x128xi8>) outs(%1 : tensor<128x128xi32>) -> tensor<128x128xi32>", | ||
| "%3 = arith.trunci %2 : tensor<128x128xi32> to tensor<128x128xi8>", | ||
| "return %3 : tensor<128x128xi8>", | ||
| ], | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.