Skip to content

Enable CodeGen deployment for Intel Arc Pro B-series GPU (XPU)#2467

Open
tintisimone wants to merge 1 commit into
opea-project:mainfrom
tintisimone:bmg_enablement
Open

Enable CodeGen deployment for Intel Arc Pro B-series GPU (XPU)#2467
tintisimone wants to merge 1 commit into
opea-project:mainfrom
tintisimone:bmg_enablement

Conversation

@tintisimone

Copy link
Copy Markdown

Add Intel XPU support for CodeGen example with vLLM optimization.

Features:

  • Intel vLLM 0.14.1-xpu Docker image with XPU-specific configuration
  • XPU environment variables (VLLM_TARGET_DEVICE, ZE_FLAT_DEVICE_HIERARCHY, ONEAPI_DEVICE_SELECTOR)
  • GPU device mounting (/dev/dri) with privileged mode
  • 10GB shared memory allocation for model inference
  • Full stack deployment: vLLM -> LLM Service -> Backend -> UI
  • Qwen/Qwen2.5-Coder-7B-Instruct model support

Configuration files:

  • compose.yaml: Docker Compose with XPU optimizations
  • set_env.sh: Environment setup script
  • README.md: Comprehensive deployment documentation
  • QUICK_START.md: Quick reference guide
  • Validation and testing scripts

Changes:

  • Added CodeGen/docker_compose/intel/xpu/arc/ directory structure
  • Updated CodeGen/README.md with Intel Arc GPU deployment option
  • Consistent with Intel CPU example deployment pattern

Tested and validated on Intel Arc Pro B-series GPU.

Description

The summary of the proposed changes as long as the relevant motivation and context.

Issues

List the issue or RFC link this PR is working on. If there is no such link, please mark it as n/a.

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

List the newly introduced 3rd party dependency if exists.

Tests

Describe the tests that you ran to verify your changes.

Copilot AI review requested due to automatic review settings June 3, 2026 16:23
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an Intel Arc (XPU) Docker Compose deployment option for the CodeGen example, including environment setup scripts, validation/testing helpers, and detailed deployment documentation.

Changes:

  • Introduces a new intel/xpu/arc Docker Compose stack (compose + env script) for running CodeGen with Intel vLLM (XPU).
  • Adds helper scripts to validate configuration and check deployment readiness.
  • Adds multiple docs (README/quick start/test summaries) and links the new guide from CodeGen/README.md.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
CodeGen/docker_compose/intel/xpu/arc/validate_config.sh New config validation script (env, GPU device, YAML, summary output).
CodeGen/docker_compose/intel/xpu/arc/test_deployment.sh New deployment readiness checker for docker compose configuration.
CodeGen/docker_compose/intel/xpu/arc/set_env.sh New environment variable setup for Arc/XPU docker compose deployment.
CodeGen/docker_compose/intel/xpu/arc/compose.yaml New compose stack for vLLM (XPU) + llm server + backend + UI.
CodeGen/docker_compose/intel/xpu/arc/README.md Full Arc/XPU deployment guide.
CodeGen/docker_compose/intel/xpu/arc/QUICK_START.md Short quick-start instructions and common commands.
CodeGen/docker_compose/intel/xpu/arc/TEST_RESULTS.md Captures validation/test results for the configuration.
CodeGen/docker_compose/intel/xpu/arc/DEPLOYMENT_TEST_SUMMARY.md Extended narrative of configuration validation steps/results.
CodeGen/docker_compose/intel/xpu/arc/DEPLOYMENT_SUCCESS.md Deployment success report and usage examples.
CodeGen/docker_compose/intel/xpu/arc/.gitignore Ignores the model cache directory.
CodeGen/README.md Adds Arc/XPU guide link + validated configuration row.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +24
if [ -d "/dev/dri" ]; then
ls -la /dev/dri/ | grep -E "card|render"
echo " ✓ Intel GPU devices found"
else
echo " ✗ /dev/dri not found - Intel GPU may not be available"
exit 1
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Wrapped in a single conditional so set -e no longer aborts on a no-match: if [ -d "/dev/dri" ] && ls -la /dev/dri/ | grep -qE "card|render"; then.

Comment on lines +51 to +58
if command -v python3 &> /dev/null; then
python3 -c "import yaml; yaml.safe_load(open('compose.yaml'))" 2>&1
if [ $? -eq 0 ]; then
echo " ✓ compose.yaml syntax is valid"
else
echo " ✗ compose.yaml has syntax errors"
exit 1
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Restructured to if python3 -c "..."; then ... else ... fi so the YAML-validation failure branch runs instead of the script exiting under set -e.

