-
Notifications
You must be signed in to change notification settings - Fork 45
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 level-zero-opt tool #264
Conversation
} | ||
func.func private @fillResource1DFloat(memref<?xf32>, f32) | ||
func.func private @printMemrefF32(memref<*xf32>) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline at the end of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// CHECK: spv.Branch ^bb1 | ||
// CHECK: ^bb1: // pred: ^bb0 | ||
// CHECK: %__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi64>, Input> | ||
// CHECK: %0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi64> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated names like %0
can be unstable between MLIR versions, please use %[[VAR1:.*]] = spv.Load ...
%[[VAR2:.*]] = spv.CompositeExtract %[[VAR1]][0 : i32]
name matching style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
%2 = memref.alloc() : memref<8xf32> | ||
// CHECK: %memref = gpu.alloc () : memref<8xf32> | ||
// CHECK: %memref_0 = gpu.alloc () : memref<8xf32> | ||
// CHECK: %memref_1 = gpu.alloc () : memref<8xf32> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check there are actually loads from these gpu allocs inside gpu.launch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like
// CHECK: %[[MEMREF0:.*]]= gpu.alloc () : memref<8xf32>
// CHECK: gpu.launch
// CHECK: memref.load %[[MEMREF0]][...]
// CHECK: gpu.terminator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nbpatel please address this comment and then it is LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is revised. Please let me know if further changes are required. -Liangliang
@nbpatel speaking of enabling/disabling individual lit tests, please take a look https://llvm.org/docs/TestingGuide.html#constraining-test-execution |
…ions into nishant_l0-opt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure tests are actually run (and succeed) in CI.
You might want to look at refactor branch.
Testing Time: 0.31s Hi, The tests can run correctly if you check the output of the CI for the latest commit. Three are unsupported since they are end-to-end tests and the CI is not with the target GPU. |
I do not understand the numbers reported. Which are the ones which pass, and which don't? |
ok, I see now, my bad. I had missed the "mlir" in the path. Am I right that in the CI
? |
Hi, yes, you are right. This commit currently only enables tests in mlir/test/Conversion and mlir/test/Transform, others are disabled. The numbers reported are only for tests in mlir/test. |
Please review these guidelines to help with the review process:
This PR adds a directory structure to the mlir/test directory which is similar to upstream dir structure.
It adds a tool called level-zero-opt which allows us to run individual pass from command line and also adds a few test cases for doing some basic IR tests.
More test cases to be added.