Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GitHub CI for Intel GPU #536

Merged
merged 7 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/intel-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Intel GPU

on:
push:
branches:
- main
paths:
- "src/**"
- "test/**"
pull_request:
branches:
- main
paths:
- "src/**"
- "test/**"
schedule:
# Runs at 00:00 UTC daily
- cron: '0 0 * * *'
workflow_dispatch: # Enables manual trigger

concurrency:
# This causes it to cancel previous in-progress actions on the same PR / branch,
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checkstyle:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev/fmt-requirements.txt

- name: Run checkstyle
run: make checkstyle

tests:
runs-on: linux-max1550-gpu-8
hebiao064 marked this conversation as resolved.
Show resolved Hide resolved
needs: [checkstyle]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Setup Dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev] --extra-index-url https://download.pytorch.org/whl/test/xpu

- name: List Python Environments
run: python -m pip list

- name: Run Unit Tests
run: |
make test
make test-convergence
17 changes: 13 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def get_default_dependencies():
"torch>=2.6.0.dev",
"triton>=3.0.0",
]
elif platform == "xpu":
return [
"torch>=2.6.0",
"pytorch-triton-xpu>=3.2.0",
]


def get_optional_dependencies():
Expand All @@ -43,8 +48,7 @@ def get_optional_dependencies():
}


# TODO: add intel XPU
def get_platform() -> Literal["cuda", "rocm", "cpu"]:
def get_platform() -> Literal["cuda", "rocm", "cpu", "xpu"]:
"""
Detect whether the system has NVIDIA or AMD GPU without torch dependency.
"""
Expand All @@ -60,8 +64,13 @@ def get_platform() -> Literal["cuda", "rocm", "cpu"]:
print("ROCm GPU detected")
return "rocm"
except (subprocess.SubprocessError, FileNotFoundError):
print("No GPU detected")
return "cpu"
try:
subprocess.run(["xpu-smi"], check=True)
print("Intel GPU detected")
return "xpu"
except (subprocess.SubprocessError, FileNotFoundError):
print("No GPU detected")
return "cpu"


setup(
Expand Down