Skip to content

Commit 71860c8

Browse files
Merge branch 'main' into check-tests
2 parents 4d01dcd + 5474abf commit 71860c8

File tree

80 files changed

+15062
-4027
lines changed

Some content is hidden

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

80 files changed

+15062
-4027
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build documentation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- doc-builder*
9+
- v*-release
10+
11+
env:
12+
UV_SYSTEM_PYTHON: 1
13+
UV_TORCH_BACKEND: auto
14+
15+
jobs:
16+
build_documentation:
17+
runs-on: ubuntu-22.04
18+
env:
19+
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
20+
PR_NUMBER: ${{ github.event.number }}
21+
EVENT_CONTEXT: ${{ toJSON(github.event) }}
22+
PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: "18"
29+
cache-dependency-path: "kit/package-lock.json"
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: "3.11"
35+
36+
- name: Set environment variables
37+
run: |
38+
cd optimum
39+
version=`echo "$(grep '^__version__ =' intel/version.py | cut -d '=' -f 2 | xargs)"`
40+
41+
if [[ $version == *.dev0 ]]
42+
then
43+
echo "VERSION=main" >> $GITHUB_ENV
44+
else
45+
echo "VERSION=v$version" >> $GITHUB_ENV
46+
fi
47+
48+
cd ..
49+
50+
- name: Setup environment
51+
run: |
52+
pip install --upgrade pip uv
53+
uv pip install git+https://github.com/huggingface/doc-builder
54+
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate
55+
56+
- name: Make documentation
57+
shell: bash
58+
run: |
59+
make doc BUILD_DIR=./doc-build VERSION=${{ env.VERSION }}
60+
mv ./doc-build/optimum.intel optimum-intel
61+
doc-builder push optimum-intel \
62+
--doc_build_repo_id "hf-doc-build/doc-build" \
63+
--commit_msg "Updated with commit $COMMIT_SHA See: https://github.com/huggingface/optimum-intel/commit/$COMMIT_SHA" \
64+
--token "${{ secrets.HF_DOC_BUILD_PUSH }}" \
65+
--n_retries 5

.github/workflows/build_pr_documentation.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
env:
13+
UV_SYSTEM_PYTHON: 1
14+
UV_TORCH_BACKEND: auto
15+
1216
jobs:
1317
build_documentation:
1418
runs-on: ubuntu-22.04
15-
1619
env:
1720
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
1821
PR_NUMBER: ${{ github.event.number }}
@@ -21,46 +24,31 @@ jobs:
2124

2225
steps:
2326
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
2428
with:
25-
repository: "huggingface/doc-builder"
26-
path: doc-builder
29+
node-version: "18"
30+
cache-dependency-path: "kit/package-lock.json"
2731

28-
- uses: actions/checkout@v4
32+
- name: Set up Python
33+
uses: actions/setup-python@v4
2934
with:
30-
repository: "huggingface/optimum-intel"
31-
path: optimum-intel
32-
33-
- name: Setup Python
34-
uses: actions/setup-python@v5
35-
with:
36-
python-version: 3.9
35+
python-version: "3.11"
3736

3837
- name: Setup environment
3938
run: |
40-
pip install --upgrade pip
41-
pip uninstall -y doc-builder
42-
cd doc-builder
43-
git pull origin main
44-
pip install .
45-
pip install black
46-
cd ..
39+
pip install --upgrade pip uv
40+
uv pip install git+https://github.com/huggingface/doc-builder
41+
uv pip install .[quality] nncf openvino neural-compressor[pt]>3.4 diffusers accelerate
4742
4843
- name: Make documentation
44+
shell: bash
4945
run: |
50-
cd optimum-intel
51-
make doc BUILD_DIR=intel-doc-build VERSION=pr_$PR_NUMBER COMMIT_SHA_SUBPACKAGE=$COMMIT_SHA CLONE_URL=$PR_CLONE_URL
52-
cd ..
53-
54-
- name: Save commit_sha & pr_number
55-
run: |
56-
cd optimum-intel
57-
sudo chmod -R ugo+rwx intel-doc-build
58-
cd intel-doc-build
59-
sudo mv optimum.intel optimum-intel
46+
make doc BUILD_DIR=./doc-build VERSION=pr_${{ env.PR_NUMBER }}
47+
mv ./doc-build/optimum.intel optimum-intel
6048
echo ${{ env.COMMIT_SHA }} > ./commit_sha
6149
echo ${{ env.PR_NUMBER }} > ./pr_number
6250
6351
- uses: actions/upload-artifact@v4
6452
with:
6553
name: doc-build-artifact
66-
path: optimum-intel/intel-doc-build/
54+
path: optimum-intel

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
pip install --upgrade pip
3131
# .[quality] installs too many dependencies
32-
# TODO: we should remove the the version pinning at some point
32+
# TODO: we should remove the version pinning at some point
3333
pip install "black~=23.1" "ruff==0.4.4"
3434
3535
- name: Check style with black

