|
| 1 | +# Prefill Heavy Workload Benchmarking |
| 2 | +This guide shows how to deploy a prefill-heavy benchmarking config using inference-perf. |
| 3 | + |
| 4 | +## Prerequisites |
| 5 | + |
| 6 | +Before you begin, ensure you have the following: |
| 7 | + |
| 8 | +* **Helm 3+**: [Installation Guide](https://helm.sh/docs/intro/install/) |
| 9 | +* **Kubernetes Cluster**: Access to a Kubernetes cluster |
| 10 | +* **Hugging Face Token Secret**: A Hugging Face token to pull models. |
| 11 | +* **Gateway Deployed**: Your inference server/gateway must be deployed and accessible within the cluster. |
| 12 | + |
| 13 | +Follow [benchmarking guide](https://gateway-api-inference-extension.sigs.k8s.io/performance/benchmark/#benchmark) for more information on how to set up gateway and how to validate benchmark results. |
| 14 | + |
| 15 | +## Infinity Instruct Dataset Configuration |
| 16 | + |
| 17 | +The chart uses the `infinity_instruct` [dataset type](https://huggingface.co/datasets/BAAI/Infinity-Instruct). |
| 18 | + |
| 19 | +>NOTE: Currently, we need to download and supply the dataset for inference-perf to ingest. Currently using helm, we can supply the dataset by uploading to a gcs or s3 bucket. Otherwise, you can follow inference perf guides to run locally with a local dataset file path. |
| 20 | +
|
| 21 | +## Deployment |
| 22 | + |
| 23 | +### 1. Check out the repo. |
| 24 | + |
| 25 | +```bash |
| 26 | +git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension |
| 27 | +cd gateway-api-inference-extension/benchmarking/single-workload |
| 28 | +``` |
| 29 | + |
| 30 | +### 2. Get the target IP. |
| 31 | + |
| 32 | + The examples below shows how to get the IP of a gateway or a k8s service. |
| 33 | + |
| 34 | + ```bash |
| 35 | + # Get gateway IP |
| 36 | + GW_IP=$(kubectl get gateway/inference-gateway -o jsonpath='{.status.addresses[0].value}') |
| 37 | + # Get LoadBalancer k8s service IP |
| 38 | + SVC_IP=$(kubectl get service/vllm-llama3-8b-instruct -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 39 | + |
| 40 | + echo $GW_IP |
| 41 | + echo $SVC_IP |
| 42 | + ``` |
| 43 | + |
| 44 | +### 3. Deploying the Prefill Heavy Configuration |
| 45 | + |
| 46 | +This configuration is optimized for scenarios where a high cache hit rate is expected. It uses the `prefill-heavy-values.yaml` file. |
| 47 | + |
| 48 | +=== "Google Cloud Storage (GCS)" |
| 49 | + Use the `gcsPath` field to provide your dataset stored on GCS. The dataset will be downloaded from the bucket and stored locally on the cluster at `/dataset/gcs-dataset.json`. |
| 50 | + ```bash |
| 51 | + export IP='<YOUR_IP>' |
| 52 | + export PORT='<YOUR_PORT>' |
| 53 | + export HF_TOKEN='<YOUR_HUGGINGFACE_TOKEN>' |
| 54 | + helm install prefill-heavy ../inference-perf -f prefill-heavy-values.yaml \ |
| 55 | + --set hfToken=${HF_TOKEN} \ |
| 56 | + --set "config.server.base_url=http://${IP}:${PORT}" \ |
| 57 | + --set "config.data.path=/dataset/gcs-dataset.json" \ |
| 58 | + --set "gcsPath=<PATH TO DATASET FILE ON GCS BUCKET>" |
| 59 | + ``` |
| 60 | + **Parameters to customize:** |
| 61 | + |
| 62 | + * `prefill-heavy`: A unique name for this deployment. |
| 63 | + * `hfTokenSecret.name`: The name of your Kubernetes Secret containing the Hugging Face token (default: `hf-token`). |
| 64 | + * `hfTokenSecret.key`: The key in your Kubernetes Secret pointing to the Hugging Face token (default: `token`). |
| 65 | + * `config.server.base_url`: The base URL (IP and port) of your inference server for the high-cache scenario. |
| 66 | + * `gcsPath`: The path to the downloaded dataset file hosted on your gcs bucket. |
| 67 | + |
| 68 | +=== "Simple Storage Service (S3)" |
| 69 | + Use the `s3Path` field to provide your dataset stored on S3. The dataset will be downloaded from the bucket and stored locally on the cluster at `/dataset/s3-dataset.json`. |
| 70 | + ```bash |
| 71 | + export IP='<YOUR_IP>' |
| 72 | + export PORT='<YOUR_PORT>' |
| 73 | + export HF_TOKEN='<YOUR_HUGGINGFACE_TOKEN>' |
| 74 | + helm install prefill-heavy ../inference-perf -f prefill-heavy-values.yaml \ |
| 75 | + --set hfToken=${HF_TOKEN} \ |
| 76 | + --set "config.server.base_url=http://${IP}:${PORT}" \ |
| 77 | + --set "config.data.path=/dataset/s3-dataset.json" \ |
| 78 | + --set "s3Path=<PATH TO DATASET FILE ON S3 BUCKET>" |
| 79 | + ``` |
| 80 | + |
| 81 | + **Parameters to customize:** |
| 82 | + |
| 83 | + * `prefill-heavy`: A unique name for this deployment. |
| 84 | + * `hfTokenSecret.name`: The name of your Kubernetes Secret containing the Hugging Face token (default: `hf-token`). |
| 85 | + * `hfTokenSecret.key`: The key in your Kubernetes Secret pointing to the Hugging Face token (default: `token`). |
| 86 | + * `config.server.base_url`: The base URL (IP and port) of your inference server for the high-cache scenario. |
| 87 | + * `s3Path`: The path to the downloaded dataset file hosted on your s3 bucket. |
| 88 | + |
| 89 | +## Clean Up |
| 90 | + |
| 91 | +To uninstall the deployed charts: |
| 92 | + |
| 93 | +```bash |
| 94 | +helm uninstall prefill-heavy |
| 95 | +``` |
| 96 | + |
| 97 | +## Post Benchmark Analysis |
| 98 | +Follow the benchmarking guide instructions to [compare benchmark results](https://gateway-api-inference-extension.sigs.k8s.io/performance/benchmark/#analyze-the-results). |
0 commit comments