-
Notifications
You must be signed in to change notification settings - Fork 7
Initial Design Discussion #2
Comments
Followup: When I was writing the proposal, I implemented a rough prototype of Vectorize that was able to meet all of the design goals laid out in the proposal and could be installed via
Every function resulted in a direct To implement the macro however, there would have to be some conversion/lookup/mapping between This was the way that I originally had in mind for generating this package. While I understand the performance and flexibility benefits (I'm not sure how performant we could make our block reductions and optimizations in this way, although they are definitely possible) of implementing this code in a similar fashion to Please don't take the above as a dismissal of the advice presented in your email regarding the Julia/LLVM implementation method. I just want to make sure we get this right from the beginning. I've already started work on the Julia/LLVM method to help me wrap my head around it, however there is still a lot of code from the above pure-Julia implementation that works well. @simonbyrne any thoughts on the original post or this followup? |
It's good to hear you are diving into LLVM. My general advice is to carefully analyze where the right place is to put a analysis or transform, not just put it somewhere because you understand that part better or because of business arrangements. (Latter is how I once ended up in the insane position of writing a modulo scheduling software pipeliner that ran before instruction selection.) I appreciate the concern about making the work easily available. Even I download the pre-built Julia for my Windows machine at home. As far as the final product, I don't see a problem with having part of it in the Julia codegen, which could become part of the standard Julia distribution, and having part of it as a separate package. My recent work on Another possible avenue to explore is to add LLVM passes as shared libraries. I don't know if that's possible, but it seems plausible. |
In response to your final comment, it is possible to develop a pass outside of the LLVM source tree and register it against a binary or system-install LLVM; I just got it working this morning after following some guidelines in the LLVM docs. So that is an option. |
I think after some thought and analysis that the implementation direction with the most future flexibility would be the original LLVM line suggested by you; however, it would be possible to keep most of the development outside of Julia code base. i.e. Package:
Julia: Thoughts? My only gripe with this method is that it requires Julia users to download a copy of the source, for Vectorize.jl to then modify |
I think Arch is saying that your changes to |
Right. If you run Another example is #15244, where the changes seem headed to incorporation into the Julia repo, even though they exist solely to support external packages. seems to be headed that way. |
@ArchRobison Welcome to the (currently empty) home of Vectorize.jl. I wanted to start an issue to discuss the initial plan of attack in more detail. The vast majority of my experience with Julia has been in pure Julia with only a few forays into the codegen and LLVM sections of the code base so my understanding of some of the inner workings of the Julia language is a little rusty; I could definitely appreciate some guidance in this department.
The current plan (at least as far as I understand it) for the most basic implementation of
@vectorize
is as follows (this is the straight up naive implementation to get me started):@vectorize
annotates a function call/comprehension/loop. (similar to what you did in simdloop.jl)codegen.cpp
(similar to what you did for@simd
codegen.cpp)While the original proposal was to structure this as a Julia package (of the
Pkg.add()
variety), I have been unable to think of a way to build the desired functionality without adding the above code to Julia and rebuilding.Apologies if any of the above are naive questions, I'm still wrapping my head around the inner workings of Julia and LLVM.
The text was updated successfully, but these errors were encountered: