Amalia LLM: inference on Deucalion
This document describes a simple process for setting up AMALIA-9B inference on Deucalion using the vLLM engine and a singularity container.
Environment Setup
vLLM Container
We are going to use a container with vLLM installed, available in the following directory:
Model
AMALIA-9B is available on Deucalion in the following directory:
Serving the model
AMALIA-9B can run on a single A100 40GB GPU. Follow the steps below to serve the model.
-
SSH to Deucalion
-
Allocate a GPU on Deucalion
Info
This command allocates an interative session on a single node (
-n 1) with 32 threads per process (-c 32). The session is allocated on a GPU partition (normal-a100-40), using 1 gpus (--gres=gpu:1) and is configured to last 1 hour (-t 01:00:00).You can find your
<project_name>by running the commandbillingon Deucalion. -
Run the vLLM container
-
Serve the model
If you followed the steps correctly, you should see a message Application startup complete indicating the model is being served succesfully.
Serve via sbatch
Alternatively, you can serve the model by submitting the following bash script to the Slurm queue.
#!/bin/bash
#SBATCH --job-name=vllm_amalia
#SBATCH --partition=normal-a100-40
#SBATCH --account=your_project_account
#SBATCH --time=02:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --gpus=1
#SBATCH --cpus-per-task=32
#SBATCH --error="slurm-vllm-serve.err"
#SBATCH --output="slurm-vllm-serve.out"
MODEL="AMALIA-9B-0626-DPO"
MODEL_PATH="/share/data/models/llms/${MODEL}"
CONTAINER_PATH="/share/data/models/llms/vllm_0.21.0.sif"
CMD_VLLM="vllm serve /${MODEL} \
--host 0.0.0.0 \
--port 8000 \
--served-model-name ${MODEL}"
singularity exec --nv --bind ${MODEL_PATH}:/${MODEL} ${CONTAINER_PATH} ${CMD_VLLM}
Submit the job using sbatch:
Monitor the status of your job on the queue:
Check the logs to ensure the model is being served successfully:
The Application startup complete message will indicate when the model is being served succesfully.
Interact with Amalia
After the successful startup, the model will be served in the following endpoint:
Where <NODE_HOSTNAME> is the gpu node that is being used to serve the model (e.g. gnx516).
You can make requests to the model as in: