Installation#
Build from Source#
CUDA platform#
git clone https://github.com/flagos-ai/PyTorch-Plugin-FL.git && cd PyTorch-Plugin-FL
pip install -e . --no-build-isolation
MACA platform#
# Set MACA cu-bridge library path, depending on the actual cu-bridge path in your environment
export LD_LIBRARY_PATH=/opt/maca/tools/cu-bridge/lib:$LD_LIBRARY_PATH
ACCELERATOR=maca pip install -e . --no-build-isolation
Huawei Ascend platform#
# Ensure CANN toolkit is installed and environment is sourced
# (typically: source /usr/local/Ascend/ascend-toolkit/set_env.sh)
ACCELERATOR=ascend FLAGGEMS_KERNEL=0 CUDA_KERNEL=0 ASCEND_KERNEL=1 \
pip install --no-build-isolation -vvv -e .
On Ascend, FlagGems and CUDA kernels are disabled. Only the Ascend kernel backend (ACL NN API) is compiled.
Build Environment Variables#
Variable |
Description |
|---|---|
|
Hardware platform: |
|
CUDA toolkit path |
|
MACA SDK path (default |
|
CANN toolkit path (default |
|
FlagGems C++ library path (enables low-overhead C++ dispatch) |
|
Enable FlagGems kernel build ( |
|
Enable CUDA kernel build ( |
|
Enable Ascend kernel build ( |
Runtime Environment Variables#
Variable |
Description |
|---|---|
|
Set to |
|
FlagGems source directory (required when C++ native API ops route to |
|
Override path for |
|
Set to |
|
Per-operator backend override (replace |