Skip to content
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

Remove itrex dependency for 3x example #2016

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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