Skip to content

Commit

Permalink
Remove itrex dependency for 3x example (#2016)
Browse files Browse the repository at this point in the history
Signed-off-by: Kaihui-intel <[email protected]>
Co-authored-by: Sun, Xuehao <[email protected]>
  • Loading branch information
Kaihui-intel and XuehaoSun authored Oct 8, 2024
1 parent a0066d4 commit 4e9c764
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ transformers
torch
sentencepiece
neural-compressor
intel-extension-for-transformers >= 1.4.1
lm-eval==0.4.2
peft
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_user_model():
user_model = convert(model=user_model)
user_model.eval()

from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser
eval_args = LMEvalParser(
model="hf",
user_model=user_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pytest
wandb
einops
neural-compressor
intel-extension-for-transformers
lm_eval==0.4.2
lm_eval==0.4.3
peft
optimum-intel
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def eval_func(model):
config = AutoConfig.from_pretrained(args.model)
setattr(model, "config", config)

from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser
eval_args = LMEvalParser(
model="hf",
user_model=model,
Expand Down Expand Up @@ -232,7 +232,7 @@ def eval_func(model):

if args.accuracy:
user_model.eval()
from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser

eval_args = LMEvalParser(
model="hf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ pytest
wandb
einops
neural-compressor
intel-extension-for-transformers
lm_eval==0.4.2
lm_eval==0.4.3
peft
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def run_fn(model):

if args.accuracy:
user_model.eval()
from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser
eval_args = LMEvalParser(
model="hf",
user_model=user_model,
Expand All @@ -232,7 +232,7 @@ def run_fn(model):

if args.performance:
user_model.eval()
from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser
import time

samples = args.iters * args.batch_size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ transformers
torch
sentencepiece
neural-compressor
intel-extension-for-transformers >= 1.4.1
lm-eval==0.4.2
lm-eval==0.4.3
peft
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_example_inputs(tokenizer):

if args.accuracy:

from intel_extension_for_transformers.transformers.llm.evaluation.lm_eval import evaluate, LMEvalParser
from neural_compressor.evaluation.lm_eval import evaluate, LMEvalParser
eval_args = LMEvalParser(
model="hf",
user_model=user_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ The scripts [run_generation_sq.py](./run_generation_sq.py) and [run_generation_c

```bash
# Installation
git clone https://github.com/intel/intel-extension-for-transformers.git

# install ITREX
cd intel-extension-for-transformers
pip install -r requirements.txt
pip install -v .

# install requirements
cd examples/huggingface/pytorch/text-generation/quantization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
_commit_hash=args._commit_hash,
)
elif args.load_in_4bit or args.load_in_8bit:
# CPU device usage is provided by intel-extension-for-transformers.
user_model = AutoModelForCausalLM.from_pretrained(
args.model,
load_in_4bit=args.load_in_4bit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from transformers import AutoConfig, AutoTokenizer
from transformers.generation import GenerationConfig
import intel_extension_for_pytorch as ipex
# from intel_extension_for_transformers.transformers.llm.utils.generation import _beam_search, _greedy_search
from neural_compressor.transformers import AutoModelForCausalLM, AutoRoundConfig, RtnConfig, GPTQConfig
from neural_compressor.transformers.quantization.utils import convert_dtype_str2torch
from transformers.utils import check_min_version
Expand Down Expand Up @@ -189,7 +188,6 @@
torch_dtype=torch.float16,
)
elif args.load_in_4bit or args.load_in_8bit:
# CPU device usage is provided by intel-extension-for-transformers.
user_model = AutoModelForCausalLM.from_pretrained(args.model,
device_map=args.device,
load_in_4bit=args.load_in_4bit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pytest
wandb
einops
neural-compressor
intel-extension-for-transformers
lm_eval==0.4.3
peft
auto_round
Expand Down

0 comments on commit 4e9c764

Please sign in to comment.