You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: huggingface/accelerate-with-pytorch-xpu.md
+13-1
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,25 @@ Haggingface Accelerate supports PyTorch XPU backend starting from version `0.32.
6
6
7
7
# Testing
8
8
9
-
Accelerate library can be formally tested for XPU backend by the project included tests on the system with supported Intel GPU graphics:
9
+
Accelerate library can be formally tested for XPU backend by the project included tests on the system with supported Intel GPU graphics. To run tests:
10
+
11
+
* Install Accelerate library and test dependencies:
12
+
13
+
```
14
+
pip install -e .
15
+
pip install -e ".[dev]"
16
+
```
17
+
18
+
* Execute tests:
10
19
11
20
```
12
21
cd /path/to/accelerate/clone/copy
13
22
python3 -m pytest tests
14
23
```
15
24
25
+
> [!NOTE]
26
+
> Accelerate depends on PyTorch `torch` package which gets installed during installation of `accelerate`. If you need to test against different version of PyTorch – reinstall it after installing Accelerate.
Copy file name to clipboardexpand all lines: huggingface/transformers-with-pytorch-xpu.md
+14-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,16 @@ Haggingface Transformers support PyTorch XPU backend starting from version `4.42
6
6
7
7
# Testing
8
8
9
-
Transformers library can be formally tested for XPU backend by the project included tests on the system with supported Intel GPU graphics. To run tests first create `spec.py` file with the following contents:
9
+
Transformers library can be formally tested for XPU backend by the project included tests on the system with supported Intel GPU graphics. To run tests:
10
+
11
+
* Install Transformers library and test dependencies:
12
+
13
+
```
14
+
pip install -e .
15
+
pip install -e ".[dev]"
16
+
```
17
+
18
+
* Create `spec.py` file with the following contents:
> Some Transformers tests depend on `torchvision` built with `libPNG`. Install on Ubuntu with `apt-get install libpng-dev`, then rebuild `torchvision` and rerun affected Transformers tests.
39
+
28
40
# Using with PyTorch 2.5
29
41
30
42
XPU backend in PyTorch 2.5 greatly improved coverage of supported aten eager mode operators with just few missing for the executed Transformer tests. They are much easier to indentify now since [intel/torch-xpu-ops#318] is available in PyTorch 2.5 and adding `PYTORCH_ENABLE_XPU_FALLBACK=1` works fluently.
0 commit comments