-
Notifications
You must be signed in to change notification settings - Fork 3
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
Linking julia to Graphcore's LLVM #13
Comments
For the record, I managed to link Julia to Graphcore's LLVM. I need to put better documentation for how to build it in Julia, but the plumbing work is done. Note: maleadt/LLVM.jl#354 is required (but that will be in LLVM.jl v6, you probably have to make the change locally for the time being). |
Other PRs related to this effort:
Also, I had to make some other changes in this package, collected in branch https://github.com/giordano/IPUToolkit.jl/tree/mg/colossus. One weird thing is that if annotating the define void @_Z11_2___Pi_229() local_unnamed_addr #0 !dbg !36 {
top:
%0 = call i64 @get_vec_ptr_Pi(i32 0), !dbg !40
%1 = call i32 @get_vec_size_Pi(i32 0), !dbg !40
%2 = call i64 @get_vec_ptr_Pi(i32 1), !dbg !40
%3 = call i32 @get_vec_size_Pi(i32 1), !dbg !40
%4 = call i64 @get_vec_ptr_Pi(i32 2), !dbg !40
%5 = call i32 @get_vec_size_Pi(i32 2), !dbg !40
%6 = call i32 @llvm.colossus.get.scount.l(), !dbg !41
unreachable, !dbg !50
} I looked into this a little bit with @gbaraldi, we added some Not sure I'll have much time to further investigate this, but I'm leaving the breadcrumbs for future reference. |
Weirdly enough, trying to
I don't know if that's relevant, but the fatal error to find system header files is unexpected, the output should usually be free of warnings/errors. Nothing of this happens with official build of Julia (tried both JuliaLang/julia@c58e508 and JuliaLang/julia@5939e2d), I fear this is a weird interaction with libclang_jll, will have to try to use Graphcore's libclang. |
Yeah... This is not at all a well established build scenario |
Ok, I can confirm using Graphcore's libclang with julia> set_preferences!(
"LocalPreferences.toml",
"Clang_jll",
"libclang_path" => "/home/mose/repo/julia/usr/lib/libclang.so",
"libclang_cpp_path" => "/home/mose/repo/julia/usr/lib/libclang-cpp.so",
"clang_path" => "/home/mose/repo/julia/usr/bin/clang",
) does the trick, building the wrappers is now successful 🥳 |
For my own record, for debugging the problem above with the kernel being completely wiped out and replaced by |
Graphcore recently open-sourced their LLVM backend. This hasn't been upstreamed yet, but we can try to link julia to a libllvm built supporting the Colossus target. In this ticket I'll collect the steps I'm following to try and build Julia with Graphcore's LLVM.
Note: graphcore's LLVM fork currently is built on top of LLVM 15, which means we have to use it with current (as of 2023-06-12) Julia's
master
branch, what will become Julia v1.10 in the next few months. Following instructions are updated as of today, if you attempt to replicate this in the future, you may have to do something else.Clone Julia's repository
git clone https://github.com/JuliaLang/julia cd julia
Inside this directory create a file called
Make.user
with the following contentThen run the build with
replacing
24
with an appropriate number of parallel jobs you want to use on your machine.The text was updated successfully, but these errors were encountered: