Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/iluvatar3.6-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: '0.6.0'
PYTHON_VER:
required: true
default: '3.10'
default: '3.12'
PLATFORM:
required: true
default: 'x86_64'
Expand All @@ -24,7 +24,7 @@ on:
PYTHON_VER:
type: string
required: true
default: '3.10'
default: '3.12'
PLATFORM:
type: string
required: true
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/xpu3.6-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Xpu3.6-Build-And-Test

on:
push:
branches: [ "triton_v3.6.x" ]
pull_request:
branches: [ "triton_v3.6.x" ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
xpu-build-and-test:
runs-on: xpu3.6
if: ${{ github.repository == 'FlagTree/flagtree' || github.repository == 'flagos-ai/flagtree' }}
steps:
- name: Setup environment
shell: bash
run: |
source ~/env.sh
env | grep -E '^(http_proxy|https_proxy|all_proxy|no_proxy)=' >> $GITHUB_ENV || true

- name: Smart Checkout
uses: flagos-ai/FlagTree/.github/actions/smart-checkout@main
with:
checkout_version: 'v6'

- name: Check if backend-relevant files changed
id: check_backend
uses: flagos-ai/FlagTree/.github/actions/check-backend-changed@main
with:
backend: xpu

- name: FlagTree Build on Xpu
if: steps.check_backend.outputs.should_skip != 'true'
shell: bash
run: |
set -x
export FLAGTREE_BACKEND=xpu
MAX_JOBS=32 python3 -m pip install . --no-build-isolation

- name: FlagTree Test on Xpu
if: steps.check_backend.outputs.should_skip != 'true'
shell: bash
run: |
set -x
source ~/env.sh
export XPU_EVENT_KL3_ENABLE=1
cd third_party/xpu/python/test/unit
python3 -m pytest -s . \
--ignore=language/test_compile_errors.py \
--ignore=language/test_random.py \
--ignore=runtime/test_bindings.py \
--ignore=runtime/test_cache.py \
--ignore=runtime/test_subproc.py \
-k "not test_decorator_with_def"
python3 -m pytest -s runtime/test_cache.py \
-k "test_changed_line_numbers_invalidate_cache or \
test_local_shadows_global or \
test_use_builtin or \
test_no_cache_module_as_global or \
test_cache_builtin_as_global or \
test_no_cache_callable or \
test_memory_leak"
141 changes: 141 additions & 0 deletions .github/workflows/xpu3.6-delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: CD-Xpu3.6

permissions:
contents: write

on:
workflow_dispatch:
inputs:
WHL_VER:
description: '0.6.0.dev1 < 0.6.0a1 < 0.6.0b1 < 0.6.0rc1 < 0.6.0 < 0.6.0.post1'
required: true
default: '0.6.0'
PYTHON_VER:
required: true
default: '3.10'
PLATFORM:
required: true
default: 'x86_64'
FLAGTREE_PYPI_KEY:
required: false
workflow_call:
inputs:
WHL_VER:
type: string
required: true
default: '0.6.0'
PYTHON_VER:
type: string
required: true
default: '3.10'
PLATFORM:
type: string
required: true
default: 'x86_64'
FLAGTREE_PYPI_KEY:
type: string
required: false

concurrency:
group: ${{ github.workflow }}-${{ inputs.WHL_VER }}-${{ inputs.PYTHON_VER }}-${{ inputs.PLATFORM }}
cancel-in-progress: true

jobs:
delivery:
runs-on: xpu3.6-cd
if: ${{ github.repository == 'FlagTree/flagtree' || github.repository == 'flagos-ai/flagtree' }}
steps:
- name: Check branch
shell: bash
run: |
TARGET_BRANCH="${{ github.ref_name }}"
if [[ ! "$TARGET_BRANCH" =~ ^(triton_v3.6.x)$ ]]; then
echo "❌ This workflow must be run from branch 'triton_v3.6.x', but got '${TARGET_BRANCH}'"
exit 1
fi
echo "TARGET_BRANCH=$TARGET_BRANCH" >> $GITHUB_ENV
echo "✅ Branch check passed: ${TARGET_BRANCH}"

- name: Setup environment
shell: bash
run: |
source ~/env.sh
env | grep -E '^(http_proxy|https_proxy|all_proxy|no_proxy)=' >> $GITHUB_ENV || true

- name: Smart Checkout
uses: flagos-ai/FlagTree/.github/actions/smart-checkout@main
with:
checkout_version: 'v6'

- name: FlagTree bdist_wheel on Xpu (triton_v3.6.x branch)
if: ${{ env.TARGET_BRANCH == 'triton_v3.6.x' }}
shell: bash
run: |
set -x
TRITON_VER="3.6"
CHIP=""
export FLAGTREE_BACKEND=xpu
WHL_VER=${{ inputs.WHL_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
export FLAGTREE_WHEEL_VERSION="${WHL_VER}+${FLAGTREE_BACKEND}${CHIP}${TRITON_VER}"

RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple"
if python${PYTHON_VER} -m pip download --no-deps "flagtree===${FLAGTREE_WHEEL_VERSION}" -d . $RES >/dev/null 2>&1; then
echo "❌ flagtree===${FLAGTREE_WHEEL_VERSION} already exists!"
exit 1
else
echo "✅ flagtree===${FLAGTREE_WHEEL_VERSION} does not exist, proceed to build"
fi

rm -rf ./build ./*.egg-info
{ export FLAGTREE_PYPI_KEY=${{ inputs.FLAGTREE_PYPI_KEY }}; } 2>/dev/null
export TRITON_APPEND_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
MAX_JOBS=32 python${PYTHON_VER} setup.py bdist_wheel -d ~/dist-flagtree
env | grep -E '^(FLAGTREE_WHEEL_VERSION)=' >> $GITHUB_ENV || true

- name: FlagTree upload whl
shell: bash
run: |
set -x
PLATFORM=${{ inputs.PLATFORM }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
CP_VER=$(printf '%s' "$PYTHON_VER" | tr -d '.')
FLAGTREE_WHL="flagtree-${FLAGTREE_WHEEL_VERSION}-cp${CP_VER}-cp${CP_VER}-linux_${PLATFORM}.whl"
pushd ~/dist-flagtree
twine check ${FLAGTREE_WHL}
echo "Upload ${FLAGTREE_WHL}"
bash upload_flagtree_whl.sh "${FLAGTREE_WHL}"
popd

- name: FlagTree push tag
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
TAG="${FLAGTREE_WHEEL_VERSION}"
git config user.name "flagtree-bot"
git config user.email "flagtree_ai@163.com"
if git rev-parse "${TAG}" >/dev/null 2>&1; then
echo "⚠️ Tag '${TAG}' already exists, force moving to current commit"
git tag -f -a "${TAG}" -m "pypi ${TAG}"
else
git tag -a "${TAG}" -m "pypi ${TAG}"
fi
MAX_RETRY=100
RETRY_INTERVAL=10
success=false
for i in $(seq 1 $MAX_RETRY); do
echo "Attempt ${i}/${MAX_RETRY}:"
if git push --force origin "${TAG}"; then
success=true
break
fi
echo "Push failed, retrying in ${RETRY_INTERVAL}s..."
sleep $RETRY_INTERVAL
done
if [ "$success" != "true" ]; then
echo "git push failed after $MAX_RETRY attempts"
exit 1
fi
Loading