-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[mlir][x86vector] AVX512-BF16 Dot op #124800
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
62280ae
AVX512 dot td
adam-smnk 3af7812
AVX512-BF16 td
adam-smnk 00ff34e
dotbf16 conversion
adam-smnk f5e32c5
avx dot-b16 test
adam-smnk 34aae41
Op example
adam-smnk 1d65c11
Test cases
adam-smnk 6bfbc9b
Remove integration test
adam-smnk 4f0fcaf
Add llc test to verify correct lowering
adam-smnk 169086d
Collapse extensions into avx512 namespace
adam-smnk eaa9333
Add translation tests
adam-smnk a90cc75
Make asm checks more generic
adam-smnk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
mlir/test/Integration/Dialect/Vector/CPU/X86Vector/dot-bf16.mlir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // RUN: mlir-opt %s -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm="enable-x86vector" -convert-to-llvm -reconcile-unrealized-casts | \ | ||
| // RUN: mlir-translate --mlir-to-llvmir | \ | ||
| // RUN: %lli --entry-function=entry --mattr="avx512bf16" --dlopen=%mlir_c_runner_utils | \ | ||
rengolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // RUN: FileCheck %s | ||
|
|
||
| func.func @entry() -> i32 { | ||
| %i0 = arith.constant 0 : i32 | ||
| %i3 = arith.constant 3 : i32 | ||
|
|
||
| %src = arith.constant dense<1.0> : vector<4xf32> | ||
| %a = arith.constant dense<[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]> : vector<8xbf16> | ||
| %b = arith.constant dense<[9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]> : vector<8xbf16> | ||
| %dst = x86vector.avx512bf16.dot %src, %a, %b : vector<8xbf16> -> vector<4xf32> | ||
|
|
||
| %1 = vector.extractelement %dst[%i0 : i32] : vector<4xf32> | ||
| %2 = vector.extractelement %dst[%i3 : i32] : vector<4xf32> | ||
| %d = arith.addf %1, %2 : f32 | ||
rengolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // CHECK: ( 30, 82, 150, 234 ) | ||
| // CHECK: 264 | ||
| vector.print %dst : vector<4xf32> | ||
| vector.print %d : f32 | ||
|
|
||
| return %i0 : i32 | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.