torchlib-xpu 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Intel Corporation. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: torchlib-xpu
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Intel® XPU Library for PyTorch* Ecosystem Projects
|
|
5
|
+
Author-email: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
|
|
6
|
+
License: BSD 3-Clause License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Intel Corporation. All Rights Reserved.
|
|
9
|
+
|
|
10
|
+
Redistribution and use in source and binary forms, with or without
|
|
11
|
+
modification, are permitted provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
14
|
+
list of conditions and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
17
|
+
this list of conditions and the following disclaimer in the documentation
|
|
18
|
+
and/or other materials provided with the distribution.
|
|
19
|
+
|
|
20
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
21
|
+
contributors may be used to endorse or promote products derived from
|
|
22
|
+
this software without specific prior written permission.
|
|
23
|
+
|
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
25
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
26
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
|
|
35
|
+
Project-URL: GitHub, https://github.com/intel/torchlib-xpu
|
|
36
|
+
Requires-Python: >=3.10
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Requires-Dist: torchcodec-xpu
|
|
40
|
+
Provides-Extra: test
|
|
41
|
+
Requires-Dist: ruff ; extra == 'test'
|
|
42
|
+
Requires-Dist: torchcodec-xpu[test] ; extra == 'test'
|
|
43
|
+
|
|
44
|
+
[](https://scorecard.dev/viewer/?uri=github.com/intel/torchlib-xpu)
|
|
45
|
+
[](https://scan.coverity.com/projects/intel-torchlib-xpu)
|
|
46
|
+
|
|
47
|
+
# Intel® XPU Library for PyTorch* Ecosystem Projects
|
|
48
|
+
|
|
49
|
+
This project contains a set of plugins for PyTorch* ecosystem libraries which enable hardware acceleration on Intel® GPUs thru the `xpu` PyTorch* device backend. The goal of the project is to:
|
|
50
|
+
|
|
51
|
+
* Facilitate enabling of the Intel® GPUs support across PyTorch* ecosystem projects
|
|
52
|
+
* Provide the plugins till the support for Intel® GPUs will be accepted in the respective upstream projects
|
|
53
|
+
|
|
54
|
+
At the moment project provides plugins for the following frameworks:
|
|
55
|
+
|
|
56
|
+
* Intel® XPU plugin for [TorchCodec]
|
|
57
|
+
|
|
58
|
+
## Plugins
|
|
59
|
+
|
|
60
|
+
### Intel® XPU plugin for TorchCodec
|
|
61
|
+
|
|
62
|
+
[TorchCodec] is a high-performance Python library designed for media processing (decoding and encoding) using PyTorch* tensors. Intel® XPU plugin for [TorchCodec] enables hardware acceleration for video operations (only decoding at the moment) on Linux. Both [TorchCodec] and Intel® plugin rely on the FFmpeg libraries for their operations which must be pre-installed on the system. Intel® plugin further assumes that FFmpeg is built with the VAAPI support.
|
|
63
|
+
|
|
64
|
+
To use Intel® XPU plugin for [TorchCodec], load it in the Python script and pass XPU device to initialize [TorchCodec] decoder or encoder:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
import torchcodec
|
|
68
|
+
import torchcodec_xpu
|
|
69
|
+
|
|
70
|
+
decoder = torchcodec.decoders.VideoDecoder(
|
|
71
|
+
"input.mp4", device="xpu:0")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Build from sources
|
|
75
|
+
|
|
76
|
+
* Install [uv]
|
|
77
|
+
|
|
78
|
+
* Install oneAPI [2025.3]
|
|
79
|
+
|
|
80
|
+
* Install FFmpeg development environment with enabled VAAPI hardware acceleration. For example:
|
|
81
|
+
|
|
82
|
+
* By installing FFmpeg provided by your Linux distribution. For Ubuntu:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
apt-get update && apt-get install -y \
|
|
86
|
+
libavcodec-dev \
|
|
87
|
+
libavdevice-dev \
|
|
88
|
+
libavfilter-dev \
|
|
89
|
+
libavformat-dev \
|
|
90
|
+
libavutil-dev \
|
|
91
|
+
libswresample-dev \
|
|
92
|
+
libswscale-dev
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
* By self-building FFmpeg from sources:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
git clone https://git.ffmpeg.org/ffmpeg.git && cd ffmpeg
|
|
99
|
+
./configure \
|
|
100
|
+
--prefix=$HOME/_install \
|
|
101
|
+
--libdir=$HOME/_install/lib \
|
|
102
|
+
--disable-static \
|
|
103
|
+
--disable-stripping \
|
|
104
|
+
--disable-doc \
|
|
105
|
+
--enable-shared \
|
|
106
|
+
--enable-vaapi
|
|
107
|
+
make -j$(nproc) && make install
|
|
108
|
+
|
|
109
|
+
export PKG_CONFIG_PATH=$HOME/_install/lib/pkgconfig
|
|
110
|
+
export LD_LIBRARY_PATH=$HOME/_install/lib:$LD_LIBRARY_PATH
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
* Build and install plugins supplied by Intel® XPU Library for PyTorch* Ecosystem Projects:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
git clone https://github.com/intel/torchlib-xpu.git && cd torchlib-xpu
|
|
117
|
+
|
|
118
|
+
uv venv && uv pip install torch -e . \
|
|
119
|
+
--index https://download.pytorch.org/whl/xpu -vv
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
[Getting Started on Intel GPU]: https://docs.pytorch.org/docs/stable/notes/get_start_xpu.html
|
|
123
|
+
[TorchCodec]: https://github.com/meta-pytorch/torchcodec
|
|
124
|
+
[uv]: https://github.com/astral-sh/uv
|
|
125
|
+
|
|
126
|
+
[2025.3]: https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-10.html
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
torchlib_xpu-0.1.0.dist-info/LICENSE,sha256=DD1S0a-OooQrqURG8FGcfo0iKA4sA2yiAYLeyl0umfw,1525
|
|
2
|
+
torchlib_xpu-0.1.0.dist-info/METADATA,sha256=IHBorK8wNTJYERlW24Ys7Cz-l2Sx6JExeEUeMCooT3g,5322
|
|
3
|
+
torchlib_xpu-0.1.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
4
|
+
torchlib_xpu-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
+
torchlib_xpu-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|