llm部署实录

备忘用

Yi

docker

pull,run,start,stop,attach,rm
不知道为啥exec没法调用python
网络:host
挂载文件夹
sudo docker run --gpus all -i -t -v /home/aistudio/llm/yi:/home/yi/workspace/Yi/vf --net=host --name llm_yi registry.lingyiwanwu.com/ci/01-ai/yi:latest

clash

sudo bash start.sh
source /etc/profile.d/clash.sh
proxy_on
netstat -tln | grep -E '9090|789.'
env | grep -E 'http_proxy|https_proxy'

其实proxy_on就是把http_proxyhttps_proxy改成http://127.0.0.1:7890,所以在docker容器里可以直接export http_proxy=http://127.0.0.1:7890(要host模式,仅限当前终端)

测试:curl cip.cc

proxychains4

不能有两个127.0.0.1

apt不能用,要改/etc/apt/apt.conf

安装rocm和torch

别忘了加权限
https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/install-radeon.html
Set permissions for Groups to allow access to GPU hardware resources
否则没法使用硬件资源,torch.cuda.is_available()会是false

boot

ESC进bios, F11进boot menu

IPMI

IPMI密码超微主板默认ADMIN,ADMIN
IPMI地址可以在bios里看,也可以远程用ipmitool看,详见 sudo ipmitool lan print 1

huggingface镜像站

export HF_ENDPOINT=https://hf-mirror.com
cache:
export HF_DATASETS_CACHE="/home/user/data/cache" export HF_HOME="/home/user/data/cache" export HUGGINGFACE_HUB_CACHE="/home/user/data/cache" export HF_ENDPOINT=https://hf-mirror.com

pip换源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

卡在Using …\Cache\py310_cu121 as PyTorch extensions root…

把cache里的删掉即可

screen

screen 启动

screen -r XXX 重新连接

hf dataset下载

huggingface-cli download --repo-type dataset --token hf_** --resume-download ibrahimhamamci/CT-RATE --cache-dir /home/local-dir --local-dir-use-symlinks False

监视rocm-smi

watch -n 1 rocm-smi

torch.cuda.set_device(DEVICE)

计算torch运行时间时要设置好cuda对应的gpu,否则torch.cuda.synchronize()就无法等待对应的GPU上的线程完成(默认是GPU0)

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值