Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
flash-attention
Commits
eb812c20
Commit
eb812c20
authored
Jun 07, 2023
by
Pierce Freeman
Browse files
Remove builder project
parent
6c730dc8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
72 deletions
+0
-72
flash_attn_builder/README.md
flash_attn_builder/README.md
+0
-3
flash_attn_builder/flash_attn_builder/__init__.py
flash_attn_builder/flash_attn_builder/__init__.py
+0
-0
flash_attn_builder/flash_attn_builder/main.py
flash_attn_builder/flash_attn_builder/main.py
+0
-54
flash_attn_builder/pyproject.toml
flash_attn_builder/pyproject.toml
+0
-15
No files found.
flash_attn_builder/README.md
deleted
100644 → 0
View file @
6c730dc8
## flash-attn-builder
Basic build utilities for flash-attn.
flash_attn_builder/flash_attn_builder/__init__.py
deleted
100644 → 0
View file @
6c730dc8
flash_attn_builder/flash_attn_builder/main.py
deleted
100644 → 0
View file @
6c730dc8
import
os
import
sys
import
urllib
import
setuptools.build_meta
from
setuptools.command.install
import
install
from
packaging.version
import
parse
,
Version
# @pierce - TODO: Update for proper release
BASE_WHEEL_URL
=
"https://github.com/piercefreeman/flash-attention/releases/download/{tag_name}/{wheel_name}"
# FORCE_BUILD: Force a fresh build locally, instead of attempting to find prebuilt wheels
# SKIP_CUDA_BUILD: Intended to allow CI to use a simple `python setup.py sdist` run to copy over raw files, without any cuda compilation
FORCE_BUILD
=
os
.
getenv
(
"FLASH_ATTENTION_FORCE_BUILD"
,
"FALSE"
)
==
"TRUE"
class
CustomBuildBackend
(
setuptools
.
build_meta
.
_BuildMetaBackend
):
def
build_wheel
(
self
,
wheel_directory
,
config_settings
=
None
,
metadata_directory
=
None
):
this_file_directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
print
(
f
'This file is located in:
{
this_file_directory
}
'
)
sys
.
argv
=
[
*
sys
.
argv
[:
1
],
*
self
.
_global_args
(
config_settings
),
*
self
.
_arbitrary_args
(
config_settings
),
]
with
setuptools
.
build_meta
.
no_install_setup_requires
():
self
.
run_setup
()
print
(
"OS"
,
os
.
environ
[
"FLASH_ATTENTION_WHEEL_URL"
])
print
(
"config_settings"
,
config_settings
)
print
(
"metadata_directory"
,
metadata_directory
)
raise
ValueError
print
(
"Guessing wheel URL: "
,
wheel_url
)
try
:
urllib
.
request
.
urlretrieve
(
wheel_url
,
wheel_filename
)
os
.
system
(
f
'pip install
{
wheel_filename
}
'
)
os
.
remove
(
wheel_filename
)
except
urllib
.
error
.
HTTPError
:
print
(
"Precompiled wheel not found. Building from source..."
)
# If the wheel could not be downloaded, build from source
super
().
build_wheel
(
wheel_directory
,
config_settings
,
metadata_directory
)
_BACKEND
=
CustomBuildBackend
()
# noqa
get_requires_for_build_wheel
=
_BACKEND
.
get_requires_for_build_wheel
get_requires_for_build_sdist
=
_BACKEND
.
get_requires_for_build_sdist
prepare_metadata_for_build_wheel
=
_BACKEND
.
prepare_metadata_for_build_wheel
build_wheel
=
_BACKEND
.
build_wheel
build_sdist
=
_BACKEND
.
build_sdist
flash_attn_builder/pyproject.toml
deleted
100644 → 0
View file @
6c730dc8
[tool.poetry]
name
=
"flash-attn-builder"
version
=
"0.1.0"
description
=
""
authors
=
[
"Pierce Freeman <pierce@freeman.vc>"
]
readme
=
"README.md"
packages
=
[
{include
=
"flash_attn_builder"
}
]
[tool.poetry.dependencies]
python
=
"^3.10"
[build-system]
requires
=
["poetry-core"]
build-backend
=
"poetry.core.masonry.api"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment