Fork Release v1.8 — PyTorch 2.14.0+cu132 Compatibility & Upstream Sync
Overview
Fork release v1.8 provides verified compatibility for PyTorch 2.14.0+cu132 under Windows MSVC, resolves linker symbol mismatches (LNK2001 / LNK1120), synchronizes the latest official upstream improvements (ce088ab / FA4 CuTe DSL), and strictly maintains all fork-specific architectural features (24 split_align kernels, MSVC 2GB COFF limit bypass via 3:3 SM split, PEP 427 wheel naming, and complete CI workflow suppression).
1. PyTorch 2.14.0+cu132 C++ ABI Compatibility & Linker Fix
Root Cause of MSVC LNK1120 / LNK2001
When building against PyTorch 2.14.0 under MSVC, link.exe could fail with exit status 1120:
flash_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl c10::cuda::c10_cuda_check_implementation(int,char const *,char const *,unsigned int,bool)" (__imp_?c10_cuda_check_implementation@cuda@c10@@YAXHPEBD0I_N@Z)
Hint on matching symbol:
"__declspec(dllimport) void __cdecl c10::cuda::c10_cuda_check_implementation(int,char const *,char const *,unsigned int,bool,class c10::cuda::CUDAErrorLogCapture *)" (__imp_?c10_cuda_check_implementation@cuda@c10@@YAXHPEBD0I_NPEAVCUDAErrorLogCapture@12@@Z)
build\lib.win-amd64-cpython-314\flash_attn_2_cuda.cp314-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
Technical Breakdown
- Signature Expansion in PyTorch 2.14.0:
Starting in PyTorch 2.14.0, CUDA error handling was enhanced withc10::cuda::CUDAErrorLogCapture. The function signature ofc10_cuda_check_implementationinc10/cuda/CUDAException.hexpanded from 5 parameters to 6 parameters:// PyTorch 2.14.0+ signature: C10_CUDA_API void c10_cuda_check_implementation( const int32_t err, const char* filename, const char* function_name, const uint32_t line_number, const bool include_device_assertions, CUDAErrorLogCapture* error_log = nullptr);
- ABI Mismatch Mechanism:
PyTorch 2.14.0'sc10_cuda.libexports only the 6-parameter mangled symbol (?c10_cuda_check_implementation...PEAVCUDAErrorLogCapture...). If an existingflash_api.objcompiled under PyTorch 2.13.0 headers remained in the build tree, ninja skipped recompilation becauseflash_api.cpphad no source diff, causing the linker to request the obsolete 5-parameter symbol. - Resolution:
Purging intermediate build artifacts (build/directory) ensuresflash_api.cppcompiles freshly against PyTorch 2.14.0's header, correctly emitting references to the 6-parameter symbol with defaultnullptrand resolving cleanly without any external symbol gaps.
2. Upstream Sync (Dao-AILab/flash-attention @ ce088ab)
The latest changes from the authoritative upstream repository were cleanly merged without touching any FlashAttention-2 code:
- SM100 Scalar Mask Compilation Speedup (Dao-AILab#2819):
Replaced static Python loop expansion inflash_attn/cute/mask.pywith dynamic CuTeDSL unrolling for 128-element scalar mask-mod loops, reducing cold first-call compilation latency by ~31%. - CUTLASS DSL Requirement Relaxation (Dao-AILab#2798):
Updatedpyproject.tomldependency floor tonvidia-cutlass-dsl>=4.6.2to support newer QuACK releases and CUTLASS DSL 4.7. - QuACK Packed Subtraction Compatibility (Dao-AILab#2787):
Adaptedflash_attn/cute/flash_bwd_sm100.pyandutils.pyto invoke CuTe DSL primitives directly following QuACK's deprecation ofsub_packed_f32x2.
3. Preserved Fork Architecture & Windows Optimizations
All fork-specific optimizations remain 100% active and untouched:
- 24
split_alignForward Kernels:
Independent translation units (flash_fwd_split_align_*.cu) fornum_splits == 1sequences eliminateptxascompiler timeouts. - MSVC 2GB COFF Linker Limit Bypass (3:3 SM Split):
WindowsWhlBuilder_cuda_2.bat: Blackwell targets (100;120;121).WindowsWhlBuilder_cuda_3.bat: Legacy targets (80;89;90), withMAX_JOBS=5.
- PEP 427 Compliant Wheel Naming:
Uses.blackwelland.legacydot-suffixes to avoid pipInvalid build numbererrors. - Dynamic Runtime Versioning:
flash_attn/__init__.pyusesimportlib.metadatato dynamically reflect package version (2.9.1vs2.9.2). - CI Workflow Suppression:
.githubandtools/ciremain purged from the repository.
4. Pre-built Windows Wheels
Pre-compiled wheels are published on Hugging Face:
👉 ussoewwin/Flash-Attention-2_for_Windows
Quick Install Command
pip install https://huggingface.co/ussoewwin/Flash-Attention-2_for_Windows/resolve/main/<matching_wheel_file>.whl