.github/workflows/style_bot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Style Bot
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
style:
12+
uses: huggingface/huggingface_hub/.github/workflows/style-bot-action.yml@main
13+
with:
14+
python_quality_dependencies: "[quality]"
15+
style_command_type: "style_only"
16+
secrets:
17+
bot_token: ${{ secrets.HF_STYLE_BOT_ACTION }}

.github/workflows/test_inc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515

16+
env:
17+
TRANSFORMERS_IS_CI: true
18+
1619
jobs:
1720
build:
1821
strategy:
@@ -35,7 +38,7 @@ jobs:
3538
run: |
3639
pip install --upgrade pip
3740
pip install torch==${{ matrix.torch-version }} torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
38-
pip install .[neural-compressor,diffusers,peft,tests] transformers[testing] intel-extension-for-pytorch==${{ matrix.torch-version }}
41+
pip install .[tests,neural-compressor] intel-extension-for-pytorch==${{ matrix.torch-version }} diffusers==0.32.2
3942
4043
- name: Assert versions
4144
run: |
@@ -45,3 +48,5 @@ jobs:
4548
- name: Test with Pytest
4649
run: |
4750
pytest tests/neural_compressor
51+
env:
52+
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}

.github/workflows/test_ipex.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515

16+
env:
17+
TRANSFORMERS_IS_CI: true
18+
1619
jobs:
1720
build:
1821
strategy:
1922
fail-fast: false
2023
matrix:
21-
transformers-version: ["4.49.0"]
22-
torch-version: ["2.6.0"]
24+
transformers-version: ["4.51.0", "4.52.*"]
25+
torch-version: ["2.7.0"]
26+
test-file: [test_modeling.py, test_pipelines.py, test_modeling_causal_lm.py]
2327

2428
runs-on: ubuntu-22.04
2529

@@ -39,16 +43,19 @@ jobs:
3943
pip install .[ipex,tests] transformers[testing]==${{ matrix.transformers-version }} intel_extension_for_pytorch==${{ matrix.torch-version }}
4044
4145
- name: Install bitsandbytes
46+
if: matrix.test-file == 'test_modeling_causal_lm.py'
4247
run: |
4348
git clone --branch multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git
4449
cd bitsandbytes
4550
pip install .
4651
4752
- name: Install autoawq
53+
if: matrix.test-file == 'test_modeling_causal_lm.py'
4854
run: |
4955
git clone https://github.com/casper-hansen/AutoAWQ.git
5056
cd AutoAWQ
5157
pip install .
58+
pip uninstall triton -y
5259
5360
- name: Assert versions
5461
run: |
@@ -58,4 +65,4 @@ jobs:
5865
5966
- name: Test with Pytest
6067
run: |
61-
pytest tests/ipex
68+
pytest tests/ipex/${{ matrix.test-file }} -rsx -v

.github/workflows/test_offline.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515

16+
env:
17+
TRANSFORMERS_IS_CI: true
18+
1619
jobs:
1720
build:
1821
runs-on: ubuntu-22.04

.github/workflows/test_openvino.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
env:
18+
TRANSFORMERS_IS_CI: true
19+
1720
jobs:
1821
build:
1922
strategy:
2023
fail-fast: false
2124
matrix:
2225
test-pattern:
23-
[
24-
"*modeling*",
25-
"*diffusion*",
26-
"*quantization*",
27-
"*export*",
28-
]
26+
["*modeling*", "*diffusion*", "*quantization*", "*export*"]
2927
transformers-version: ["4.36.0", "latest"]
3028

