/images/logo.png
A notebook for something

Deploy LLM with HF's TGI

remove snap

1
2
3
apt purge snap
apt autoremove --purge snapd
rm -fr /var/snap/*

installl docker

1
2
3
4
apt install docker.io
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg   && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list |     sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' |     sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
apt-get update
apt-get install -y nvidia-container-toolkit

Deploy OpenAI compatible LLM with vllm

The model we are going to use as an demo:

https://huggingface.co/WizardLM/WizardLM-13B-V1.2

Install packages

1
2
3
4
# the vllm 0.2.2 will NOT work with fschat==0.2.33, downgrade it to 0.2.23

export HUGGINGFACE_HUB_CACHE=/data/models
pip install vllm==0.2.2 fschat==0.2.23

Inatll llama2-accessory

Simple Demo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
git clone https://github.com/Alpha-VLLM/LLaMA2-Accessory.git
cd LLaMA2-Accessory
conda create -n accessory python=3.10 -y
conda activate accessory
pip install -r requirements.txt
pip install flash-attn --no-build-isolation
conda install -c nvidia cuda-nvcc


git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-build-isolation --no-cache-dir ./

ray Actor Pool

Simple Demo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

monitor screen remotely

1. Server

to be installed on the Windows machine which screen will be seen remotely

Notice the file must be named as ‘xxx.pyw’ because we need to use pythonw.exe to run this app. With pythonw, the terminal windows will not pop up.

To enable the app autostarting when the host Windows started, run these steps:

  1. Win+R to open the Run window
  2. Input command ‘shell:autostart’
  3. copy this file xxx.pyw into the Startup folder

Reference: https://support.microsoft.com/en-us/windows/add-an-app-to-run-automatically-at-startup-in-windows-10-150da165-dcd9-7230-517b-cf3c295d89dd

install lightGBM-GPU on Ubuntu

1. libs

1
2
3
apt update && apt install -y cmake ocl-icd-opencl-dev libboost-all-dev
export LIBOPENCL=/usr/local/nvidia/lib64
mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

2. repo

1
2
3
4
5
6
7
8
9