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

compiler requirement #115

Closed
python152 opened this issue May 20, 2021 · 5 comments
Closed

compiler requirement #115

python152 opened this issue May 20, 2021 · 5 comments

Comments

@python152
Copy link

hi -

Can you please clarify compiler requirement? I am mainly interested in python module, but it needs build extension anyway. is LLVM a must, version requirement? I ran into bunch of errors, I just want to confirm the basics before I post the logs.

Thanks
Oliver

@ptillet
Copy link
Collaborator

ptillet commented May 20, 2021

Yep, Triton will compile LLVM 11.0 from scratch and link against it. I've been meaning to embed pre-compiled static libraries instead, but ran into some issues. I've compiled Triton successfully on all my linux machines, with GCC 7.5+.

Alternatively, you can also just install the latest wheel. pip install -U --pre triton

@python152
Copy link
Author

I appreciate the reply. I am having a bit trouble to compile 11.0 from scratch, but I do have binary distribution of 11.0 available. Is there a way I can bypass the download and recompile, and use the existing compiler distribution? Thanks

@ptillet
Copy link
Collaborator

ptillet commented May 21, 2021

Replacing llvm-src by pre-compiled static libraries is actually something I've been meaning to do for a while. My current plan is to do it in ~2 weeks. The only solution I can think of would be to hack the CMakeLists.txt so that it links against LLVM without compiling it. As long as the the include_dir is there and the proper libraries are linked against triton, then it should be good

@python152
Copy link
Author

I made some progress: I was able to compile successfully C++ interface with python module ON, with downloaded llvm 11, the last few snippet is:

[ 96%] Built target LLVMLibDriver
[ 97%] Built target LLVMXRay
[100%] Built target triton
[100%] Built target LLVMHello_exports
[100%] Built target LLVMHello

and I have libtriton.so in triton/build directory. Then, I went to triton/python directory, and hope to build out the python module: python setup.py build, but I ran into bunch of errors, see below:

...
-- Targeting NVPTX
-- Adding Python module
--
-- Configuring done
-- Generating done
...
 71%] Linking CXX static library ../../libLLVMInstrumentation.a
[ 71%] Built target LLVMInstrumentation
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[2]: *** [/tmp/llvm-release/llvm-build/lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/RewriteStatepointsForGC.cpp.o] Error 4
gmake[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[2]: *** [/tmp/llvm-release/llvm-build/lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/StructurizeCFG.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[2]: *** [/tmp/llvm-release/llvm-build/lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)

It seems this step (appearing to be building llvm again?) failed at various places, I am not sure how the build process works - if I have C++ interface with python enabled, I imagine it should be relatively straightforward process to get a python extension built, any suggestions? thanks!

Oliver

@python152
Copy link
Author

Actually, I think I got the errors due to high cpu count and setup.py is trying to use them all, causing severe resource contentions. Once I dial down the count, I am able to have a python build. Thanks again for your help.

oraluben pushed a commit to oraluben/triton that referenced this issue Sep 11, 2024
Signed-off-by: Ilya Enkovich <ilya.enkovich@intel.com>
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

No branches or pull requests

2 participants