localGPT
localGPT copied to clipboard
This is the error i get when i start ingest.py
─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ E:\localGPT\ingest.py:49 in param_applied
, so we have to use │
│ 818 │ │ │ # with torch.no_grad():
│
│ 819 │ │ │ with torch.no_grad(): │
│ ❱ 820 │ │ │ │ param_applied = fn(param) │
│ 821 │ │ │ should_use_set_data = compute_should_use_set_data(param, param_applied) │
│ 822 │ │ │ if should_use_set_data: │
│ 823 │ │ │ │ param.data = param_applied │
│ │
│ E:\Python\Python310\lib\site-packages\torch\nn\modules\module.py:1143 in convert │
│ │
│ 1140 │ │ │ if convert_to_format is not None and t.dim() in (4, 5): │
│ 1141 │ │ │ │ return t.to(device, dtype if t.is_floating_point() or t.is_complex() els │
│ 1142 │ │ │ │ │ │ │ non_blocking, memory_format=convert_to_format) │
│ ❱ 1143 │ │ │ return t.to(device, dtype if t.is_floating_point() or t.is_complex() else No │
│ 1144 │ │ │
│ 1145 │ │ return self.apply(convert) │
│ 1146 │
│ │
│ E:\Python\Python310\lib\site-packages\torch\cuda_init.py:239 in _lazy_init │
│ │
│ 236 │ │ │ │ "Cannot re-initialize CUDA in forked subprocess. To use CUDA with " │
│ 237 │ │ │ │ "multiprocessing, you must use the 'spawn' start method") │
│ 238 │ │ if not hasattr(torch._C, '_cuda_getDeviceCount'): │
│ ❱ 239 │ │ │ raise AssertionError("Torch not compiled with CUDA enabled") │
│ 240 │ │ if _cudart is None: │
│ 241 │ │ │ raise AssertionError( │
│ 242 │ │ │ │ "libcudart functions unavailable. It looks like you have a broken build? │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AssertionError: Torch not compiled with CUDA enabled
I have nvidia 3070, is vram an issue? bcz before this error, E:\localGPT>python ingest.py Loading documents from E:\localGPT/SOURCE_DOCUMENTS Loaded 1 documents from E:\localGPT/SOURCE_DOCUMENTS Split into 141 chunks of text load INSTRUCTOR_Transformer max_seq_length 512 Using embedded DuckDB with persistence: data will be stored in: E:\localGPT
You don't have the correct version of torch installed. I would remove them with pip uninstall torch torchvision and then reinstall with pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
Then check it with
>>> import torch
>>> torch.cuda.is_available()
True
hth
I have nvidia 3070, is vram an issue? bcz before this error, E:\localGPT>python ingest.py Loading documents from E:\localGPT/SOURCE_DOCUMENTS Loaded 1 documents from E:\localGPT/SOURCE_DOCUMENTS Split into 141 chunks of text load INSTRUCTOR_Transformer max_seq_length 512 Using embedded DuckDB with persistence: data will be stored in: E:\localGPT
VRAM isn't an issue i'm working on a 48GB A6000 and I got the same issue. Fixed it by doing what @SpeedOfSpin did.
@SpeedOfSpin Thx your advice worked out, however it got me the next sort of error. Tried to solve this via documentation but it is way beyond my scripting skills. The error was:
OutOfMemoryError: CUDA out of memory. Tried to allocate 898.00 MiB (GPU 0; 8.00 GiB total capacity; 7.21 GiB already allocated; 0 bytes free; 7.22 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
I have a NVIDIA Geforce 3070 TI Laptop GPU with 8 Gb RAM. I dont know how to reduce the PyTorch allocation of memory or why it is doing it. The documentation states somewhere that I should try to reduce the batch size, but don't know how to do it because I could not find that in de code.
I am having the same issue, on very similar hardware to @Anarjoy. I am on a RTX 3060 Laptop GPU. In fact, I have had this exact issue with stable diffusion, but with that, it wasn't detecting my GPU. With LocalGPT my GPU is detected, but I still run into this out of memory
issue.
@Anarjoy @letrad, I had the same issue. I was able to get it running on a RTX 2070 Super by reducing the chunk_size to 400 and the chunk_overlap to 100. To be honest, I'm not deep enough in the topic to understand if fiddling with that has any other consequences, but at least it went through (and gave my GPU a proper stress-test while doing so haha). So you might want to play around with these params a little bit too.
Interesting, will check it out. Was this achieved through environmental variables? What system are you on as well?
@MichaBrugger
@SpeedOfSpin How do we know which version to install?
AssertionError: Torch not compiled with CUDA enabled
# Name Version Build Channel
pytorch 2.0.1 py3.11_cuda11.8_cudnn8_0 pytorch
pytorch-cuda 11.8 h24eeafa_5 pytorch
pytorch-mutex 1.0 cuda pytorch
Running your command says
WARNING: The index url "download.pytorch.org/whl/cu117" seems invalid, please provide a scheme.
The official recommended string is slightly different:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
https://pytorch.org/get-started/locally/
That works for me (though I then get torch.cuda.OutOfMemoryError
)
How can we add this to requirements.txt
?