大模型速度测试

VULTR下顶配 共享12核24G 144刀每月【我就开3小时】

  • 500 GB NVMe12 vCPUs24 GB500 GB NVMe12 TB
  • $144/month
  • $0.214/hour

之前用Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz x2 2GB 跑phi3:4b很慢看看这个效果怎么样。


root@vultr:~# free
               total        used        free      shared  buff/cache   available
Mem:        24597624      275424    23568548        1252      753652    23980252
Swap:        8388604           0     8388604
root@vultr:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 49
model name      : AMD EPYC-Rome Processor
stepping        : 0
microcode       : 0x1000065
cpu MHz         : 1996.248
cache size      : 512 KB
physical id     : 0
siblings        : 12
core id         : 0
cpu cores       : 6

位置 硅谷 Silicon Valley 
江苏电信ping 168-170ms

安装
http://el.psy.congroo.com/archives/735

phi3:4b 运行不错非常迅速 50秒
mistral:7b 速度略慢 可以接受 60s

试试qwen:110b看看 69GB 23333 2分钟才出来不到10个字

发表在 None | 留下评论

VPS安装DOCKER ubuntu 22.04

安装命令如下
sudo apt update && sudo apt install docker.io apparmor -y

sudo apt update && sudo apt install docker.io apparmor -y
发表在 None | 留下评论

VPS初探大模型OLLAMA

安装OLLAMA


系统:Ubuntu 22.04

curl https://ollama.ai/install.sh | sh

安装完成:

root@linux:~# ollama --version
ollama version is 0.1.34

开启API外部访问
Environment="OLLAMA_HOST=0.0.0.0"

vi /etc/systemd/system/ollama.service
#在最下面添加

#文件信息
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
Environment="OLLAMA_HOST=0.0.0.0"

#添加开放


[Install]
WantedBy=default.target


#重启服务
systemctl daemon-reload
systemctl restart ollama

使用


ollama run qwen:0.5b
VPS 也就这个跨域搞搞 qwen:0.5b 不然负载太高 llam2 7b(70亿数据要一分钟)

 ollama run qwen:0.5b
#直接命令行输入,即可自动下载 千问 5亿数据模型(务必联网)

#运行结束 即可在下面输入
root@linux:~# ollama run qwen:0.5b
pulling manifest
pulling manifest
pulling fad2a06e4cc7... 100% ▕████████████████▏ 394 MB
pulling 41c2cf8c272f... 100% ▕████████████████▏ 7.3 KB
pulling 1da0581fd4ce... 100% ▕████████████████▏  130 B
pulling f02dd72bb242... 100% ▕████████████████▏   59 B
pulling ea0a531a015b... 100% ▕████████████████▏  485 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> Send a message (/? for help)

相关命令


>>> /?
Available Commands:
  /set            Set session variables
  /show           Show model information
  /load <model>   Load a session or model 载入之前的回话
  /save <model>   Save your current session 保存回话
  /clear          Clear session context
  /bye            Exit 退出
  /?, /help       Help for a command
  /? shortcuts    Help for keyboard shortcuts

Use """ to begin a multi-line message.

安装DOCKER

sudo apt update && sudo apt install docker.io apparmor -y

安装OpenUI 本机情况下 (默认端口11434)

sudo docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

安装在其他IP服务器上

sudo docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://<你的服务的IP地址>:11434/api -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

 E5-2683 v4 @ 2.10GHz x2 2G VPS

llama2 7B 不行 及其卡

qwen:0.5b 极快
codegemma:9b不行 及其卡
phi3:4b 不行 及其卡

发表在 None | 留下评论

联网 network模块

import network
#联网
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(web['wifi'], web['password'])

#AP
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid="wifi_mag", password="12345678")


#IP信息
wlan.ifconfig()[0]
wlan.isconnected()
#是否联网


发表在 None | 留下评论

按键中断 irq

from machine import Pin
c=Pin(0, Pin.IN, Pin.PULL_UP)

def bt(pin):
    print("xxx")

c.irq(trigger=Pin.IRQ_FALLING,handler=bt)

Pin.PULL_UP上拉 默认为1
IO0 配置 的话 默认1 按下0 则 下降沿Pin.IRQ_FALLING
0到1 上升沿 Pin.IRQ_RISING

c.irq(trigger=Pin.IRQ_FALLING,handler=bt)
trigger 为上升下降 判断 handler为触发函数,若其他参数,需要使用lambda

handler=lambda x:bt(x)

发表在 None | 留下评论