You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by vt...@apache.org on 2025/10/08 11:18:12 UTC

(beam) branch fix-vllm-10-08 created (now 0befe3b23b6)

This is an automated email from the ASF dual-hosted git repository.

vterentev pushed a change to branch fix-vllm-10-08
in repository https://gitbox.apache.org/repos/asf/beam.git


      at 0befe3b23b6 Add more space fo vllm

This branch includes the following new commits:

     new 0befe3b23b6 Add more space fo vllm

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(beam) 01/01: Add more space fo vllm

Posted by vt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vterentev pushed a commit to branch fix-vllm-10-08
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 0befe3b23b69255f407d64e8de6d7c7ff217da8c
Author: Vitaly Terentyev <vi...@akvelon.com>
AuthorDate: Wed Oct 8 15:17:56 2025 +0400

    Add more space fo vllm
---
 ...Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt |  4 ++--
 .../apache_beam/ml/inference/test_resources/vllm.dockerfile  | 12 +++---------
 sdks/python/container/common.gradle                          | 12 ++++++++++++
 sdks/python/container/run_generate_requirements.sh           |  6 ++++++
 sdks/python/setup.py                                         |  3 ++-
 5 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt b/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt
index 6101fe5da45..23af8197d8d 100644
--- a/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt
+++ b/.github/workflows/load-tests-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_VLLM_Gemma_Batch.txt
@@ -20,7 +20,7 @@
 --input=gs://apache-beam-ml/testing/inputs/sentences_50k.txt
 --machine_type=n1-standard-8
 --worker_zone=us-central1-b
---disk_size_gb=50
+--disk_size_gb=200
 --input_options={}
 --num_workers=8
 --max_num_workers=25
@@ -33,4 +33,4 @@
 --influx_measurement=gemma_vllm_batch
 --model_gcs_path=gs://apache-beam-ml/models/gemma-2b-it
 --dataflow_service_options=worker_accelerator=type:nvidia-tesla-t4;count:1;install-nvidia-driver
---experiments=use_runner_v2
\ No newline at end of file
+--experiments=use_runner_v2
diff --git a/sdks/python/apache_beam/ml/inference/test_resources/vllm.dockerfile b/sdks/python/apache_beam/ml/inference/test_resources/vllm.dockerfile
index 5727437809c..a8eb6be10be 100644
--- a/sdks/python/apache_beam/ml/inference/test_resources/vllm.dockerfile
+++ b/sdks/python/apache_beam/ml/inference/test_resources/vllm.dockerfile
@@ -54,15 +54,9 @@ ENV PYTHONPATH=/opt/apache/beam:$PYTHONPATH
 
 # 6) Install the Beam dev SDK from the local source package.
 # This .tar.gz file will be created by GitHub Actions workflow
-# and copied into the build context.
+# and copied into the build context. This will include vLLM dependencies
 COPY ./sdks/python/build/apache-beam.tar.gz /tmp/beam.tar.gz
-RUN python3 -m pip install --no-cache-dir "/tmp/beam.tar.gz[gcp]"
-
-# 7) Install vLLM, and other dependencies
-RUN python3 -m pip install --no-cache-dir \
-      openai>=1.52.2 \
-      vllm>=0.6.3 \
-      triton>=3.1.0
+RUN python3 -m pip install --no-cache-dir "/tmp/beam.tar.gz[gcp,vllm]"
 
 # 8) Use the Beam boot script as entrypoint
-ENTRYPOINT ["/opt/apache/beam/boot"]
\ No newline at end of file
+ENTRYPOINT ["/opt/apache/beam/boot"]
diff --git a/sdks/python/container/common.gradle b/sdks/python/container/common.gradle
index 0648bf4fa2e..653c527216e 100644
--- a/sdks/python/container/common.gradle
+++ b/sdks/python/container/common.gradle
@@ -56,6 +56,18 @@ def generatePythonRequirements = tasks.register("generatePythonRequirements") {
               "[gcp,dataframe,test,tensorflow,torch,transformers] " +
               "${pipExtraOptions}"
     }
+    // GPU requirements not used for any containers directly due to licensing,
+    // but can be picked up by customers or other consumers for use.
+    exec {
+      executable 'sh'
+      args '-c', "cd ${rootDir} && ${runScriptsPath} " +
+              "${project.ext.pythonVersion} " +
+              "${files(configurations.sdkSourceTarball.files).singleFile} " +
+              "gpu_image_requirements.txt " +
+              "container/ml " +
+              "[gcp,dataframe,test,tensorflow,torch,transformers,vllm] " +
+              "${pipExtraOptions}"
+    }
   }
 }
 
diff --git a/sdks/python/container/run_generate_requirements.sh b/sdks/python/container/run_generate_requirements.sh
index de14cbff2d5..cf30c24c6e7 100755
--- a/sdks/python/container/run_generate_requirements.sh
+++ b/sdks/python/container/run_generate_requirements.sh
@@ -76,6 +76,12 @@ python"${PY_VERSION}" -m venv "$ENV_PATH"
 source "$ENV_PATH"/bin/activate
 pip install --upgrade pip setuptools wheel
 
+if [[ $EXTRAS == *"vllm"* ]]; then
+  # Explicitly install torch to avoid https://github.com/facebookresearch/xformers/issues/740
+  # This should be overwritten later since the vllm extra is installed alongside torch
+  pip install --no-cache-dir torch
+fi
+
 # Install gcp extra deps since these deps are commonly used with Apache Beam.
 # Install dataframe deps to add have Dataframe support in released images.
 # Install test deps since some integration tests need dependencies,
diff --git a/sdks/python/setup.py b/sdks/python/setup.py
index 719d188ed26..14e95f7ccc2 100644
--- a/sdks/python/setup.py
+++ b/sdks/python/setup.py
@@ -610,7 +610,8 @@ if __name__ == '__main__':
           ],
           'xgboost': ['xgboost>=1.6.0,<2.1.3', 'datatable==1.0.0'],
           'tensorflow-hub': ['tensorflow-hub>=0.14.0,<0.16.0'],
-          'milvus': milvus_dependency
+          'milvus': milvus_dependency,
+          'vllm': ['openai>=1.52.2', 'vllm>=0.6.3', 'triton>=3.1.0']
       },
       zip_safe=False,
       # PyPI package information.