ludwig GPU不可用

lqfhib0f  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(50)

你好,大家好。
首先,我对训练和微调LLMs非常陌生,所以我的问题可能很简单(也可能不简单)。请原谅我对于这方面的无知。
系统:
Windows 11
Python 3.10
Ludwig 0.10
我在本地创建了一个虚拟环境,然后使用pip安装了ludwig。我的properties.yaml文件似乎没有问题,因为模型可以正常加载。
我尝试在本地从HF下载的模型上调用model.generate(),只是看看它是否能生成某种输出。但我只得到了这个错误:

PyTorch version 2.2.1 available.
C:\Users\Name\OneDrive\Dokumente\Python\Tetera\Tetera\.venv\lib\site-packages\bitsandbytes\cextension.py:34: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable.
  warn("The installed version of bitsandbytes was compiled without GPU support. "

'NoneType' object has no attribute 'cadam32bit_grad_fp32'
Setting generation max_new_tokens to 16384 to correspond with the max sequence length assigned to the output feature or the global max sequence length. This will ensure that the correct number of tokens are generated at inference time. To override this behavior, set `generation.max_new_tokens` to a different value in your Ludwig config.

Traceback (most recent call last):
  File "C:\Users\fabio\OneDrive\Dokumente\Python\Tetera\Tetera\app.py", line 7, in <module>
    print(model.generate("Hello World"))
  File "C:\Users\fabio\OneDrive\Dokumente\Python\Tetera\Tetera\.venv\lib\site-packages\ludwig\api.py", line 990, in generate
    raise ValueError("GPU is not available.")
ValueError: GPU is not available.

我有位数和字节的问题吗?还是说是torch的问题?
torch.cuda.is_available() 也返回false。
或者我需要创建一个Anaconda3环境吗?我在那个环境中测试过,通过conda install安装了pytorch,然后torch.cuda.is_available()返回true。但是Ludwig似乎在这个环境中无法正常工作(?)
非常感谢任何帮助。我的目标是至少让这个东西运行起来。

bybem2ql

bybem2ql1#

看起来您在使用PyTorch时遇到了GPU问题。我在A770上使用正常。以下是更直接的方法来解决这个问题:

确保您的显卡驱动程序是最新的,并且PyTorch需要正确的CUDA版本。可以在这里查看PyTorch安装指南 - https://pytorch.org/get-started/locally/ ,选择与您的CUDA版本匹配的构建。

由于警告提示缺少GPU支持,请按照此文档 https://github.com/TimDettmers/bitsandbytes 安装一个与GPU兼容的版本。

对于环境设置,虽然Anaconda可以简化软件包管理,但并非必须。无论您使用pip还是Conda,都要确保安装带有GPU支持的软件包。

另外,英特尔提供了优化工具,可以帮助提高在英特尔硬件上的AI应用程序性能。可以参考英特尔针对PyTorch的优化 https://www.intel.com/content/www/us/en/developer/tools/oneapi/optimization-for-pytorch.html#gs.clz6p0 ,该工具旨在加速在英特尔处理器上的PyTorch性能。

如果 torch.cuda.is_available( 仍然为False,那么您的系统可能与CUDA不完全兼容,或者存在GPU设置问题。

希望这对您有所帮助。

相关问题