A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 5, 02:15 UTC
[FlashAttention] Don't overwrite `flash_attn_interface.py` when installing precompiled (#39932)
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Matthew Bonanni committed
Apr 15, 2026 at 16:43 UTC
c77e596e2eb6627d9f126436733550f2e31f642d
1 file changed
+11
-1
setup.py
+11
-1
@@ -693,6 +693,12 @@ class precompiled_wheel_utils:
693
flash_attn_regex = re.compile(
694
r"vllm/vllm_flash_attn/(?:[^/.][^/]*/)*(?!\.)[^/]*\.py"
695
)
696
+ # __init__.py and flash_attn_interface.py are source-controlled
697
+ # in vllm and should not be overwritten (matches cmake exclusions)
698
+ flash_attn_files_to_skip = {
699
+ "vllm/vllm_flash_attn/__init__.py",
700
+ "vllm/vllm_flash_attn/flash_attn_interface.py",
701
+ }
702
triton_kernels_regex = re.compile(
703
r"vllm/third_party/triton_kernels/(?:[^/.][^/]*/)*(?!\.)[^/]*\.py"
704
)
@@ -705,7 +711,11 @@ class precompiled_wheel_utils:
711
filter(lambda x: x.filename in files_to_copy, wheel.filelist)
712
)
713
file_members += list(
708
- filter(lambda x: flash_attn_regex.match(x.filename), wheel.filelist)
714
+ filter(
715
+ lambda x: flash_attn_regex.match(x.filename)
716
+ and x.filename not in flash_attn_files_to_skip,
717
+ wheel.filelist,
718
+ )
719
)
720
file_members += list(
721
filter(