Skip to content

Commit 459c78c

Browse files
committed
Merge branch 'main' into paged_attn
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2 parents 039c72d + 080180b commit 459c78c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+7115
-2398
lines changed

.github/workflows/build_pr_documentation.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,39 @@ name: Build PR documentation
22

33
on:
44
pull_request:
5-
branches: [ main ]
5+
branches:
6+
- main
67

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

1112
jobs:
1213
build_documentation:
13-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
15+
1416
env:
1517
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
1618
PR_NUMBER: ${{ github.event.number }}
1719
EVENT_CONTEXT: ${{ toJSON(github.event) }}
1820
PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
1921

2022
steps:
21-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2224
with:
23-
repository: 'huggingface/doc-builder'
25+
repository: "huggingface/doc-builder"
2426
path: doc-builder
2527

26-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2729
with:
28-
repository: 'huggingface/optimum-intel'
30+
repository: "huggingface/optimum-intel"
2931
path: optimum-intel
3032

33+
- name: Setup Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: 3.9
37+
3138
- name: Setup environment
3239
run: |
3340
pip uninstall -y doc-builder

.github/workflows/check_code_quality.yml

-54
This file was deleted.

.github/workflows/dockerfile_sanity.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docker/Dockerfile.intel'
9-
8+
- "docker/Dockerfile.intel"
9+
1010
pull_request:
1111
branches:
1212
- main
1313
paths:
14-
- 'docker/Dockerfile.intel'
14+
- "docker/Dockerfile.intel"
1515

1616
jobs:
1717
build_and_run:
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1919

2020
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v4
21+
- name: Checkout code
22+
uses: actions/checkout@v4
2323

24-
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@v3
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
2626

27-
- name: Build and Run Docker Image
28-
run: |
29-
IMAGE_NAME="intel_image:latest"
30-
docker build -f docker/Dockerfile.intel -t $IMAGE_NAME .
31-
if [ $? -ne 0 ]; then
32-
echo "Docker image build failed."
33-
exit 1
34-
fi
35-
CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null)
36-
if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then
37-
echo "Container is running."
38-
else
39-
echo "Container failed to start."
40-
docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found."
41-
exit 1
42-
fi
43-
docker stop $CONTAINER_ID
44-
docker rm $CONTAINER_ID
27+
- name: Build and Run Docker Image
28+
run: |
29+
IMAGE_NAME="intel_image:latest"
30+
docker build -f docker/Dockerfile.intel -t $IMAGE_NAME .
31+
if [ $? -ne 0 ]; then
32+
echo "Docker image build failed."
33+
exit 1
34+
fi
35+
CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null)
36+
if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then
37+
echo "Container is running."
38+
else
39+
echo "Container failed to start."
40+
docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found."
41+
exit 1
42+
fi
43+
docker stop $CONTAINER_ID
44+
docker rm $CONTAINER_ID

.github/workflows/quality.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Quality Checks
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- v*-release
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
quality:
17+
runs-on: ubuntu-22.04
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: 3.9
27+
28+
- name: Install dependencies
29+
run: |
30+
pip install --upgrade pip
31+
# .[quality] installs too many dependencies
32+
# TODO: we should remove the the version pinning at some point
33+
pip install "black~=23.1" "ruff==0.4.4"
34+
35+
- name: Check style with black
36+
run: |
37+
black --check .
38+
39+
- name: Check style with ruff
40+
run: |
41+
ruff check .

.github/workflows/security.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ permissions:
99
jobs:
1010
secrets:
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- shell: bash
1415
run: |

.github/workflows/test_generation.yml

+23-25
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
name: Intel Generation Utils - Test
1+
name: Generation Utils - Test (deprecated)
42

53
on:
64
push:
7-
branches: [ main ]
5+
branches:
6+
- main
7+
- v*-release
88
pull_request:
9-
branches: [ main ]
9+
branches:
10+
- main
1011

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

1516
jobs:
1617
build:
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
python-version: [3.8, 3.9]
21-
os: [ubuntu-latest]
18+
runs-on: ubuntu-22.04
2219

23-
runs-on: ${{ matrix.os }}
2420
steps:
25-
- uses: actions/checkout@v2
26-
- name: Setup Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install transformers==4.43.*
34-
pip install optimum[exporters]
35-
pip install .[tests]
36-
- name: Test with Pytest
37-
run: |
38-
pytest tests/generation/
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.9
28+
29+
- name: Install dependencies
30+
run: |
31+
pip install --upgrade pip
32+
pip install .[tests] transformers[testing]==4.43.*
33+
34+
- name: Test with Pytest
35+
run: |
36+
pytest tests/generation/

.github/workflows/test_inc.yml

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
name: Intel Neural Compressor - Test
1+
name: INC - Test
42

53
on:
64
push:
@@ -20,31 +18,34 @@ jobs:
2018
strategy:
2119
fail-fast: false
2220
matrix:
23-
python-version: [3.8, 3.9]
24-
os: [ubuntu-latest]
21+
torch-version: ["2.2.0", "2.3.*", "2.4.*"]
22+
23+
runs-on: ubuntu-22.04
2524

26-
runs-on: ${{ matrix.os }}
2725
steps:
28-
- uses: actions/checkout@v2
29-
- name: Setup Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Install dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install cmake
37-
pip install py-cpuinfo
38-
pip install torch==2.3.0 torchaudio==2.3.0 torchvision==0.18 --index-url https://download.pytorch.org/whl/cpu
39-
pip install intel-extension-for-pytorch==2.3.0
40-
pip install datasets==2.19.0
41-
pip install .[neural-compressor,diffusers,tests]
42-
pip install peft
43-
44-
- name: Test with Pytest
45-
run: |
46-
pytest tests/neural_compressor/ --ignore tests/neural_compressor/test_ipex.py --durations=0
47-
- name: Test IPEX
48-
run: |
49-
pytest tests/neural_compressor/test_ipex.py
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: 3.9
33+
34+
- name: Install dependencies
35+
run: |
36+
pip install --upgrade pip
37+
pip install torch==${{ matrix.torch-version }} torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
38+
pip install .[neural-compressor,ipex,diffusers,peft,tests] transformers[testing] intel-extension-for-pytorch==${{ matrix.torch-version }}
39+
40+
- if: ${{ matrix.torch-version == '2.2.0' }}
41+
name: Downgrade Numpy
42+
run: pip install numpy==1.*
43+
44+
- name: Assert versions
45+
run: |
46+
python -c "import torch; print(torch.__version__); assert torch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
47+
python -c "import intel_extension_for_pytorch; print(intel_extension_for_pytorch.__version__); assert intel_extension_for_pytorch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
5048
49+
- name: Test with Pytest
50+
run: |
51+
pytest tests/neural_compressor

0 commit comments

Comments
 (0)