Metadata-Version: 2.2
Name: torchcodec-xpu
Version: 0.13.0
Summary: Intel extension for torchcodec
Author-Email: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
License: BSD 3-Clause License
         
         Copyright (c) 2025 Dmitry Rogozhkin
         Copyright (c) 2026 Intel Corporation. All Rights Reserved.
         
         Redistribution and use in source and binary forms, with or without
         modification, are permitted provided that the following conditions are met:
         
         1. Redistributions of source code must retain the above copyright notice, this
            list of conditions and the following disclaimer.
         
         2. Redistributions in binary form must reproduce the above copyright notice,
            this list of conditions and the following disclaimer in the documentation
            and/or other materials provided with the distribution.
         
         3. Neither the name of the copyright holder nor the names of its
            contributors may be used to endorse or promote products derived from
            this software without specific prior written permission.
         
         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
         AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
         IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
         DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
         FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
         DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
         SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
         CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
         OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
         OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         
Project-URL: GitHub, https://github.com/intel/torchlib-xpu
Requires-Python: >=3.10
Requires-Dist: torch~=2.12.0
Requires-Dist: torchcodec~=0.13.0
Provides-Extra: test
Requires-Dist: numpy; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: torcheval; extra == "test"
Requires-Dist: torchvision; extra == "test"
Description-Content-Type: text/markdown

# Intel Plugin for TorchCodec

## Overview

[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.

To use Intel® XPU plugin for [TorchCodec], load it in the Python script and pass XPU device to initialize [TorchCodec] decoder or encoder:

```
import torchcodec
import torchcodec_xpu

decoder = torchcodec.decoders.VideoDecoder(
    "input.mp4", device="xpu:0")
```

## Supported hardware

All the Intel GPU hardware enabled for XPU PyTorch backend with hardware media decoding capabilities is supported.

## Environment variables

The following environment variables can be used to customize the behavior of Intel Plugin for TorchCodec:

* `USE_SYCL_KERNELS = on|off` (default: `off`) - use SYCL kernels for augmentation such as color space conversion instead of VAAPI interface. If SYCL kernels are requested but can not be used due to hardware limitations, then fallback to VAAPI will be attempted.

* `FORCE_CPU_FALLBACL=on|off` (default: `off`) - force CPU fallback.

## Known limitations

* [Intel® Data Center GPU Max Series][PVC] (Ponte Vecchio, PVC) GPUs are not supported due to missing hardware media engines
* SYCL color space conversion kernel is not supported on [Intel® Arc™ Pro A-Series Graphics][DG2] (Alchemist, DG2) and [Intel® Data Center GPU Flex Series][ATS-M] (Archtic Sound, ATS-M) GPUs as 64-bit floating point operations used in the kernel are not available on these GPUs


[TorchCodec]: https://github.com/meta-pytorch/torchcodec

[ATS-M]: https://www.intel.com/content/www/us/en/ark/products/series/230021/intel-data-center-gpu-flex-series.html
[DG2]: https://www.intel.com/content/www/us/en/ark/products/series/241358/intel-arc-pro-a-series-graphics.html
[PVC]: https://www.intel.com/content/www/us/en/ark/products/series/232874/intel-data-center-gpu-max-series.html
