Skip to content

Commit

Permalink
add quanization lib to an install script
Browse files Browse the repository at this point in the history
  • Loading branch information
baptistecolle committed Aug 16, 2024
1 parent f3058f1 commit 342ddf1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 106 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ install_cli_cpu_neural_compressor:

install_cli_cuda_pytorch:
pip install -e .[testing,timm,diffusers,peft,autoawq,auto-gptq,bitsandbytes,deepspeed]
optimum-benchmark +install_auto_awq_from_source=True
optimum-benchmark +install_auto_gptq_from_source=True
curl -s https://raw.githubusercontent.com/huggingface/optimum-benchmark/main/scripts/total_tests_runs.py | python - --install-autoawq --install-auto-gptq

install_cli_rocm_pytorch:
pip install -e .[testing,timm,diffusers,peft,autoawq,auto-gptq,deepspeed]
Expand Down
4 changes: 2 additions & 2 deletions optimum_benchmark/backends/pytorch/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def process_quantization_config(self) -> None:
raise ImportError(
"GPTQ quantization requires the AutoGPTQ package. "
"Please install it from source at `https://github.com/AutoGPTQ/AutoGPTQ`"
"Or run optimum-benchmark +install_auto_gptq_from_source=True"
"Or `curl -s https://raw.githubusercontent.com/huggingface/optimum-benchmark/main/scripts/total_tests_runs.py | python - --install-auto-gptq`"
)

self.quantization_config = GPTQConfig(
Expand All @@ -308,7 +308,7 @@ def process_quantization_config(self) -> None:
raise ImportError(
"AWQ quantization requires the AutoAWQ package. "
"Please install it from source at `https://github.com/casper-hansen/AutoAWQ`"
"Or run optimum-benchmark +install_auto_awq_from_source=True"
"Or `curl -s https://raw.githubusercontent.com/huggingface/optimum-benchmark/main/scripts/total_tests_runs.py | python - --install-autoawq`"
)

self.quantization_config = AwqConfig(
Expand Down
12 changes: 0 additions & 12 deletions optimum_benchmark/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from hydra.core.config_store import ConfigStore
from omegaconf import DictConfig, OmegaConf

from optimum_benchmark.install_utils import InstallConfig, install_autoawq, install_autogptq

from . import (
Benchmark,
BenchmarkConfig,
Expand Down Expand Up @@ -57,20 +55,10 @@
cs.store(group="launcher", name=ProcessConfig.name, node=ProcessConfig)
cs.store(group="launcher", name=TorchrunConfig.name, node=TorchrunConfig)

cs.store(name="install_config", node=InstallConfig)


# optimum-benchmark
@hydra.main(version_base=None)
def main(config: DictConfig) -> None:
if "install_auto_awq_from_source" in config and config.install_auto_awq_from_source:
install_autoawq()
return

if "install_auto_gptq_from_source" in config and config.install_auto_gptq_from_source:
install_autogptq()
return

log_level = os.environ.get("LOG_LEVEL", "INFO")
log_to_file = os.environ.get("LOG_TO_FILE", "1") == "1"
override_benchmarks = os.environ.get("OVERRIDE_BENCHMARKS", "0") == "1"
Expand Down
90 changes: 0 additions & 90 deletions optimum_benchmark/install_utils.py

This file was deleted.

0 comments on commit 342ddf1

Please sign in to comment.