-
Notifications
You must be signed in to change notification settings - Fork 100
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 cblas level 1 routines and corresponding regression tests #364
base: main
Are you sure you want to change the base?
Conversation
The test passed for higher versions of LLVM but not for lower versions, and I think this is because I generated this .ll file with LLVM 13. @wsmoses Could you maybe tell a little bit on how to generate .ll files that are compatible with lower versions? |
The error is that in lower versions of llvm arguments need actual names, not just %0. Add names to the functions and it should pass? |
Thanks for the hints. By the way, I am curious about what the life cycle for llvm versions is |
c1c2b42
to
8b9f167
Compare
8b9f167
to
43d74ad
Compare
I uploaded the implementation of level 1 routines and level 2 gemv, but the test system is not working on my computer, I will fix it and add test cases for gemv later |
Also I noticed that there are some related implementation of gemm at #308 , but both of us are doing this in a bit awkward way. After testing gemv I will try to extract the common portion of many blas routines and do a refactoring |
9090ce4
to
58f1983
Compare
58f1983
to
6e25212
Compare
@wsmoses All tests have passed. Two fails are due to other test cases |
@tansongchen you marked all the conversations as resolved, but there is no new commit yet? Maybe you forgotten to push? |
Just pushed |
b0af1e5
to
f82c4ca
Compare
I haven't quite understood what is happening with the Julia nightly CI. It seems that other PRs are also failing on this? |
Yeah feel free to ignore Julia nightly CI. |
getReverseBuilder(Builder2); | ||
if (has_diff_x) { | ||
#if LLVM_VERSION_MAJOR >= 11 | ||
auto swapCall = |
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.
Can you add to differentialuseanalysis.h a corresponding note that neither primal x, nor primal y are needed for the reverse pass here.
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.
Which function should I add to? and is there some example to see how to add them
Modulo the rebase on #528 and potentially the pass-by-reference handling required this looks good! Also we're going to want to list the blas routines behaviors in differential use analysis and activity analysis, since in theory we should be able to have stronger information than a generic call fallback. |
bump! It would be really good to get this done. This is the biggest blocker for Enzyme.jl currently |
Improve compatibility
Make tests work for lower versions of LLVM
Let's get this merged step-by-step. I am firstly adding swap and copy functions here, and then the remaining level 1 functions, and then level 2, and then level 3. A helper function is implemented to handle the case where we swap a active vector with a constant vector. |
Reopening to preseve tests which we should add cc @ZuseZ4 |
I'm currently looking on LIT's documentation to learn how to write more comprehensive test, but let's just first put it here.