Skip to content

feat(pack): add Enflame GCU (燧原 S60) backend support#248

Open
huqingjie0118-droid wants to merge 2 commits into
gpustack:mainfrom
huqingjie0118-droid:feat/add-gcu-backend
Open

feat(pack): add Enflame GCU (燧原 S60) backend support#248
huqingjie0118-droid wants to merge 2 commits into
gpustack:mainfrom
huqingjie0118-droid:feat/add-gcu-backend

Conversation

@huqingjie0118-droid

Copy link
Copy Markdown

feat(pack): add Enflame GCU (燧原 S60) backend support

Summary

Add Dockerfile support for Enflame GCU (燧原 S60) to the GPUStack runner pack system.

Changes

  • New directory: pack/gcu/
    • Dockerfile — Combined build with vanilla → runtime → vllm stages
    • Dockerfile.vllm — Per-service vLLM Dockerfile (runtime + vllm targets)
  • Modified: pack/matrix.yaml — Added gcu backend rule

Version Information

Component Version
TopsRider (燧原加速框架) 3.7.107 (i3x 3.6+)
vLLM-GCU 0.11.0
Python 3.10
OS Ubuntu 22.04
Hardware S60 GCU

Vanilla Image

registry-egc.enflame-tech.com/artifacts/vllm_gcu:v0.11.0-TR3.7.107-ubuntu2204

This image is provided by Enflame and includes:

  • Enflame GCU driver and TopsRider SDK
  • torch_gcu (PyTorch for GCU)
  • vllm-gcu (vLLM with GCU backend)
  • triton_gcu

Expected Image Tags

After the copy.yml workflow runs and the Dockerfiles are built:

Stage Tag
Vanilla gpustack/runner:gcu3.7.107-python3.10-vanilla
Runtime gpustack/runner:gcu3.7.107-python3.10
vLLM gpustack/runner:gcu3.7.107-vllm0.11.0-python3.10

copy.yml Parameters

For the GitHub Action copy.yml, the suggested inputs:

src-registry: registry-egc.enflame-tech.com
src-image: artifacts/vllm_gcu:v0.11.0-TR3.7.107-ubuntu2204
dst-image-tag: gcu3.7.107-python3.10

Build & Test

To build the runtime image locally:

docker build --progress=plain --platform=linux/amd64 \
  --file=pack/gcu/Dockerfile \
  --tag=gpustack/runner:gcu3.7.107-python3.10 \
  --target=runtime \
  pack/gcu

To build the vLLM image:

docker build --progress=plain --platform=linux/amd64 \
  --file=pack/gcu/Dockerfile \
  --tag=gpustack/runner:gcu3.7.107-vllm0.11.0-python3.10 \
  --target=vllm \
  pack/gcu

Notes

  • Only vLLM backend is supported (SGLang support not yet available for GCU)
  • The vanilla image is Ubuntu 22.04 based
  • Device visibility env var: GCU_VISIBLE_DEVICES
  • Uses RAY_EXPERIMENTAL_NOSET_GCU_VISIBLE_DEVICES=1 in entrypoint

Related

- Add pack/gcu/Dockerfile: combined vanilla/runtime/vllm stages

- Add pack/gcu/Dockerfile.vllm: per-service vLLM Dockerfile

- Update pack/matrix.yaml: add gcu backend rule

- Version: TopsRider 3.7.107, vLLM 0.11.0, Python 3.10, Ubuntu 22.04
@huqingjie0118-droid

Copy link
Copy Markdown
Author

📋 Version Information for GPUStack TeamnnPlease copy the following vanilla image via the copy.yml workflow:nn- Source: registry-egc.enflame-tech.com/artifacts/vllm_gcu:v0.11.0-TR3.7.107-ubuntu2204 - **Destination tag**: gcu3.7.107-python3.10-vanilla``nn## Version Detailsn`n| Component | Version |`n|-----------|---------|`n| TopsRider (燧原加速框架) | 3.7.107 |`n| vLLM-GCU | 0.11.0 |`n| Python | 3.10 |`n| OS | Ubuntu 22.04 |`n| Hardware | S60 GCU |`n`n## Registry Access`n`nThe source registry `registry-egc.enflame-tech.com` requires authentication.`nPlease contact support@enflame-tech.com for registry credentials if needed.`n`n---`n`nNote: Issues are disabled on this repo, so posting here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for the Enflame GCU (燧原 S60) backend to the GPUStack runner pack system, adding Dockerfiles for runtime and vLLM stages, documentation, and matrix configuration. The reviewer provided several actionable suggestions to improve the Dockerfiles and repository structure. Key feedback includes fixing a critical issue in pack/gcu/Dockerfile where the vllm stage was built directly from the vanilla image instead of the runtime stage (which would cause missing dependencies like tini and uv), removing an accidentally committed PR_TEMPLATE.md file, renaming ISSUE_TEMPLATE.md to README.md for better documentation, adding retry flags to curl commands, using python3 -m pip instead of pip, ensuring consistent removal of pip.conf, and cleaning up /var/lib/apt/lists/* to reduce Docker image sizes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pack/gcu/Dockerfile
# Stage: vllm
# ============================================================

