-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
TypeError: dot() got an unexpected keyword argument 'trans_b' #1098
Comments
On the latest master branch, you can use |
I will update the source code for the Triton Flash Attention implementation with your recommendation. And report back. Thank you for the advice. Enrico |
@ptillet I tried both the most updated stable version of Triton and the nightly build available. I am using Python 3.9 and CUDA 11.3. I am now receiving the error qk += tl.dot(q, tl.trans(k)) Thank you, Enrico |
you should install from source. The nightly build is about a month and half old, as new nightly builds are way less stable than the old one. We plan a triton alpha release in ~2 weeks. |
Ok. I will try installing from source now. |
@conceptofmind , let me know if you get building from source to work. So far, I haven't managed to get it to work, which could 100% be an issue on my end. |
@vedantroy I have not had any success building from source either. Throws an error stating it is missing scikit build. I installed |
What error are you guys having? The build should be quite smooth. |
git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build time dependency
pip install -e . Here is where it breaks: /home/henry/triton/lib/Target/LLVMIR/LLVMIRTranslation.cpp:21:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
lib/Target/LLVMIR/CMakeFiles/obj.TritonLLVMIR.dir/build.make:78: recipe for target 'lib/Target/LLVMIR/CMakeFiles/obj.TritonLLVMIR.dir/LLVMIRTranslation.cpp.o' failed
make[2]: *** [lib/Target/LLVMIR/CMakeFiles/obj.TritonLLVMIR.dir/LLVMIRTranslation.cpp.o] Error 1
make[2]: Leaving directory '/home/henry/triton/python/build/temp.linux-x86_64-3.9'
CMakeFiles/Makefile2:2755: recipe for target 'lib/Target/LLVMIR/CMakeFiles/obj.TritonLLVMIR.dir/all' failed
make[1]: *** [lib/Target/LLVMIR/CMakeFiles/obj.TritonLLVMIR.dir/all] Error 2
make[1]: Leaving directory '/home/henry/triton/python/build/temp.linux-x86_64-3.9'
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/henry/triton/python/setup.py", line 171, in <module>
setup(
File "/home/henry/anaconda3/envs/palm/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/henry/anaconda3/envs/palm/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/henry/anaconda3/envs/palm/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/henry/anaconda3/envs/palm/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/henry/anaconda3/envs/palm/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/henry/anaconda3/envs/palm/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "/home/henry/anaconda3/envs/palm/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/henry/anaconda3/envs/palm/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/henry/triton/python/setup.py", line 126, in run
self.build_extension(ext)
File "/home/henry/triton/python/setup.py", line 168, in build_extension
subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=self.build_temp)
File "/home/henry/anaconda3/envs/palm/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'TritonRelBuildWithAsserts', '--', '-j24']' returned non-zero exit status 2.
[end of output] |
Obtaining file:///home/henry/triton/python
Collecting cmake (from triton==2.0.0)
Downloading https://files.pythonhosted.org/packages/e9/67/3d545c3a706bc427b1bd2a9108e3986dfc8c1450be0da8149fe591902875/cmake-3.25.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-7nv5_q__/cmake/setup.py", line 8, in <module>
from skbuild import setup
ModuleNotFoundError: No module named 'skbuild'
---------------------------------------- |
@conceptofmind what compiler version are you using. It seems like your compiler doesn't support @vedantroy it looks like the LLVM download was interrupted somehow during your install. Triton installer currently doesn't check md5 or integrity of the downloaded archive. Can you delete ~/.triton/cache and retry? |
@ptillet I am pretty sure it is GCC on Ubuntu 18.04. I do not think it is MinGW. I will have to check the version when I get back. I was also having a problem with the installation constantly stopping. I would have to keep installing it to progress. It stopped working around 91%. |
@conceptofmind @ptillet , I can reproduce conceptofmind's skbuild error with the following docker:
I can avoid the above error by using this line:
but then I run into this error:
I know I can build Triton with this Dockerfile:
so maybe Triton just does not build on old versions of Ubuntu for some reason. |
Yeah, Ubuntu 18.04 includes GCC 7.5.0 by default, which doesn't support C++17. You can still use Ubuntu 18.04 but you have to install a more recent version of gcc/clang. As for the other errors, we'll look into it when we have some time, we're still firefighting some issues with the new backend. |
And FYI wheel built on Ubuntu 22 + CUDA 12 should work everywhere. Triton isn't tied to any CUDA version. |
I will update my gcc/clang compiler later and let you know if the issue is resolved. |
@ptillet Works now with gcc/g++ 9. Was able to install from the source and run the Triton version of Flash Attention. |
I solved the issue uninstall it triton, installing and again uninstall it |
Hi all,
I am working on integrating the Triton version of Flash Attention in a GPT-like model.
For some reason I am receiving this error:
TypeError: dot() got an unexpected keyword argument 'trans_b'
Here is a snippet of the code where the error is occurring:
Any help would be appreciated.
Thank you,
Enrico
The text was updated successfully, but these errors were encountered: