<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    paulwong

    #

    量化大模型工具

    VLLM量化推理
    https://llmc-zhcn.readthedocs.io/en/latest/backend/vllm.html#id1

    安裝此工具前需安裝兩個包:
    sudo apt-get install cmake
    sudo apt-get install pkgconfig

    配置huggingface鏡像地址:
    export HF_ENDPOINT=https://hf-mirror.com

    下載代碼庫, 并安裝python依賴
    git clone https://github.com/ModelTC/llmc.git
    cd llmc/
    pip install -r requirements.txt

    找到量化方法的配置文件, 并作修改
    base:
        seed: &seed 42
    model:
        type: Llama
        path: /home/paul/.cache/huggingface/models/models--unsloth--llama-3-8b-Instruct-lawdata
        torch_dtype: auto
    quant:
        method: RTN
        weight:
            bit: 8
            symmetric: True
            granularity: per_group
            group_size: 128
            need_pack: True
    eval:
        eval_pos: [fake_quant]
        name: wikitext2
        download: True
        path: /home/paul/paulwong/work/workspaces/llmc/dataset
        bs: 1
        seq_len: 2048
        inference_per_block: False
    save:
        save_vllm: True
        save_path: /home/paul/.cache/huggingface/models/models--unsloth--llama-3-8b-Instruct-lawdata-quantization

    找到run_llmc.sh, 并作修改
    #!/bin/bash

    # export CUDA_VISIBLE_DEVICES=0,1

    llmc=/home/paul/paulwong/work/workspaces/llmc
    export PYTHONPATH=$llmc:$PYTHONPATH

    # task_name=awq_w_only
    # config=${llmc}/configs/quantization/methods/Awq/awq_w_only.yml
    task_name=rtn_for_vllm
    config=${llmc}/configs/quantization/backend/vllm/rtn_w8a16.yml

    nnodes=1
    nproc_per_node=1


    find_unused_port() {
        while true; do
            port=$(shuf -i 10000-60000 -n 1)
            if ! ss -tuln | grep -q ":$port "; then
                echo "$port"
                return 0
            fi
        done
    }
    UNUSED_PORT=$(find_unused_port)


    MASTER_ADDR=127.0.0.1
    MASTER_PORT=$UNUSED_PORT
    task_id=$UNUSED_PORT

    nohup \
    torchrun \
    --nnodes $nnodes \
    --nproc_per_node $nproc_per_node \
    --rdzv_id $task_id \
    --rdzv_backend c10d \
    --rdzv_endpoint $MASTER_ADDR:$MASTER_PORT \
    ${llmc}/llmc/__main__.py --config $config --task_id $task_id \
    > ${task_name}.log 2>&1 &

    sleep 2
    ps aux | grep '__main__.py' | grep $task_id | awk '{print $2}' > ${task_name}.pid

    # You can kill this program by 
    # xargs kill -9 < xxx.pid
    # xxx.pid is ${task_name}.pid file

    執行量化操作
    bash scripts/run_llmc.sh




    posted @ 2025-01-15 18:00 paulwong 閱讀(89) | 評論 (0)編輯 收藏

    微調資源

    Fine-tune Llama 3.1 Ultra-Efficiently with Unsloth
    https://huggingface.co/blog/mlabonne/sft-llama3

    A beginners guide to fine tuning LLM using LoRA
    https://zohaib.me/a-beginners-guide-to-fine-tuning-llm-using-lora/

    【Day 23】調教你的 AI 寵物:用微調讓 LLM 乖乖聽話
    https://ithelp.ithome.com.tw/articles/10346441


    posted @ 2025-01-15 17:56 paulwong 閱讀(68) | 評論 (0)編輯 收藏

    安裝docker版的Nvidia container toolkit

    https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installation

    posted @ 2025-01-13 14:20 paulwong 閱讀(45) | 評論 (0)編輯 收藏

    開源鏡像庫

    華為:
    https://mirrors.huaweicloud.com/home
    https://mirrors.huaweicloud.com/artifactory/pypi-public/simple/torch/

    清華:
    https://mirrors.tuna.tsinghua.edu.cn
    點擊問號進詳情

    docker:
    https://mirrors.huaweicloud.com/mirrorDetail/5ea14d84b58d16ef329c5c13?mirrorName=docker-ce&catalog=docker

    posted @ 2025-01-13 10:32 paulwong 閱讀(89) | 評論 (0)編輯 收藏

    windows中添加端口轉發規則

    設置端口轉發

    在 Windows 上,以管理員身份打開 PowerShell,
    netsh interface portproxy add v4tov4 listenport=7860 listenaddress=0.0.0.0 connectport=7860 connectaddress=123.45.67.89

    在 PowerShell 中使用 netsh interface portproxy 命令設置的端口轉發規則是持久性的。這些規則會在系統重啟后繼續生效,因為它們被存儲在 Windows 的注冊表中。

    刪除端口轉發規則

    如果想刪除之前設置的端口轉發規則,可以使用以下命令:
    netsh interface portproxy delete v4tov4 listenport=7860 listenaddress=0.0.0.0

    這里的 listenport 和 listenaddress 應與之前設置時的值一致。

    查看當前的端口轉發規則

    要查看當前系統中所有的端口轉發規則,可以運行:
    netsh interface portproxy show all


    posted @ 2025-01-13 09:34 paulwong 閱讀(135) | 評論 (0)編輯 收藏

    AI微調框架axolotl安裝

    1. N卡驅動和toolkit安裝
    https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=runfile_local
     
    2. python和mini-conda安裝
    基本是要下載安裝包安裝,
    python下載地址:https://repo.huaweicloud.com/python/3.12.8/
    m
    ini-conda下載地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
    co
    nda清華資源:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/


    3. 新建一個conda環境
    conda create -n axolotl python=3.12

    4. cuda版本的pytorch安裝
    https://download.pytorch.org/whl/cu124/torch-2.5.0%2Bcu124-cp311-cp311-linux_x86_64.whl#sha256=5e3f4a7ba812517c2c1659857b5195f287a288fbd050a5abf9311e03dbe1a28b
    如想安裝其他版本, 可從以下網址查找:
    https://download.pytorch.org/whl/torch

    5. git clone https://github.com/axolotl-ai-cloud/axolotl, cd到根目錄, 運行
    pip3 install --no-build-isolation axolotl[flash-attn,deepspeed]





    posted @ 2025-01-12 16:37 paulwong 閱讀(60) | 評論 (0)編輯 收藏

    內網穿透工具

    將內網, 如家庭中的使用wifi建立的網站, 發布到外網, 而無需使用服務器.

    https://i.cpolar.com/m/5jN0

    reference:
    https://www.cpolar.com/blog/cpolar-quick-start-tutorial-ubuntu-series

    posted @ 2025-01-12 11:54 paulwong 閱讀(158) | 評論 (0)編輯 收藏

    安裝cuda版本的pytorch

    先下載cuda版本的pytorch的整個打包文件:
    https://download.pytorch.org/whl/cu124/torch-2.5.1%2Bcu124-cp312-cp312-linux_x86_64.whl#sha256=bf6484bfe5bc4f92a4a1a1bf553041505e19a911f717065330eb061afe0e14d7
    https://mirrors.huaweicloud.com/artifactory/pypi-public/simple/torch/


    pip install torch-2.5.1+cu124-cp312-cp312-linux_x86_64.whl

    驗證:
    #python
    import torch
    torch.__version__

    posted @ 2025-01-12 11:05 paulwong 閱讀(70) | 評論 (0)編輯 收藏

    mac使用vscode遠程連接win11下的wsl2的方法

    1.首先給win11的ssh開一個新端口.(修改C:\ProgramData\ssh\sshd_config即可)

    2.win11設置防火墻,開放1中添加的端口.

    3.win11進入wsl2,輸入ifconfig,查看ip地址(輸出信息第二行 inet后面那一串數字).

    4.在win11的cmd中輸入以下命令:
    netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=<步驟1中開放的端口> connectaddress=<步驟3中得到的ip地址> connectport=22


    5. ssh連接步驟1中開放的端口就可以連接上wsl2(注意事項:(1)連接時,win11上需要有一個wsl窗口,不然連不上,(2)ssh連接時的用戶名寫wsl2中的用戶名,密碼寫wsl2中的密碼,ip地址寫win11的ip地址)

    https://www.zhihu.com/question/618935377

    posted @ 2025-01-11 09:59 paulwong 閱讀(46) | 評論 (0)編輯 收藏

    WSL資源

    誰來救救被WSL占用的磁盤空間
    https://zhuanlan.zhihu.com/p/641436638

    利用 VsCode Tunnel 在 Mac 上遠程開發
    https://juejin.cn/post/7334167506319327283

    用 WSL2 搭建 Windows 上更爽的前端開發環境
    https://www.bilibili.com/video/BV1BV4y1Z7v4/?vd_source=35b81999db00535703a287d5c98652b1

    posted @ 2025-01-11 09:57 paulwong 閱讀(31) | 評論 (0)編輯 收藏

    僅列出標題
    共115頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 
    主站蜘蛛池模板: 德国女人一级毛片免费| 国产精品福利在线观看免费不卡 | 国产免费爽爽视频在线观看| 无忧传媒视频免费观看入口| 国产成人亚洲综合无| 天天综合亚洲色在线精品| 国产精品亚洲精品日韩动图 | 久久久国产精品亚洲一区| 亚洲国产国产综合一区首页| 亚洲最大的成网4438| 亚洲码在线中文在线观看| 亚洲三级中文字幕| 亚洲男人的天堂网站| 精品亚洲成A人在线观看青青| 亚洲AV无码成人精品区日韩| 免费在线观看亚洲| 久久精品无码专区免费| 美女在线视频观看影院免费天天看 | 久久久久亚洲av无码专区蜜芽| 亚洲免费精彩视频在线观看| 亚洲精品国产电影午夜| 天堂亚洲国产中文在线| 朝桐光亚洲专区在线中文字幕 | 亚洲天堂2016| 久久亚洲精品成人无码| 一级毛片大全免费播放| 99久久国产精品免费一区二区 | 精品国产免费一区二区三区| 99国产精品免费视频观看| 成人免费一级毛片在线播放视频 | a级毛片在线免费| 91成年人免费视频| 日本免费网站在线观看| 国产成人精品久久亚洲| 亚洲人成在线电影| 亚洲日产乱码一二三区别| 日韩在线视频播放免费视频完整版| 国产成人AV免费观看| 精品久久久久国产免费| 免费a级毛片视频| 亚洲不卡av不卡一区二区|