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

Refactor and Add Tests #2

Open
wants to merge 76 commits into
base: openvino_tokenizers
Choose a base branch
from

Conversation

apaniukov
Copy link

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

jiqing-feng and others added 4 commits January 8, 2024 10:49
* add llamd and bloom in ipex inference tests

* only add llama tests
* add position_ids in forward

* check if jit model need position_ids

* use MODEL_TYPES_REQUIRING_POSITION_IDS

* fix has_position_ids

* fix position_ids length

* rm useless params

* check model inputs by input names

* fix format

* check input names in graph model

* fix style

* consider eager model in input_names

* add input names

* add text input names

* fix styl;e

* Update optimum/intel/generation/modeling.py

* fix format

* Update optimum/intel/generation/modeling.py

---------

Co-authored-by: Ella Charlaix <ella@huggingface.co>
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
@apaniukov apaniukov marked this pull request as ready for review January 10, 2024 10:00
* f32 precision for compare-with-transformers tests

Allow these tests to pass locally on devices where inference is run by default in FP16 (GPU) or BF16 (latest Xeon).

* Add F32_CONFIG constant for modeling tests

* Replace get_version with is_openvino_version
@ilya-lavrenov
Copy link

maybe it's better to re-create PR to optimum-intel from apaniukov:openvino_tokenizers ?

@apaniukov
Copy link
Author

wgzintel and others added 8 commits January 12, 2024 17:04
* Add try for get_property

* refine code

---------

Co-authored-by: fishbell <wangwang.wang@intel.com>
…i-fix

Fix error with optimum-cli export openvino --help
* Bump min torch version

* comment

* add torch min version
* Allow loading of stateful models (no patching yet)

* Stateful models support

* Fix forward for chatglm

* Passing stateful as a dedicated parameter

* Fixed possibly misaligned types in ShapeOf Concat sub-expression

* Fixed critical typo in infer_request invocation

* Apply bettertransfomer when model is converted in stateful mode

* Correct default value handling for stateful flag

* Apply bettertransformer under try-except to avoid crashes when model is not supported

* Added --stateful option in optimum-cli

* Raise if too old version of opevino is used ans stateful=True

* Fix openvino version check to be compatible with openvino-nightly

* Fix for bloom family

* Allow loading of stateful models (no patching yet)

* Stateful models support

* Fix forward for chatglm

* Passing stateful as a dedicated parameter

* Fixed possibly misaligned types in ShapeOf Concat sub-expression

* Fixed critical typo in infer_request invocation

* Apply bettertransfomer when model is converted in stateful mode

* Correct default value handling for stateful flag

* Apply bettertransformer under try-except to avoid crashes when model is not supported

* Added --stateful option in optimum-cli

* Raise if too old version of opevino is used ans stateful=True

* Fix openvino version check to be compatible with openvino-nightly

* Fix for bloom family

* Fix general code style and appliy renaming suggestions

* fix version checking if openvino not in site-packages

* use reset_stateif available

* remove input patch in bettertransformer apply

* add tests

* add type hints and update doc strings

* added more tests

* Fixed outdated signature of InferRequest wrapper to fix one of the quantizer tests.

* Switch to stateful model by default

* Allow loading of stateful models (no patching yet)

* Stateful models support

* Fix forward for chatglm

* Passing stateful as a dedicated parameter

* Fixed possibly misaligned types in ShapeOf Concat sub-expression

* Apply bettertransfomer when model is converted in stateful mode

* Correct default value handling for stateful flag

* Apply bettertransformer under try-except to avoid crashes when model is not supported

* Added --stateful option in optimum-cli

* Raise if too old version of opevino is used ans stateful=True

* Fix openvino version check to be compatible with openvino-nightly

* Fix for bloom family

* Fix general code style and appliy renaming suggestions

* fix version checking if openvino not in site-packages

* use reset_stateif available

* remove input patch in bettertransformer apply

* add tests

* add type hints and update doc strings

* added more tests

* Fixed outdated signature of InferRequest wrapper to fix one of the quantizer tests.

* Stateful models support

* Fix forward for chatglm

* Passing stateful as a dedicated parameter

* Apply bettertransfomer when model is converted in stateful mode

* Raise if too old version of opevino is used ans stateful=True

* Fix openvino version check to be compatible with openvino-nightly

* Fix for bloom family

* fix test and add beam_idx attribute

* apply review comments

* stateful by default fixes

* less agressive stateful

* ensure that task support stateful

* remove debug print

* Apply suggestions from code review

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>

* Apply suggestions from code review

Co-authored-by: Helena Kloosterman <helena.kloosterman@intel.com>

* update requirements and warning messages

* Apply suggestions from code review

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

* fix cli export

* Update optimum/exporters/openvino/__main__.py

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>

---------

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>
Co-authored-by: Helena Kloosterman <helena.kloosterman@intel.com>
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
…uggingface#518)

* Use f32 precision for compare-to-diffusers tests

* Add f32 ov_config to training/stable diffusion tests
@apaniukov apaniukov force-pushed the openvino_tokenizers branch from f2a2877 to 57782d1 Compare January 18, 2024 10:43
echarlaix and others added 30 commits January 26, 2024 19:19
* add IPEX model and README

update ipex modeling and add case for text-generation and text-classification

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

* fix style

* IPEX modeling refactorization

* typo

* remove use cache arg when loading model

* fix style

* move tests

* remove readme

* add test

* add warning if use_cache mismatch

* fix

* format

* update setup

* add use_cache attribute


---------

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
Co-authored-by: Feng, Jiqing <jiqing.feng@intel.com>
* add IPEX model for QA task

* add fix
…huggingface#533)

* Expose InferRequestWrapper class so it can be imported from elsewhere

* Fix
…#536)

* add test

* format

* Add image classification task

* Add test
huggingface#537)

* relax requirements to have registered normalized config for usage converted decoder models

* add property for access to normalized config
* fix torch version for ipex tests

* disbale tests for incompatible torch version with ipex

* fix
…ce#544)

* Refactor IPEX CausalLM for better model arch scale

* Fix style
* Handle autocast in IPEXModel.forward

* Handle missing torch_dtype in config
* Handle autocast in IPEXModel.forward

* Handle missing torch_dtype in config

* Warmup IPEX models at init

* Minor fix

* Fix _init_warmup use_cache condition

* Fix output handling in IPEX question answering
* Initial code for load_in_4_bit

* Dataset does not work

* Intermediate changes

* Make it working with dataset

* Style

* Fixed small issue

* Fixed failed tests

* Style

* Comment failed tests due to NNCF 2.8

* Commented failed tests until new NNCF release

* Added tests for load_in_4bit

* Added awq option. Included NNCF package into openvino extra.

* Rolled back including nncf into openvino extra

* Style

* Fixed tests

* Fixed issues with models larger than 1B. Added tests.

* Style

* Fixed issues. Applied comments.

* Removed unnecessary exception

* Applied more comments

* Fixed issue

* Make quantization_config a part of OVConfig in OVQuantizer

* Fixed issue with Transformers

* Fixed test

* Changed the naming. Added additional tests

* Fixed tests

* Fixed tests

* Applied more comments

* Style
…#535)

* skip compression weights tests for nncf==2.8.0 and reworked logic of optimization stateful PyTorch models

* black happy

* ruff happy

* updated nncf version

* replied to comments

* replied comments

* typo

* cherry pick fixes for tests from PR 538

* replied to comments

---------

Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.