Use the PPU pip source in PAI (v1.7.x)

更新时间:
复制 MD 格式

1. PPU pip source

  • The PPU pip source provides frameworks optimized for SAIL products and open-source libraries recompiled based on the PPU SDK. Use the pip install command to install packages and quickly set up a production environment. If a required package is not found in the PPU pip source, it defaults to downloading from the official PyPI source.

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

  • The PPU-PIP package list is continuously updated with iterations of the PPU SDK v1.7.x pip source.

2. Package list

The PPU-PIP Package List contains a complete list of pip packages for the PPU SDK v1.7.x release, where "ce" indicates open-source framework packages compiled based on the SAIL SDK, and "oe" indicates framework packages that are performance-optimized for the SAIL product.

3. Naming conventions

3.1 Pip source URL convention (legacy OS/CUDA-bound mode)

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 URL prefix

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

Indicates CUDA 11.8

Fixed format

3.2 Pip source URL convention (new URL)

The new URL no longer contains OS or CUDA information. Starting from SAIL PIP 1.7.x, all pip packages are uploaded to a single URL. During installation, pip automatically detects the 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

Compared to the legacy OS/CUDA-bound mode, the new source URL is simpler.

For a limited time, you can still use the legacy OS/CUDA-bound URLs to download newly released packages. You can choose which URL to use based on your needs.

3.3 Naming convention for pip install commands

Take pip install apex==25.4+ppu1.7.0.ce as an example:

25.4

+ppu

1.7.0

.ce or .oe

Framework version number

Fixed format

Release version

ce: Community Edition

oe: Optimized Edition (optimized for PPU)

  • If ce and oe are not specified, you can also successfully install the package by running the command pip install apex==25.4+ppu1.7.0. If the current configuration contains both an open-source PIP package and a PIP package optimized for the SAIL product, the optimized package is installed by default.

  • Default release version: If you do not specify a release version and run the pip install apex==25.4 command, the latest apex25.4 package from the SAIL pip source is installed by default.

  • If you run pip install apex without specifying a version number, the latest version of Apex for the framework is installed by default from the SAIL pip source, which is apex25.9.

4. Examples

4.1 Specify the SAIL SDK 1.7.0 version

  • Use case: Install apex 25.4 in the SAIL SDK 1.7.0 Docker image: llm:pytorch2.7.0-ubuntu24.04-cuda12.8-sglang0.5.2-py312.

  1. Search the pip package list.

  2. Filter for apex 25.4 and find the installation command for a configuration with Ubuntu 24.04, CUDA 12.8, PyTorch 2.7.0, and Python 3.12.

image.png

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

Important: You must manually add +ppu1.7.0 to the command.

4.2 Install the latest package

The SAIL SDK offers some backward compatibility. Therefore, wheel packages in the pip source, especially Community Edition packages, only need to be released for a major SDK version (e.g., 1.7.0) and not for each minor iteration (e.g., 1.7.1).

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

5. Troubleshooting

To resolve a hash mismatch error from the pip source, use the --no-cache-dir option.

image.png

pip install --no-cache-dir torch==2.1.2+ppu1.4.0

Alternatively, you can run the pip cache purge command to clear the entire pip cache on your system.

pip cache purge