Comment on lines +35 to +40
if [ -z "$HF_TOKEN" ]; then
echo " ✗ HF_TOKEN not set"
exit 1
else
echo " ✓ HF_TOKEN: ${HF_TOKEN:0:10}..."
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. No longer prints any part of the token — now reports ✓ HF_TOKEN is set (${#HF_TOKEN} characters).

Comment on lines +61 to +67
$COMPOSE_CMD config > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo " ✓ Docker Compose configuration is valid"
else
echo " ✗ Docker Compose configuration has errors"
exit 1
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Now if $COMPOSE_CMD config > /dev/null 2>&1; then ... else ... fi so the error message shows instead of aborting under set -e.

Comment on lines +18 to +24
if [ -d "/dev/dri" ]; then
ls -la /dev/dri/ | grep -E "card|render"
echo " ✓ Intel GPU devices found"
else
echo " ✗ /dev/dri not found - Intel GPU may not be available"
exit 1
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e, same pattern as validate_config.sh: if [ -d "/dev/dri" ] && ls -la /dev/dri/ | grep -qE "card|render"; then.

Comment on lines +13 to +15
devices:
- /dev/dri:/dev/dri
privileged: true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Dropped privileged: true in favor of least-privilege group_add (video/render groups) alongside the /dev/dri device mapping — same approach as the EdgeCraftRAG Intel Arc deployment. set_env.sh auto-detects the host VIDEOGROUPID/RENDERGROUPID with sane fallbacks.

Comment on lines +26 to +27
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80/health || exit 1"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Healthcheck now uses python3 (guaranteed present in the vLLM image) instead of curl, so a missing curl can no longer leave the container unhealthy and block depends_on.


### Step 1: Setup Environment (1 minute)
```bash
cd /home/gta/GenAIExamples/CodeGen/docker_compose/intel/xpu/arc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e. Replaced the hard-coded /home/gta/... path with a repo-relative cd and swapped all your_host_ip placeholders for ${HOST_IP}.


### Test 1: Health Check
```bash
curl http://your_host_ip:8028/health

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in d7d5d1e (same as above): repo-relative path and ${HOST_IP} throughout QUICK_START.md.

Comment on lines +249 to +250
1. **Port Conflict Resolution**: Successfully changed LLM service port from 9000 to 9001
2. **.env File Requirement**: Docker Compose requires .env file for proper variable expansion

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in d7d5d1e by removing DEPLOYMENT_SUCCESS.md entirely — it was a machine-specific validation report that didn't match the other CodeGen deployment guides, so the misleading .env note is gone with it.

@CICD-at-OPEA

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Add Intel XPU support for CodeGen example with vLLM optimization.

Features:
- Intel vLLM 0.14.1-xpu Docker image with XPU-specific configuration
- XPU environment variables (VLLM_TARGET_DEVICE, ZE_FLAT_DEVICE_HIERARCHY, ONEAPI_DEVICE_SELECTOR)
- GPU device mounting (/dev/dri) with privileged mode
- 10GB shared memory allocation for model inference
- Full stack deployment: vLLM -> LLM Service -> Backend -> UI
- Qwen/Qwen2.5-Coder-7B-Instruct model support

Configuration files:
- compose.yaml: Docker Compose with XPU optimizations
- set_env.sh: Environment setup script
- README.md: Comprehensive deployment documentation
- QUICK_START.md: Quick reference guide
- Validation and testing scripts

Changes:
- Added CodeGen/docker_compose/intel/xpu/arc/ directory structure
- Updated CodeGen/README.md with Intel Arc GPU deployment option
- Consistent with Intel CPU example deployment pattern

Tested and validated on Intel Arc Pro B-series GPU.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: tintisimone <simone.tinti@intel.com>
@tintisimone

Copy link
Copy Markdown
Author

Thanks for the review! I've pushed an update (rebased with DCO sign-off) that addresses the Copilot feedback and refreshes this PR (it was flagged stale).

Changes

compose.yaml

  • Removed privileged: true in favor of least-privilege GPU access via group_add (video/render groups), matching the pattern used by the EdgeCraftRAG Intel Arc deployment.
  • Reworked the vLLM healthcheck to use python3 (guaranteed present in the vLLM image) instead of curl, so a missing curl can no longer leave the container stuck unhealthy and block depends_on.

set_env.sh

  • Standardized the LLM microservice port on 9000 (repo convention, matches Xeon/Gaudi) — resolves the 9000/9001 inconsistency across compose/README/scripts. Users who hit a local conflict can override CODEGEN_LLM_SERVICE_PORT.
  • Auto-detect host VIDEOGROUPID/RENDERGROUPID (with sane fallbacks) for the non-privileged GPU access above.

validate_config.sh / test_deployment.sh

  • Fixed set -e control-flow bugs where ls | grep, python3 -c, and docker compose config could abort the script before the friendly error branch ran (wrapped in if … then … else).
  • No longer print any portion of HF_TOKEN — report "set (N characters)" instead to avoid leaking the token into logs/scrollback.

Docs (README.md / QUICK_START.md)

  • Removed the hardcoded local path and the your_host_ip placeholders (now ${HOST_IP}).
  • Corrected the HOST_IP env-var row (it must be exported before sourcing set_env.sh; it is not auto-detected).
  • Removed the machine-specific report files (DEPLOYMENT_SUCCESS.md, DEPLOYMENT_TEST_SUMMARY.md, TEST_RESULTS.md) to match the structure of the other CodeGen deployment guides.

CI note

DCO is now green. The pre-commit.ci "error during build" failure is not related to this PR — the docformatter hook's transitive dependency untokenize fails to build under Python 3.14 (AttributeError: 'Constant' object has no attribute 's'), which currently breaks pre-commit.ci for the whole repo. All hooks pass locally on Python 3.13. This likely needs a repo-level fix (pin Python or bump docformatter).

@lvliang-intel @yao531441 — could you take a look when you have a chance? Thanks!

@CICD-at-OPEA CICD-at-OPEA removed the Stale label Jul 8, 2026
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.

3 participants