PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
Add commit hash to version (#941)
Sun, Xuehao9052e31b065f
diff --git a/README.md b/README.mdindex 8522468c7..bdcd922ac 100644--- a/README.md+++ b/README.md@@ -6,7 +6,7 @@ AutoRound<h3> Advanced Quantization Algorithm for LLMs</h3>[](https://github.com/intel/auto-round)-[](https://github.com/intel/auto-round)+[](https://github.com/intel/auto-round)[](https://github.com/intel/auto-round/blob/main/LICENSE)<a href="https://huggingface.co/Intel"><img alt="Model Checkpoints" src="https://img.shields.io/badge/%F0%9F%A4%97%20HF-Models-F57C00">diff --git a/auto_round/version.py b/auto_round/version.pyindex c9c2dfb35..159f318f8 100644--- a/auto_round/version.py+++ b/auto_round/version.py@@ -14,4 +14,4 @@"""Intel® auto-round: An open-source Python librarysupporting popular model weight only compression based on signround."""-__version__ = "0.8.0.dev"+__version__ = "0.9.0"diff --git a/setup.py b/setup.pyindex 152359b19..119883c8f 100644--- a/setup.py+++ b/setup.py@@ -1,5 +1,6 @@import osimport re+import subprocessimport sysfrom functools import lru_cachefrom io import open@@ -15,14 +16,35 @@ try:except Exception as error:assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)-version = __version__-# All BUILD_* flags are initially set to `False`` and# will be updated to `True` if the corresponding environment check passes.PYPI_RELEASE = os.environ.get("PYPI_RELEASE", None)BUILD_HPU_ONLY = os.environ.get("BUILD_HPU_ONLY", "0") == "1"+def is_commit_on_tag():+ try:+ result = subprocess.run(+ ["git", "describe", "--exact-match", "--tags"], capture_output=True, text=True, check=True+ )+ tag_name = result.stdout.strip()+ return tag_name+ except subprocess.CalledProcessError:+ return False+++def get_build_version():+ if is_commit_on_tag():+ return __version__+ try:+ result = subprocess.run(["git", "describe", "--tags"], capture_output=True, text=True, check=True)+ distance = result.stdout.strip().split("-")[-2]+ commit = result.stdout.strip().split("-")[-1]+ return f"{__version__}.dev{distance}+{commit}"+ except subprocess.CalledProcessError:+ return __version__++@lru_cache(None)def is_habana_framework_installed():"""Check if Habana framework is installed.@@ -143,7 +165,7 @@ if __name__ == "__main__":setup(name=package_name,author="Intel AIPT Team",- version=version,+ version=get_build_version(),description="Repository of AutoRound: Advanced Weight-Only Quantization Algorithm for LLMs",long_description=open("README.md", "r", encoding="utf-8").read(),