-
Notifications
You must be signed in to change notification settings - Fork 659
How can I enable warnings and unavailable? memory_efficient_attention.ckF #1244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure I understand the issue. Are you asking about why some of the backends for All the ones starting with The "odd" one is the xformers/xformers/ops/fmha/flash3.py Line 567 in c5c0720
It's quite likely that |
How can I override CUDA_MINIMUM_COMPUTE_CAPABILITY = (9, 0) to CUDA_MINIMUM_COMPUTE_CAPABILITY = (8.9, 0) ? |
You would have to modify the source code and reinstall. Also, you would have to set it to |
``> You would have to modify the source code and reinstall. Also, you would have to set it to (https://github.com/amDosion/xformers/blob/main/xformers/ops/fmha/flash3.py) I forked the code and modified it to: CUDA_MINIMUM_COMPUTE_CAPABILITY = (8, 9)
|
BTW, why do you specifically need FlashAttention3? |
It is not particularly necessary, but I just hope that the compilation can be successful, so that if it is needed later, there is no need to recompile. |
❓ Questions and Help
`# ==================================================
🔧 [6.3] Ninja + xformers 编译安装(适配 CUDA 12.8)
==================================================
INSTALL_XFORMERS="${INSTALL_XFORMERS:-true}"
MAIN_REPO_DIR="/app/webui/sd-webui-forge"
XFORMERS_DIR="${MAIN_REPO_DIR}/xformers-src"
TORCH_VER="2.8.0.dev20250326+cu128"
VISION_VER="0.22.0.dev20250326+cu128"
AUDIO_VER="2.6.0.dev20250326+cu128"
TORCH_COMMAND="pip install --pre torch==${TORCH_VER} torchvision==${VISION_VER} torchaudio==${AUDIO_VER} --extra-index-url https://download.pytorch.org/whl/nightly/cu128"
if [[ "$INSTALL_XFORMERS" == "true" ]]; then
echo "⚙️ [6.3] 正在编译并安装 xformers(适配 CUDA 12.8)"
echo "🐍 当前 Python 路径: $(which python)"
echo "🔍 检查 xformers 是否已正确安装..."
if python -c "import xformers" >/dev/null 2>&1 && python -m xformers.info | grep -q "available"; then
echo "✅ 已检测到 xformers 且扩展已启用,版本: $(python -c 'import xformers; print(xformers.version)')"
echo "📦 当前环境无需重新编译 xformers"
fi
echo "📦 检查 PyTorch 是否为指定版本..."
torch_ver=$(pip show torch 2>/dev/null | awk '/^Version:/{print $2}')
vision_ver=$(pip show torchvision 2>/dev/null | awk '/^Version:/{print $2}')
audio_ver=$(pip show torchaudio 2>/dev/null | awk '/^Version:/{print $2}')
if [[ "$torch_ver" != "$TORCH_VER" || "$vision_ver" != "$VISION_VER" || "$audio_ver" != "$AUDIO_VER" ]]; then
echo "🔧 安装指定版本的 PyTorch 组件..."
echo " ➤ $TORCH_COMMAND"
$TORCH_COMMAND && echo " ✅ PyTorch 安装成功" || { echo " ❌ PyTorch 安装失败"; exit 1; }
else
echo " ✅ 已存在所需版本 torch/vision/audio,跳过安装"
fi
echo "📦 检查并安装 pip 构建依赖..."⚠️ 安装 $pkg 失败,请检查网络或 PyPI"
for pkg in pip wheel setuptools cmake ninja; do
ver=$(pip show "$pkg" 2>/dev/null | awk '/^Version:/{print $2}')
if [[ -n "$ver" ]]; then
echo " ✅ $pkg 已安装: v$ver"
else
echo " ❌ $pkg 未安装,尝试安装中..."
pip install "$pkg" --no-cache-dir || echo "
fi
done
✅ 检查系统依赖(仅 root 用户可自动安装)
if [ "$(id -u)" -eq 0 ]; then⚠️ 缺失依赖: ${MISSING[*]},尝试安装..."⚠️ 当前非 root 用户,跳过系统依赖安装"
echo "🔧 检查系统构建依赖是否已安装..."
MISSING=()
command -v g++ >/dev/null && echo " ✅ g++ 已安装: $(g++ --version | head -n 1)" || MISSING+=("g++")
command -v zip >/dev/null && echo " ✅ zip 已安装: $(zip -v | head -n 1)" || MISSING+=("zip")
command -v unzip >/dev/null && echo " ✅ unzip 已安装: $(unzip -v | head -n 1)" || MISSING+=("unzip")
if [ "${#MISSING[@]}" -eq 0 ]; then
echo "🎉 所有系统构建依赖已满足,无需安装。"
else
echo "
apt-get update && apt-get install -y "${MISSING[@]}"
fi
else
echo "
fi
✅ 准备源码
echo "📁 准备 xformers 源码..."⚠️ 仓库更新失败,跳过"
if [ ! -d "$XFORMERS_DIR/.git" ]; then
echo " - 克隆 xformers 仓库..."
git clone --recursive https://github.com/facebookresearch/xformers.git "$XFORMERS_DIR"
else
echo " - 已存在源码目录,执行 pull..."
cd "$XFORMERS_DIR"
git pull --ff-only || echo "
cd "$MAIN_REPO_DIR"
fi
echo "🔄 初始化子模块(包含 Flash-Attention)..."
cd "$XFORMERS_DIR"
git submodule update --init --recursive || {
echo "❌ 子模块拉取失败,请检查 .gitmodules 或网络连接"
exit 1
}
echo "🔧 开始构建 xformers..."
export XFORMERS_FORCE_CUDA=1
export XFORMERS_BUILD_CPP=1
export TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST:-8.9}"
export MAX_JOBS=8
echo " ➤ CUDA 架构: $TORCH_CUDA_ARCH_LIST"
echo " ➤ 并行编译线程数: $MAX_JOBS"
pip install -v -e . --no-build-isolation
build_result=$?
unset XFORMERS_FORCE_CUDA
unset XFORMERS_BUILD_CPP
unset TORCH_CUDA_ARCH_LIST
unset MAX_JOBS
if [ $build_result -ne 0 ]; then
echo "❌ xformers 编译失败,尝试输出诊断信息..."
python -m pip list | grep -E 'torch|xformers|ninja|wheel|cmake|setuptools'
exit 1
fi
echo "✅ xformers 安装完成(已启用 C++ 扩展)"
echo "📋 运行 torch 环境收集..."
python -m torch.utils.collect_env | tee ../torch_env.txt
echo "🧩 运行 xformers.info 检查模块状态..."⚠️ 无法执行 xformers.info"
python -m xformers.info | tee ../xformers_info.txt || echo "
if grep -q "unavailable" ../xformers_info.txt; then⚠️ 以下模块未启用:"
echo "
grep "unavailable" ../xformers_info.txt | sed 's/^/ - /'
else
echo "✅ 所有 C++ 扩展模块可用 ✅"
fi
echo "📁 xformers 源码目录: $(realpath "$XFORMERS_DIR")"
echo "🐍 当前 Python: $(which python)"
cd "$MAIN_REPO_DIR"
else
echo "⏭️ [6.3] 跳过 xformers 编译安装(INSTALL_XFORMERS=false)"
fi
log:
[6.3] 正在编译并安装 xformers(适配 CUDA 12.8)
🐍 当前 Python 路径: /app/webui/sd-webui-forge/venv/bin/python
🔍 检查 xformers 是否已正确安装...
✅ 已检测到 xformers 且扩展已启用,版本: 0.0.30+c5c0720c.d20250414
📦 当前环境无需重新编译 xformers
📦 检查 PyTorch 是否为指定版本...
✅ 已存在所需版本 torch/vision/audio,跳过安装
📦 检查并安装 pip 构建依赖...
✅ pip 已安装: v25.0.1
✅ wheel 已安装: v0.45.1
✅ setuptools 已安装: v78.1.0
✅ cmake 已安装: v4.0.0
✅ ninja 已安装: v1.11.1.4
🔧 检查系统构建依赖是否已安装...
✅ g++ 已安装: g++ (GCC) 12.4.0
✅ zip 已安装: Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
✅ unzip 已安装: UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.
🎉 所有系统构建依赖已满足,无需安装。
📁 准备 xformers 源码...
已存在源码目录,执行 pull...
Already up to date.
🔄 初始化子模块(包含 Flash-Attention)...
🔧 开始构建 xformers...
➤ CUDA 架构: 8.9
➤ 并行编译线程数: 8
Using pip 25.0.1 from /app/webui/sd-webui-forge/venv/lib/python3.11/site-packages/pip (python 3.11)
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/nightly/cu128
Obtaining file:///app/webui/sd-webui-forge/xformers-src
Preparing metadata (setup.py): started
Running command python setup.py egg_info
/app/webui/sd-webui-forge/venv/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
!!
self._finalize_license_expression()
running egg_info
creating /tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info
writing /tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/SOURCES.txt'
reading manifest file '/tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'third_party/flash-attention/version.txt'
adding license file 'LICENSE'
writing manifest file '/tmp/pip-pip-egg-info-9e4nfg6i/xformers.egg-info/SOURCES.txt'
Preparing metadata (setup.py): finished with status 'done'
Installing collected packages: xformers
Attempting uninstall: xformers
Found existing installation: xformers 0.0.30+c5c0720c.d20250414
Uninstalling xformers-0.0.30+c5c0720c.d20250414:
Removing file or directory /app/webui/sd-webui-forge/venv/lib/python3.11/site-packages/xformers.egg-link
Removing pth entries from /app/webui/sd-webui-forge/venv/lib/python3.11/site-packages/easy-install.pth:
Removing entry: /app/webui/sd-webui-forge/xformers-src
Successfully uninstalled xformers-0.0.30+c5c0720c.d20250414
DEPRECATION: Legacy editable install of xformers==0.0.30+c5c0720c.d20250414 from file:///app/webui/sd-webui-forge/xformers-src (setup.py develop) is deprecated. pip 25.1 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at pypa/pip#11457
Running setup.py develop for xformers
Running command python setup.py develop
/app/webui/sd-webui-forge/venv/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
Successfully installed xformers
✅ xformers 安装完成(已启用 C++ 扩展)
📋 运行 torch 环境收集...
:128: RuntimeWarning: 'torch.utils.collect_env' found in sys.modules after import of package 'torch.utils', but prior to execution of 'torch.utils.collect_env'; this may result in unpredictable behaviour
Collecting environment information...
PyTorch version: 2.8.0.dev20250326+cu128
Is debug build: False
CUDA used to build PyTorch: 12.8
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (GCC) 12.4.0
Clang version: 20.1.2 (++20250401083310+e7406753caf3-1
exp120250401203329.93)CMake version: version 4.0.0
Libc version: glibc-2.35
Python version: 3.11.0rc1 (main, Aug 12 2022, 10:02:14) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.12.22-Unraid-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.8.93
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version: 570.133.07
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.8.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 43 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: AuthenticAMD
Model name: AMD EPYC 7302 16-Core Processor
CPU family: 23
Model: 49
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU max MHz: 3310.5459
CPU min MHz: 1500.0000
BogoMIPS: 5999.79
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sev sev_es
Virtualization: AMD-V
L1d cache: 512 KiB (16 instances)
L1i cache: 512 KiB (16 instances)
L2 cache: 8 MiB (16 instances)
L3 cache: 128 MiB (8 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; untrained return thunk; SMT enabled with STIBP protection
Vulnerability Spec rstack overflow: Mitigation; Safe RET
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
⚠️ 以下模块未启用:
[pip3] numpy==2.1.3
[pip3] nvidia-cublas-cu12==12.8.3.14
[pip3] nvidia-cuda-cupti-cu12==12.8.57
[pip3] nvidia-cuda-nvrtc-cu12==12.8.61
[pip3] nvidia-cuda-runtime-cu12==12.8.57
[pip3] nvidia-cudnn-cu12==9.8.0.87
[pip3] nvidia-cufft-cu12==11.3.3.41
[pip3] nvidia-curand-cu12==10.3.9.55
[pip3] nvidia-cusolver-cu12==11.7.2.55
[pip3] nvidia-cusparse-cu12==12.5.7.53
[pip3] nvidia-cusparselt-cu12==0.6.3
[pip3] nvidia-nccl-cu12==2.26.2
[pip3] nvidia-nvjitlink-cu12==12.8.61
[pip3] nvidia-nvtx-cu12==12.8.55
[pip3] open_clip_torch==2.32.0
[pip3] optree==0.15.0
[pip3] pytorch-lightning==2.5.1
[pip3] pytorch-triton==3.3.0+git96316ce5
[pip3] torch==2.8.0.dev20250326+cu128
[pip3] torchaudio==2.6.0.dev20250326+cu128
[pip3] torchdiffeq==0.2.5
[pip3] torchmetrics==1.7.1
[pip3] torchsde==0.2.6
[pip3] torchvision==0.22.0.dev20250326+cu128
[conda] Could not collect
🧩 运行 xformers.info 检查模块状态...
xFormers 0.0.30+c5c0720c.d20250414
memory_efficient_attention.ckF: unavailable
memory_efficient_attention.ckB: unavailable
memory_efficient_attention.ck_decoderF: unavailable
memory_efficient_attention.ck_splitKF: unavailable
memory_efficient_attention.cutlassF-pt: available
memory_efficient_attention.cutlassB-pt: available
[email protected]: available
[email protected]: available
[email protected]: unavailable
[email protected]: unavailable
memory_efficient_attention.triton_splitKF: available
indexing.scaled_index_addF: available
indexing.scaled_index_addB: available
indexing.index_select: available
sp24.sparse24_sparsify_both_ways: available
sp24.sparse24_apply: available
sp24.sparse24_apply_dense_output: available
sp24._sparse24_gemm: available
[email protected]: available
[email protected]: available
swiglu.dual_gemm_silu: available
swiglu.gemm_fused_operand_sum: available
swiglu.fused.p.cpp: available
is_triton_available: True
pytorch.version: 2.8.0.dev20250326+cu128
pytorch.cuda: available
gpu.compute_capability: 8.9
gpu.name: NVIDIA GeForce RTX 4090
dcgm_profiler: unavailable
build.info: available
build.cuda_version: 1208
build.hip_version: None
build.python_version: 3.11.0rc1
build.torch_version: 2.8.0.dev20250326+cu128
build.env.TORCH_CUDA_ARCH_LIST: 8.9
build.env.PYTORCH_ROCM_ARCH: None
build.env.XFORMERS_BUILD_TYPE: None
build.env.XFORMERS_ENABLE_DEBUG_ASSERTIONS: None
build.env.NVCC_FLAGS: None
build.env.XFORMERS_PACKAGE_FROM: None
build.nvcc_version: 12.8.93
source.privacy: open source
- memory_efficient_attention.ckF: unavailable
- memory_efficient_attention.ckB: unavailable
- memory_efficient_attention.ck_decoderF: unavailable
- memory_efficient_attention.ck_splitKF: unavailable
- [email protected]: unavailable
- [email protected]: unavailable
- dcgm_profiler: unavailable
📁 xformers 源码目录: /app/webui/sd-webui-forge/xformers-src`
How can I enable warnings and unavailable?
The text was updated successfully, but these errors were encountered: