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

GPU not supported on Nvidia Jetson AGX with JetPack 5.1 #301

Open
davidtheITguy opened this issue Jan 25, 2024 · 4 comments
Open

GPU not supported on Nvidia Jetson AGX with JetPack 5.1 #301

davidtheITguy opened this issue Jan 25, 2024 · 4 comments

Comments

@davidtheITguy
Copy link

Hello,

I'm wondering if anyone has been able to get exllamav2 to work with the Jetson AGX? The requirements install removes the Nvidia CUDA libs and installs a base torch-2.1.2. Unfortunately, that won't work with the Jetson AGX. Here is my run output:

`python test_inference.py -m /ssd/llama-2/llama-2-7b-chat-hf -p "Once upon a time,"
Traceback (most recent call last):
File "test_inference.py", line 2, in
from exllamav2 import(
File "/ssd/exllamav2/exllamav2/init.py", line 3, in
from exllamav2.model import ExLlamaV2
File "/ssd/exllamav2/exllamav2/model.py", line 16, in
from exllamav2.config import ExLlamaV2Config
File "/ssd/exllamav2/exllamav2/config.py", line 2, in
from exllamav2.fasttensors import STFile
File "/ssd/exllamav2/exllamav2/fasttensors.py", line 5, in
from exllamav2.ext import exllamav2_ext as ext_c
File "/ssd/exllamav2/exllamav2/ext.py", line 142, in
exllamav2_ext = load
File "/home/david/miniconda3/envs/exllamav2/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1284, in load
return _jit_compile(
File "/home/david/miniconda3/envs/exllamav2/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "/home/david/miniconda3/envs/exllamav2/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1611, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "/home/david/miniconda3/envs/exllamav2/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2007, in _write_ninja_file_to_build_library cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()

File "/home/david/miniconda3/envs/exllamav2/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1786, in _get_cuda_arch_flagsraise ValueError(f"Unknown CUDA arch ({arch}) or GPU not supported")
ValueError: Unknown CUDA arch (8.7+PTX) or GPU not supported`

FWIW here is the latest (as of this post) Nvidia CUDA library for the AGX: 2.0.0a0+8aa34602.nv23.03.

Hoping someone has a workaround. Thank you

@turboderp
Copy link
Member

I think 8.7 was added to the Torch whitelist fairly late last year so I'm not sure what the status is for Torch 2.1.2.

You could try exporting TORCH_CUDA_ARCH_LIST="8.7+PTX" to see if that makes a difference. Otherwise Torch 2.2 just released, so that might behave differently, though I haven't had a chance to test it yet.

Could you clarify what you mean by the requirements install removing the NVIDIA CUDA libs? It shouldn't affect those, and if you already have torch>=2.1.0 installed (which should match against 2.1.2+cuxxx too) in your (v)env, it shouldn't affect that install.

@davidtheITguy
Copy link
Author

davidtheITguy commented Jan 30, 2024 via email

@turboderp
Copy link
Member

Oh. If that's a special version of Torch you have to use with the Jetson, you'll probably want to remove it from the requirements (or just install ninja, sentencepiece, safetensors etc. manually, it's not that many packages). Otherwise it will try to "upgrade" you to >= 2.1.0 which might default to the non-CUDA package.

I haven't tested on 2.0.0, and especially not that particular version of 2.0.0, but in theory it should still have all the features exllama would need.

So what I'd try is:

git clone https://github.com/turboderp/exllamav2
cd exllamav2
pip install pandas ninja fastparquet safetensors sentencepiece pygments websockets regex numpy
pip install .

@davidtheITguy
Copy link
Author

davidtheITguy commented Jan 30, 2024 via email

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