From ad240e2c046fb86254f41aaabe2910726943b0bc Mon Sep 17 00:00:00 2001 From: danthe3rd Date: Thu, 12 Jan 2023 16:47:05 +0000 Subject: [PATCH] Additional fix for wheels on windows (include dirs) ghstack-source-id: 5d5e50ca22a2207675407a3ef1339ce69f578d28 Pull Request resolved: https://github.com/fairinternal/xformers/pull/422 __original_commit__ = fairinternal/xformers@56c23ff4c1d503a607ae7fa6931505953af2d19d --- setup.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 14b4972e6..138e05100 100644 --- a/setup.py +++ b/setup.py @@ -170,10 +170,12 @@ def get_flash_attention_extensions(cuda_version: int, extra_compile_args): + get_extra_nvcc_flags_for_build_type(), }, include_dirs=[ - Path(flash_root) / "csrc" / "flash_attn", - Path(flash_root) / "csrc" / "flash_attn" / "src", - # Path(flash_root) / 'csrc' / 'flash_attn' / 'cutlass' / 'include', - Path(this_dir) / "third_party" / "cutlass" / "include", + p.absolute() + for p in [ + Path(flash_root) / "csrc" / "flash_attn", + Path(flash_root) / "csrc" / "flash_attn" / "src", + Path(this_dir) / "third_party" / "cutlass" / "include", + ] ], ) ] @@ -254,7 +256,7 @@ def get_extensions(): extension( "xformers._C", sorted(sources), - include_dirs=include_dirs, + include_dirs=[os.path.abspath(p) for p in include_dirs], define_macros=define_macros, extra_compile_args=extra_compile_args, )