-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix auto-round install & bump into 0.4.4 #387
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7558746
refactor install and bump version to 0.4.4
XuehaoSun 242f262
update install packages using wheel distribution
XuehaoSun 3f81404
fix
XuehaoSun 4e4b988
fix
XuehaoSun 08d4d54
fix pylint
XuehaoSun 300050e
fix pylint
XuehaoSun f20d8c2
update installation instructions
XuehaoSun 801cd0a
Merge branch 'main' into xuehao/fix_install
yiliu30 e1a6302
Add auto-round-lib (#397)
yiliu30 5d2ee3a
Update requirements-lib
XuehaoSun 024f506
build lib by default in gaudi docker
yiliu30 582121e
update the doc
yiliu30 5dbc191
remove lib if needed
yiliu30 e660e62
correct typo
yiliu30 2a77663
update to 1.19.0
XuehaoSun f9f8225
add datasets back
yiliu30 025b8a7
add transformers to requirements
XuehaoSun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include requirements.txt | ||
include requirements-cpu.txt | ||
include requirements-hpu.txt | ||
include requirements-lib.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
accelerate | ||
datasets | ||
py-cpuinfo | ||
sentencepiece | ||
torch | ||
transformers>=4.38 | ||
numpy < 2.0 | ||
threadpoolctl | ||
lm-eval>=0.4.2,<0.5 | ||
tqdm | ||
packaging | ||
pillow | ||
numba | ||
tbb | ||
intel-extension-for-pytorch | ||
intel-extension-for-transformers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
auto-gptq>=0.7.1 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
|
||
def is_cuda_available(): | ||
try: | ||
os.system("pip install torch") | ||
import torch | ||
|
||
return torch.cuda.is_available() | ||
|
@@ -112,15 +111,6 @@ def detect_local_sm_architectures(): | |
return arch_list | ||
|
||
|
||
def detect_hardware(): | ||
if is_hpu_available(): | ||
return "requirements-hpu.txt" | ||
elif is_cuda_available(): | ||
return "requirements.txt" | ||
else: | ||
return "requirements-cpu.txt" | ||
|
||
|
||
UNSUPPORTED_COMPUTE_CAPABILITIES = ['3.5', '3.7', '5.0', '5.2', '5.3'] | ||
|
||
if BUILD_CUDA_EXT: | ||
|
@@ -229,23 +219,60 @@ def detect_hardware(): | |
"auto_round_extension.*", | ||
], | ||
), | ||
"install_requires": fetch_requirements(detect_hardware()), | ||
"install_requires": fetch_requirements("requirements.txt"), | ||
"extras_require": { | ||
"gpu": fetch_requirements("requirements-gpu.txt"), | ||
"cpu": fetch_requirements("requirements-cpu.txt"), | ||
}, | ||
} | ||
|
||
############################################################################### | ||
# Configuration for auto_round_lib | ||
# From pip: | ||
# pip install auto-round-lib | ||
# From source: | ||
# python setup.py lib install | ||
############################################################################### | ||
|
||
|
||
LIB_REQUIREMENTS_FILE = "requirements-lib.txt" | ||
LIB_INSTALL_CFG = { | ||
"include_packages": find_packages( | ||
include=[ | ||
"auto_round", | ||
"auto_round.*", | ||
"auto_round_extension", | ||
"auto_round_extension.*", | ||
], | ||
), | ||
"install_requires": fetch_requirements(LIB_REQUIREMENTS_FILE), | ||
} | ||
|
||
if __name__ == "__main__": | ||
# There are two ways to install hpu-only package: | ||
# 1. pip install -vvv --no-build-isolation -e .[hpu] | ||
# 2. Within the gaudi docker where the HPU is available, we install the hpu package by default. | ||
# 1. python setup.py lib install | ||
# 2. Within the gaudi docker where the HPU is available, we install the auto_round_lib by default. | ||
is_user_requesting_library_build = "lib" in sys.argv | ||
if is_user_requesting_library_build: | ||
sys.argv.remove("lib") | ||
should_build_library = is_user_requesting_library_build or BUILD_HPU_ONLY | ||
|
||
if should_build_library: | ||
package_name = "auto_round_lib" | ||
INSTALL_CFG = LIB_INSTALL_CFG | ||
else: | ||
package_name = "auto_round" | ||
INSTALL_CFG = PKG_INSTALL_CFG | ||
|
||
include_packages = PKG_INSTALL_CFG.get("include_packages", {}) | ||
install_requires = PKG_INSTALL_CFG.get("install_requires", []) | ||
extras_require = PKG_INSTALL_CFG.get("extras_require", {}) | ||
include_packages = INSTALL_CFG.get("include_packages", {}) | ||
install_requires = INSTALL_CFG.get("install_requires", []) | ||
extras_require = INSTALL_CFG.get("extras_require", {}) | ||
|
||
setup( | ||
name="auto_round", | ||
name=package_name, | ||
author="Intel AIPT Team", | ||
version=version, | ||
author_email="[email protected], [email protected]", | ||
author_email="[email protected], [email protected], [email protected]", | ||
description="Repository of AutoRound: Advanced Weight-Only Quantization Algorithm for LLMs", | ||
long_description=open("README.md", "r", encoding="utf-8").read(), | ||
long_description_content_type="text/markdown", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above 4 should be in requirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All platforms will install requirement.txt, we can't add incompatible packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic requirement must support tuning on GPU, otherwise, the user experience will suffer. We may release a whl for HPU.