Skip to content

Commit

Permalink
Merge branch 'paged_attn' into paged_attn
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqing-feng authored Nov 22, 2024
2 parents bf49c4c + 459c78c commit 95bbcde
Show file tree
Hide file tree
Showing 63 changed files with 7,178 additions and 2,430 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,39 @@ name: Build PR documentation

on:
pull_request:
branches: [ main ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build_documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.number }}
EVENT_CONTEXT: ${{ toJSON(github.event) }}
PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: 'huggingface/doc-builder'
repository: "huggingface/doc-builder"
path: doc-builder

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: 'huggingface/optimum-intel'
repository: "huggingface/optimum-intel"
path: optimum-intel

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Setup environment
run: |
pip uninstall -y doc-builder
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/check_code_quality.yml

This file was deleted.

52 changes: 26 additions & 26 deletions .github/workflows/dockerfile_sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ on:
branches:
- main
paths:
- 'docker/Dockerfile.intel'
- "docker/Dockerfile.intel"

pull_request:
branches:
- main
paths:
- 'docker/Dockerfile.intel'
- "docker/Dockerfile.intel"

jobs:
build_and_run:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and Run Docker Image
run: |
IMAGE_NAME="intel_image:latest"
docker build -f docker/Dockerfile.intel -t $IMAGE_NAME .
if [ $? -ne 0 ]; then
echo "Docker image build failed."
exit 1
fi
CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null)
if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then
echo "Container is running."
else
echo "Container failed to start."
docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found."
exit 1
fi
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
- name: Build and Run Docker Image
run: |
IMAGE_NAME="intel_image:latest"
docker build -f docker/Dockerfile.intel -t $IMAGE_NAME .
if [ $? -ne 0 ]; then
echo "Docker image build failed."
exit 1
fi
CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null)
if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then
echo "Container is running."
else
echo "Container failed to start."
docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found."
exit 1
fi
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
41 changes: 41 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Quality Checks
on:
push:
branches:
- main
- v*-release
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
quality:
runs-on: ubuntu-22.04

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install --upgrade pip
# .[quality] installs too many dependencies
# TODO: we should remove the the version pinning at some point
pip install "black~=23.1" "ruff==0.4.4"
- name: Check style with black
run: |
black --check .
- name: Check style with ruff
run: |
ruff check .
1 change: 1 addition & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
jobs:
secrets:
runs-on: ubuntu-latest

steps:
- shell: bash
run: |
Expand Down
48 changes: 23 additions & 25 deletions .github/workflows/test_generation.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Intel Generation Utils - Test
name: Generation Utils - Test (deprecated)

on:
push:
branches: [ main ]
branches:
- main
- v*-release
pull_request:
branches: [ main ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-latest]
runs-on: ubuntu-22.04

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install transformers==4.43.*
pip install optimum[exporters]
pip install .[tests]
- name: Test with Pytest
run: |
pytest tests/generation/
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[tests] transformers[testing]==4.43.*
- name: Test with Pytest
run: |
pytest tests/generation/
57 changes: 29 additions & 28 deletions .github/workflows/test_inc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Intel Neural Compressor - Test
name: INC - Test

on:
push:
Expand All @@ -20,31 +18,34 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-latest]
torch-version: ["2.2.0", "2.3.*", "2.4.*"]

runs-on: ubuntu-22.04

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cmake
pip install py-cpuinfo
pip install torch==2.3.0 torchaudio==2.3.0 torchvision==0.18 --index-url https://download.pytorch.org/whl/cpu
pip install intel-extension-for-pytorch==2.3.0
pip install datasets==2.19.0
pip install .[neural-compressor,diffusers,tests]
pip install peft
- name: Test with Pytest
run: |
pytest tests/neural_compressor/ --ignore tests/neural_compressor/test_ipex.py --durations=0
- name: Test IPEX
run: |
pytest tests/neural_compressor/test_ipex.py
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install --upgrade pip
pip install torch==${{ matrix.torch-version }} torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
pip install .[neural-compressor,ipex,diffusers,peft,tests] transformers[testing] intel-extension-for-pytorch==${{ matrix.torch-version }}
- if: ${{ matrix.torch-version == '2.2.0' }}
name: Downgrade Numpy
run: pip install numpy==1.*

- name: Assert versions
run: |
python -c "import torch; print(torch.__version__); assert torch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
python -c "import intel_extension_for_pytorch; print(intel_extension_for_pytorch.__version__); assert intel_extension_for_pytorch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
- name: Test with Pytest
run: |
pytest tests/neural_compressor
Loading

0 comments on commit 95bbcde

Please sign in to comment.