Skip to content
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

sycl : Add support for non-release DPC++ & oneMKL #8644

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

joeatodd
Copy link
Contributor

This PR enables llama.cpp to be built with the non-release (i.e. built from source) versions of DPC++ (clang++ instead of icpx) and oneMKL. Some duplicate/unneeded flags have been removed, and I have rearranged the logic slightly to keep things where they are needed.

@joeatodd
Copy link
Contributor Author

@airMeng @NeoZhangJianyu hey folks - I tested that I can still compile on PVC with the release compiler (2024.2), but perhaps you'd like to double check I haven't broken anything for your builds?

Signed-off-by: Joe Todd <[email protected]>
Copy link
Collaborator

@airMeng airMeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @luoyu-intel our architecture for awareness

@OuadiElfarouki OuadiElfarouki merged commit 64cf50a into ggerganov:master Jul 23, 2024
53 checks passed
@mudler
Copy link
Contributor

mudler commented Jul 23, 2024

This seems to have broken things here:

[100%] Linking CXX executable ../../bin/grpc-server
/usr/bin/ld: ../../ggml/src/libggml.a(ggml-sycl.cpp.o): undefined reference to symbol '_ZN4sycl3_V15queue6memcpyEPvPKvmRKNS0_6detail13code_locationE'
/usr/bin/ld: /opt/intel/oneapi/compiler/2024.2/lib/libsycl.so.7: error adding symbols: DSO missing from command line
icpx: error: linker command failed with exit code 1 (use -v to see invocation)

Is there anything I'm missing maybe?

@mudler
Copy link
Contributor

mudler commented Jul 24, 2024

Similarly, this seems to break the rpc server build when sycl is enabled:

#45 1217.2 gmake[6]: Entering directory '/build/backend/cpp/llama-grpc/llama.cpp/build'                                                                                                                                                       
#45 1217.2 [ 92%] Building CXX object examples/rpc/CMakeFiles/rpc-server.dir/rpc-server.cpp.o                                                                                                                                                 
#45 1217.5 [100%] Linking CXX executable ../../bin/rpc-server                                                                                                                                                                                 
#45 1217.7 /usr/bin/ld: ../../ggml/src/libggml.a(ggml-sycl.cpp.o): undefined reference to symbol '_ZN4sycl3_V15queue6memcpyEPvPKvmRKNS0_6detail13code_locationE'                                                                              
#45 1217.7 /usr/bin/ld: /opt/intel/oneapi/compiler/2024.2/lib/libsycl.so.7: error adding symbols: DSO missing from command line                                                                                                               
#45 1217.7 icpx: error: linker command failed with exit code 1 (use -v to see invocation)    

@joeatodd
Copy link
Contributor Author

Hi @mudler, sorry to hear I've messed things up for you. I can reproduce this locally with a build of llama-bench, if I pass -DBUILD_SHARED_LIBS=OFF, which I think is how you're building.

It's missing libsycl, I think because I need to pass -fsycl as a linker flag, as well as a compilation flag.

I'll try a fix locally & push something ASAP.

@mudler
Copy link
Contributor

mudler commented Jul 24, 2024

Hi @mudler, sorry to hear I've messed things up for you. I can reproduce this locally with a build of llama-bench, if I pass -DBUILD_SHARED_LIBS=OFF, which I think is how you're building.

No worries, was trying to trace it back to provide more contextual info and created #8665!

It's missing libsycl, I think because I need to pass -fsycl as a linker flag, as well as a compilation flag.

I'll try a fix locally & push something ASAP.

Thank you! 👍 I'm testing now a very simple workaround here to confirm that's what all is missing:

add_executable(rpc-server rpc-server.cpp)
if ( DEFINED ENV{ONEAPI_ROOT})
target_link_libraries(rpc-server PRIVATE ggml llama sycl)
else()
target_link_libraries(rpc-server PRIVATE ggml llama)
endif()

I'll let keep you posted! I can also give a shot to the PR once is up

arthw pushed a commit to arthw/llama.cpp that referenced this pull request Jul 27, 2024
* Update cmake to support nvidia hardware & open-source compiler
---------
Signed-off-by: Joe Todd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants