Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- README.md +153 -0
- vllm-berag-2ca4f5b4-v0.24.0-cu129.sif +3 -0
- vllm-berag-2ca4f5b4-v0.24.0-cu129.sif.sha256 +1 -0
- vllm-berag.def +51 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
vllm-berag-2ca4f5b4-v0.24.0-cu129.sif filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: vLLM-BERAG Apptainer container
|
| 3 |
+
tags:
|
| 4 |
+
- apptainer
|
| 5 |
+
- singularity
|
| 6 |
+
- vllm
|
| 7 |
+
- cuda
|
| 8 |
+
- berag
|
| 9 |
+
- inference
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# vLLM-BERAG Apptainer container
|
| 13 |
+
|
| 14 |
+
This repository distributes a prebuilt Apptainer SIF containing the
|
| 15 |
+
vLLM-BERAG inference environment. It is intended for NVIDIA GPU jobs on HPC
|
| 16 |
+
systems where reading a Python environment containing many small files from a
|
| 17 |
+
shared filesystem is slow.
|
| 18 |
+
|
| 19 |
+
The image combines the compiled CUDA extensions from
|
| 20 |
+
`vllm/vllm-openai:v0.24.0-cu129` with the BERAG Python implementation from
|
| 21 |
+
source revision `2ca4f5b4fe3aa8018ee5f6bd014a6684570642d9`.
|
| 22 |
+
|
| 23 |
+
## Artifact
|
| 24 |
+
|
| 25 |
+
| Property | Value |
|
| 26 |
+
| --- | --- |
|
| 27 |
+
| File | `vllm-berag-2ca4f5b4-v0.24.0-cu129.sif` |
|
| 28 |
+
| Size | 11,181,588,480 bytes |
|
| 29 |
+
| SHA-256 | `7ad083a42a9273547b643610165d71cdef6333e02a399d8754dc1caac109c8fd` |
|
| 30 |
+
| vLLM | 0.24.0 with BERAG extensions |
|
| 31 |
+
| PyTorch | 2.11.0+cu129 |
|
| 32 |
+
| CUDA runtime | 12.9 |
|
| 33 |
+
| Architecture | Linux x86-64 |
|
| 34 |
+
|
| 35 |
+
Model weights, datasets, and LoRA adapters are not included.
|
| 36 |
+
|
| 37 |
+
## Requirements
|
| 38 |
+
|
| 39 |
+
- Apptainer with NVIDIA support.
|
| 40 |
+
- An NVIDIA GPU and a host driver compatible with the CUDA 12.9 runtime.
|
| 41 |
+
- Sufficient node-local storage for the approximately 11 GB SIF and runtime
|
| 42 |
+
caches.
|
| 43 |
+
|
| 44 |
+
The image was tested with Apptainer 1.5.2 on an NVIDIA A100-SXM4-80GB.
|
| 45 |
+
|
| 46 |
+
## Download
|
| 47 |
+
|
| 48 |
+
Replace `YOUR_HF_USERNAME/vllm-berag-container` with this repository's Hub ID:
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
REPO_ID="YOUR_HF_USERNAME/vllm-berag-container"
|
| 52 |
+
LOCAL_DIR="${SLURM_TMPDIR:-/var/tmp/$USER/vllm-berag-container}"
|
| 53 |
+
|
| 54 |
+
mkdir -p "$LOCAL_DIR"
|
| 55 |
+
|
| 56 |
+
hf download "$REPO_ID" \
|
| 57 |
+
vllm-berag-2ca4f5b4-v0.24.0-cu129.sif \
|
| 58 |
+
vllm-berag-2ca4f5b4-v0.24.0-cu129.sif.sha256 \
|
| 59 |
+
--repo-type dataset \
|
| 60 |
+
--local-dir "$LOCAL_DIR"
|
| 61 |
+
|
| 62 |
+
cd "$LOCAL_DIR"
|
| 63 |
+
sha256sum -c vllm-berag-2ca4f5b4-v0.24.0-cu129.sif.sha256
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## GPU smoke test
|
| 67 |
+
|
| 68 |
+
Use a node-local directory for JIT and framework caches. Bind an existing
|
| 69 |
+
Hugging Face model cache to `/cache/huggingface` if model access is needed.
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
IMAGE="$LOCAL_DIR/vllm-berag-2ca4f5b4-v0.24.0-cu129.sif"
|
| 73 |
+
RUNTIME_ROOT="${SLURM_TMPDIR:-/var/tmp/$USER/vllm-berag-runtime}"
|
| 74 |
+
HF_CACHE_HOST="/path/to/your/HF_HOME"
|
| 75 |
+
|
| 76 |
+
mkdir -p \
|
| 77 |
+
"$RUNTIME_ROOT/xdg" \
|
| 78 |
+
"$RUNTIME_ROOT/vllm" \
|
| 79 |
+
"$RUNTIME_ROOT/triton" \
|
| 80 |
+
"$RUNTIME_ROOT/torchinductor"
|
| 81 |
+
|
| 82 |
+
env -u CUDA_HOME -u CUDA_PATH -u CUDA_ROOT \
|
| 83 |
+
apptainer exec \
|
| 84 |
+
--nv \
|
| 85 |
+
--cleanenv \
|
| 86 |
+
--bind "$HF_CACHE_HOST:/cache/huggingface" \
|
| 87 |
+
--bind "$RUNTIME_ROOT:/runtime-cache" \
|
| 88 |
+
--env VLLM_USE_FLASHINFER_SAMPLER=0 \
|
| 89 |
+
--env XDG_CACHE_HOME=/runtime-cache/xdg \
|
| 90 |
+
--env VLLM_CACHE_ROOT=/runtime-cache/vllm \
|
| 91 |
+
--env FLASHINFER_WORKSPACE_BASE=/runtime-cache \
|
| 92 |
+
--env TRITON_CACHE_DIR=/runtime-cache/triton \
|
| 93 |
+
--env TORCHINDUCTOR_CACHE_DIR=/runtime-cache/torchinductor \
|
| 94 |
+
"$IMAGE" \
|
| 95 |
+
python3 -c '
|
| 96 |
+
import inspect
|
| 97 |
+
import torch
|
| 98 |
+
import vllm
|
| 99 |
+
import vllm._C_stable_libtorch
|
| 100 |
+
|
| 101 |
+
print("vLLM:", vllm.__version__)
|
| 102 |
+
print("CUDA:", torch.version.cuda)
|
| 103 |
+
print("GPU:", torch.cuda.get_device_name(0))
|
| 104 |
+
print("generate_berag:", inspect.signature(vllm.LLM.generate_berag))
|
| 105 |
+
'
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Successful output should report CUDA 12.9, the allocated GPU, and the
|
| 109 |
+
`LLM.generate_berag` signature.
|
| 110 |
+
|
| 111 |
+
## BERAG API
|
| 112 |
+
|
| 113 |
+
The synchronous entry point is:
|
| 114 |
+
|
| 115 |
+
```python
|
| 116 |
+
LLM.generate_berag(
|
| 117 |
+
shared_prefix,
|
| 118 |
+
documents,
|
| 119 |
+
suffix,
|
| 120 |
+
sampling_params=None,
|
| 121 |
+
*,
|
| 122 |
+
berag_params=None,
|
| 123 |
+
request_id=None,
|
| 124 |
+
use_tqdm=True,
|
| 125 |
+
lora_request=None,
|
| 126 |
+
priority=None,
|
| 127 |
+
tokenization_kwargs=None,
|
| 128 |
+
debug=False,
|
| 129 |
+
)
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
Per-request BERAG settings use `vllm.berag.BeragParams`, with
|
| 133 |
+
`pruning_top_p` and optional `prior_token_indices` fields.
|
| 134 |
+
|
| 135 |
+
## Operational notes
|
| 136 |
+
|
| 137 |
+
- Do not load a host CUDA toolkit into the container. `apptainer exec --nv`
|
| 138 |
+
provides the host NVIDIA driver libraries; stale `CUDA_HOME` values can
|
| 139 |
+
point JIT compilation at a nonexistent toolkit.
|
| 140 |
+
- `VLLM_USE_FLASHINFER_SAMPLER=0` avoids runtime FlashInfer sampler
|
| 141 |
+
compilation in this runtime-only image.
|
| 142 |
+
- Keep model weights on shared storage if necessary, but stage the SIF and
|
| 143 |
+
runtime caches on node-local storage.
|
| 144 |
+
- This image is intended for trusted offline or batch inference. Review vLLM
|
| 145 |
+
serving security guidance before exposing an API endpoint.
|
| 146 |
+
|
| 147 |
+
## Provenance and licensing
|
| 148 |
+
|
| 149 |
+
The SIF bundles software from multiple upstream projects, including vLLM,
|
| 150 |
+
PyTorch, NVIDIA CUDA runtime libraries, and their transitive dependencies.
|
| 151 |
+
Each component retains its own license and terms. Review the applicable
|
| 152 |
+
upstream licenses and redistribution terms before changing this Hub repository
|
| 153 |
+
from private to public.
|
vllm-berag-2ca4f5b4-v0.24.0-cu129.sif
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ad083a42a9273547b643610165d71cdef6333e02a399d8754dc1caac109c8fd
|
| 3 |
+
size 11181588480
|
vllm-berag-2ca4f5b4-v0.24.0-cu129.sif.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
7ad083a42a9273547b643610165d71cdef6333e02a399d8754dc1caac109c8fd vllm-berag-2ca4f5b4-v0.24.0-cu129.sif
|
vllm-berag.def
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Bootstrap: localimage
|
| 2 |
+
From: ./vllm-v0.24.0-cu129.sif
|
| 3 |
+
|
| 4 |
+
%labels
|
| 5 |
+
org.opencontainers.image.title vllm-berag
|
| 6 |
+
org.opencontainers.image.base.name vllm/vllm-openai:v0.24.0-cu129
|
| 7 |
+
org.opencontainers.image.revision 2ca4f5b4fe3aa8018ee5f6bd014a6684570642d9
|
| 8 |
+
org.opencontainers.image.source https://github.com/EriChen0615/vllm-berag
|
| 9 |
+
|
| 10 |
+
%files
|
| 11 |
+
./build/vllm-berag-src /opt/
|
| 12 |
+
|
| 13 |
+
%post
|
| 14 |
+
set -eu
|
| 15 |
+
|
| 16 |
+
VLLM_PACKAGE_DIR=/usr/local/lib/python3.12/dist-packages/vllm
|
| 17 |
+
test -d "$VLLM_PACKAGE_DIR"
|
| 18 |
+
test -d /opt/vllm-berag-src/vllm
|
| 19 |
+
|
| 20 |
+
# Preserve the base image's compiled extensions while replacing and
|
| 21 |
+
# adding the Python files from the BERAG source snapshot.
|
| 22 |
+
cp -a /opt/vllm-berag-src/vllm/. "$VLLM_PACKAGE_DIR/"
|
| 23 |
+
|
| 24 |
+
%environment
|
| 25 |
+
export HF_HOME=/cache/huggingface
|
| 26 |
+
export PYTHONUNBUFFERED=1
|
| 27 |
+
export VLLM_USAGE_SOURCE=production-sif-image
|
| 28 |
+
|
| 29 |
+
%test
|
| 30 |
+
VLLM_PACKAGE_DIR=/usr/local/lib/python3.12/dist-packages/vllm
|
| 31 |
+
test -f "$VLLM_PACKAGE_DIR/berag.py"
|
| 32 |
+
grep -q 'def generate_berag' "$VLLM_PACKAGE_DIR/entrypoints/llm.py"
|
| 33 |
+
find "$VLLM_PACKAGE_DIR" -maxdepth 1 \
|
| 34 |
+
-name '_C_stable_libtorch*.so' -print -quit | grep -q .
|
| 35 |
+
|
| 36 |
+
%runscript
|
| 37 |
+
exec vllm serve "$@"
|
| 38 |
+
|
| 39 |
+
%help
|
| 40 |
+
vllm-berag based on vllm/vllm-openai:v0.24.0-cu129.
|
| 41 |
+
|
| 42 |
+
The BERAG source snapshot is stored at /opt/vllm-berag-src. Its Python
|
| 43 |
+
files are merged into the upstream package at build time so that the
|
| 44 |
+
base image's compiled CUDA extensions are preserved.
|
| 45 |
+
|
| 46 |
+
Run with NVIDIA GPU support, for example:
|
| 47 |
+
|
| 48 |
+
apptainer exec --nv IMAGE.sif python3 -c \
|
| 49 |
+
'import torch, vllm; print(vllm.__file__); print(torch.__version__)'
|
| 50 |
+
|
| 51 |
+
apptainer run --nv IMAGE.sif MODEL_NAME --host 0.0.0.0 --port 8000
|