PPU PIP source in PAI (v2.0.x)

更新时间:
复制 MD 格式

1. PPU PIP source

  • Use pip install to quickly set up a production environment. If a required package is not available in the PPU PIP source, pip pulls it from the official PYPI source by default.

  • Packages in the PPU PIP source are released with official PPU SDK versions and updated weekly.

  • The PIP package list is continuously updated with new packages from the PPU PIP source for PPU SDK v2.0.x.

2. PIP package list

The PIP package list contains all packages you can install with pip for the PPU SDK v2.0 release. In this list, "ce" indicates open-source framework packages compiled with the SAIL SDK, while "oe" indicates framework packages with performance optimizations for the SAIL product.

3. Naming convention

3.1 Legacy PIP source URL (OS/CUDA-bound)

Take https://art-pub.eng.t-head.cn/artifactory/api/pypi/ptgai-pypi_ppu_ubuntu_cu118_index/simple/ as an example:

https://art-pub.eng.t-head.cn/artifactory/api/pypi/ptgai-pypi_ppu_

ubuntu_

cu118_

index/simple/

Fixed source URL prefix

Distinguishes between ubuntu and alios, but not specific OS versions.

Indicates CUDA 11.8.

Fixed format

3.2 New PIP source URL

The new URL no longer includes OS or CUDA information. Starting with SAIL PIP 1.7.x, all PIP packages are uploaded to a single URL. During installation, pip automatically detects your production environment and installs the package that matches your environment's CUDA, Torch, and Python versions.

https://art-pub.eng.t-head.cn/artifactory/api/pypi/pypi_index/simple

The new source URL is simpler than the one used in the legacy OS/CUDA-bound mode.

You can continue to use the legacy OS/CUDA-bound URLs to download new packages for the foreseeable future. You can choose the URL that best suits your needs.

3.3 Package version naming convention

Take pip install apex==25.4+ppu2.0.0.ce as an example:

25.4

+ppu

2.0.0

.ce or .oe

Framework version

Fixed format

Release version

ce: open source (Community Edition)

oe: optimized for PPU (Optimized Edition)

  • Omitting the edition suffix (.ce or .oe): If you omit the edition suffix by running a command like pip install apex==25.4+ppu2.0.0, the installation still succeeds. If both an open-source and an optimized package are available for your configuration, the optimized package is installed by default.

  • Omitting the release version: If you omit the release version by running a command like pip install apex==25.4, pip installs the latest apex 25.4 package from the PPU PIP source.

  • Omitting the framework version: If you omit the version number entirely by running pip install apex, pip installs the latest framework version of apex available in the PPU PIP source, which is currently apex25.9.

4. Usage examples

4.1 Pin to the SAIL SDK 2.0.0 version

Use case: Install apex 25.4 in the llm:pytorch2.7.0-ubuntu24.04-cuda12.8-sglang0.5.2-py312 Docker image, which was released with SAIL SDK 2.0.0.

  1. Search the PIP package list.

  2. Filter for apex25.4 and find the installation command for the configuration that matches ubuntu24.04, cuda12.8, pytorch2.7.0, and python3.12.

image.png

pip install apex==25.4+ppu2.0.0 -i https://art-pub.eng.t-head.cn/artifactory/api/pypi/pypi_index/simple

Note: You must manually add +ppu2.0.0 to the command.

5. PIP source and SDK compatibility

PPU SDK 2.0 adds support for the ZW890 device. The compiler can now generate multi-generation Device Binaries during compilation. As a result, the device Fatbin file format version has been updated, leading to some compatibility changes.

PPU SDK 2.0 is API-compatible with PPU SDK versions 1.7.x, 1.6.x, and 1.5.x. However, compatibility differs for the device binary format and library files:

  • Backward compatibility

Wheel files (.whl) built with older SDK versions (1.7.x, 1.6.x, and 1.5.x) are compatible with the PPU SDK v2.0 environment.

  • Forward compatibility

Wheel files (.whl) built with PPU SDK 2.0 are not compatible with environments running older SDK versions (1.7.x, 1.6.x, and 1.5.x).

PPU SDK 2.0 is not compatible with PPU SDK 1.4 or earlier versions.

6. Test platforms

The test platforms are the products on which these wheel packages have been verified. However, the packages are not limited to these products. Currently, these products include BTV1.0/1.1 and BTV1.5.

7. FAQ

  • If you encounter a hash value mismatch error, use the --no-cache-dir option to resolve it.

    image.png

    pip install --no-cache-dir apex==25.9+ppu2.0.0

    Alternatively, run the pip cache purge command to clear the pip cache.

    pip cache purge
  • If you have already installed torch but still receive an "Import torch failed: No module named 'torch'" error, try adding the --no-build-isolation parameter to your pip install command.

    pip install --no-build-isolation apex==25.9+ppu2.0.0