3129
runs-on: ubuntu-22.04
@@ -43,15 +41,15 @@ jobs:
4341
run: |
4442
pip install --upgrade pip
4543
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
46-
pip install .[openvino,openvino-tokenizers,diffusers,tests] transformers[testing]
44+
pip install .[openvino,diffusers,tests]
4745
pip install --pre -U openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
4846
pip install git+https://github.com/openvinotoolkit/nncf.git@release_v2180
4947
5048
- if: ${{ matrix.transformers-version != 'latest' }}
5149
name: Install specific dependencies and versions required for older transformers
5250
run: |
5351
pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.30.* transformers_stream_generator
54-
52+
5553
- if: ${{ matrix.transformers-version == 'latest' && matrix.test-pattern == '*modeling*'}}
5654
name: Install auto-gptq, autoawq
5755
run: |
@@ -77,3 +75,5 @@ jobs:
7775
name: Test with Pytest (nightly)
7876
run: |
7977
pytest tests/openvino/test_modeling_basic.py --durations=0
78+
env:
79+
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}

.github/workflows/test_openvino_full.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,40 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
env:
18+
TRANSFORMERS_IS_CI: true
19+
1720
jobs:
1821
build:
1922
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || (github.event_name == 'push') || contains( github.event.pull_request.labels.*.name, 'openvino-test') }}
2023
strategy:
2124
fail-fast: false
2225
matrix:
23-
include:
24-
- python-version: "3.9"
25-
os: "ubuntu-22.04"
26-
transformers-version: "latest"
27-
openvino: "ov-stable"
28-
nncf: "nncf-stable"
29-
- python-version: "3.9"
30-
os: "ubuntu-22.04"
31-
transformers-version: "latest"
32-
openvino: "ov-nightly"
33-
nncf: "nncf-stable"
34-
- python-version: "3.9"
35-
os: "ubuntu-22.04"
36-
transformers-version: "latest"
37-
openvino: "ov-stable"
38-
nncf: "nncf-develop"
39-
- python-version: "3.9"
40-
os: "ubuntu-22.04"
41-
transformers-version: "latest"
42-
openvino: "ov-nightly"
43-
nncf: "nncf-develop"
44-
45-
runs-on: ${{ matrix.os }}
26+
nncf: ["nncf-stable", "nncf-develop"]
27+
openvino: ["ov-stable", "ov-nightly"]
28+
transformers-version: ["latest"]
29+
30+
runs-on: ubuntu-22.04
4631

4732
steps:
48-
- uses: actions/checkout@v4
49-
- name: Setup Python ${{ matrix.python-version }}
33+
- name: Free Disk Space (Ubuntu)
34+
uses: jlumbroso/free-disk-space@main
35+
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Python
5040
uses: actions/setup-python@v5
5141
with:
52-
python-version: ${{ matrix.python-version }}
42+
python-version: 3.9
5343

5444
- name: Install dependencies
5545
run: |
56-
python -m pip install --upgrade pip
46+
pip install --upgrade pip
5747
# Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages
5848
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
59-
pip install .[tests]
49+
pip install .[tests,diffusers]
50+
pip uninstall opencv-python -y && pip install opencv-python-headless
6051
6152
- name: Install openvino-nightly
6253
if: ${{ matrix.openvino == 'ov-nightly' }}
@@ -78,7 +69,7 @@ jobs:
7869
if: ${{ matrix.transformers-version != 'latest' }}
7970
run: pip install transformers==${{ matrix.transformers-version }}
8071

81-
- if: ${{ matrix.transformers-version == 'latest' && matrix.os != 'windows-2019' }}
72+
- if: ${{ matrix.transformers-version == 'latest' }}
8273
name: Install auto-gptq, autoawq
8374
run: |
8475
pip install auto-gptq "autoawq<0.2.8" --extra-index-url https://download.pytorch.org/whl/cpu

0 commit comments

Comments
 (0)