FROM ${VLLM_BASE_IMAGE} AS vllm

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The vllm stage should be built on top of the runtime stage rather than VLLM_BASE_IMAGE (which defaults to the raw VANILLA_IMAGE). If built directly from the vanilla image, the final image will lack the essential tools installed in the runtime stage (such as tini, which is used as the entrypoint, and uv, which is used in the postprocess step). This will cause the build to fail at the uv pip tree step, or fail at runtime due to a missing tini executable.

FROM runtime AS vllm

Comment thread PR_TEMPLATE.md
@@ -0,0 +1,86 @@
# feat(pack): add Enflame GCU (燧原 S60) backend support

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It appears that PR_TEMPLATE.md was accidentally committed to the root of the repository. This file contains the specific description for this Pull Request rather than a generic template. You should delete this file from the repository.

@@ -0,0 +1,85 @@
# Enflame GCU (燧原 S60) Backend Support Request

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file contains valuable documentation about the Enflame GCU backend, including supported models, build instructions, and expected tags. However, naming it ISSUE_TEMPLATE.md inside the pack/gcu/ directory is non-standard and confusing. It should be renamed to README.md to serve as the developer documentation for this backend.

Comment thread pack/gcu/Dockerfile
# Update alternatives
if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
if [[ -f /etc/alternatives/python ]]; then update-alternatives --remove-all python; fi; update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
curl -sS "https://bootstrap.pypa.io/get-pip.py" | python${PYTHON_VERSION}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add retry flags to the curl command when downloading get-pip.py to prevent transient network issues from failing the build, matching the robust curl options used elsewhere in the Dockerfile.

    curl -sS --retry 3 --retry-connrefused -fL "https://bootstrap.pypa.io/get-pip.py" | python${PYTHON_VERSION}

Comment thread pack/gcu/Dockerfile.vllm

if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
if [[ -f /etc/alternatives/python ]]; then update-alternatives --remove-all python; fi; update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
curl -sS "https://bootstrap.pypa.io/get-pip.py" | python${PYTHON_VERSION}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add retry flags to the curl command when downloading get-pip.py to prevent transient network issues from failing the build.

    curl -sS --retry 3 --retry-connrefused -fL "https://bootstrap.pypa.io/get-pip.py" | python${PYTHON_VERSION}

Comment thread pack/gcu/Dockerfile
pipx<=1.8.0
uv<=0.9.11
EOT
pip install -r /tmp/requirements.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer and more robust to use python3 -m pip instead of calling pip directly, ensuring packages are installed into the correct Python environment.

    python3 -m pip install -r /tmp/requirements.txt

Comment thread pack/gcu/Dockerfile.vllm
pipx<=1.8.0
uv<=0.9.11
EOT
pip install -r /tmp/requirements.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer and more robust to use python3 -m pip instead of calling pip directly, ensuring packages are installed into the correct Python environment.

    python3 -m pip install -r /tmp/requirements.txt

Comment thread pack/gcu/Dockerfile
Comment on lines +241 to +244
RUN <<EOF
# Buildkit

cat <<EOT >/tmp/requirements.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To ensure consistency with Dockerfile.vllm and prevent any pre-configured pip mirrors or settings in the base image from interfering with the build, remove any existing pip.conf files before installing requirements.

RUN <<EOF
    # Buildkit

    rm -rf /root/.pip/pip.conf /etc/pip.conf

    cat <<EOT >/tmp/requirements.txt

Comment thread pack/gcu/Dockerfile
Comment on lines +99 to +102
# Cleanup
rm -rf /var/tmp/* \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To minimize the Docker image size, it is highly recommended to clean up the apt package lists in /var/lib/apt/lists/* in addition to /var/cache/apt. Please apply this cleanup to all apt-get blocks in both Dockerfile and Dockerfile.vllm.

    # Cleanup
    rm -rf /var/tmp/* \
        && rm -rf /tmp/* \
        && rm -rf /var/cache/apt \
        && rm -rf /var/lib/apt/lists/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants