内容纲要

ChatGLM折腾小记

ChatGLM

没啥好说的,跑得很顺利,就是纯CPU太慢了。3060 6GB显存大概跑15个会话左右会爆显存。

因为手头没有>6GB显存的GPU没法做微调,所以原模型微调部分待更新。。。

ChatGLM-MNN / jittorLLM

Windows编译只能使用VS 2019/2017

首先Windows下必须用VS 2019或者VS 2017编译,VS 2022不行,如果默认不是19或17要用-G参数指定

Windows下编译MNN 2.5启用CUDA报错

看到个解决方案:https://github.com/alibaba/MNN/issues/2321

-DMNN_WIN_RUNTIME_MT=ON -DMNN_BUILD_SHARED_LIBS=ON

chat.cpp编译报错

为什么会有个非utf8字符呢,开发者在搞什么
https://github.com/wangzhaode/ChatGLM-MNN/issues/58

使用CUDA 12貌似会出问题,建议CUDA11/10

https://github.com/wangzhaode/ChatGLM-MNN/issues/64

Jittor的cudnn建议使用8.2/8.1版本

高了会报错,别问我怎么知道的

阻止Jittor下载cuda和cudnn使用系统默认的

设置环境变量nvcc_path等,还有啥dir啥的变量,忘了。。。

linux设置环境变量

export nvcc_path="/path/to/cuda"
echo $nvcc_path

Windows cmd设置环境变量

set nvcc_path=/path/to/cuda
echo %nvcc_path%

Windows Powershell设置环境变量

$env:nvcc_path="/path/to/cuda"
echo $nvc_path

他的代码有问题,还需要修改pip安装的jittor的compiler.py文件,相对路径Lib\site-packages\jittor\compiler.py
注释第972行

# if jtcuda is already installed
nvcc_path = None
if install_cuda.has_installation() or os.name == 'nt':
    # nvcc_path = install_cuda.install_cuda()
    if nvcc_path:
        nvcc_path = try_find_exe(nvcc_path)
# check system installed cuda
if not nvcc_path:
    nvcc_path = env_or_try_find('nvcc_path', 'nvcc') or \
        try_find_exe('/usr/local/cuda/bin/nvcc') or \
        try_find_exe('/usr/bin/nvcc') or \
        try_find_exe('/opt/cuda/bin/nvcc')

jittor禁用cuda

设置环境变量nvcc_path="",但是windows下没法设置空环境变量,需要改代码来实现禁用cuda。。。

FastLLM

No CUDA toolset found

以CUDA 11.4和VS 2019默认安装路径为例

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\extras\visual_studio_integrationC:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations下的文件复制到C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations

未完待续…

Leave a Reply

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据