Граф коммитов

31 Коммитов

Автор SHA1 Сообщение Дата
devang-ml 2050ee3256
Reorganize Features section of Olive docs (#1323) 2024-08-19 18:09:58 -07:00
trajep e8cf7bd30a
🧗 perf tuning cli (#1281)
## Describe your changes

Perf tuning cli.

E.g. for phi2-int4-cpu got from model builder, user can directly tuning
the session parameters in cpu and cuda ep with:
`olive tune-session-params --model model.onnx --device gpu
--providers_list CUDA CPU --hf_model_name microsoft/phi-2`
Also, user can provide their customized data_config:
`olive tune-session-params --model model.onnx --device gpu
--providers_list CUDA CPU --data_config_path data_config.json`
where the data config json looks like
```json
{
    "name": "gpu_cpu",
    "type": "TransformersTokenDummyDataContainer",
    "load_dataset_config": {
        "model_name": "microsoft/phi-2"
    }
}
```

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.
- [ ] Is this PR including examples changes? If yes, please remember to
update [example
documentation](https://github.com/microsoft/Olive/blob/main/docs/source/examples.md)
in a follow-up PR.

## (Optional) Issue link
2024-08-13 14:28:55 +08:00
Xiaoyu 68978f242b
remove sample codes from zipfile packaging (#1226)
## Describe your changes

remove sample codes from zipfile packaging
## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.
- [ ] Is this PR including examples changes? If yes, please remember to
update [example
documentation](https://github.com/microsoft/Olive/blob/main/docs/source/examples.md)
in a follow-up PR.

## (Optional) Issue link
2024-07-11 13:22:03 -07:00
Jambay Kinley d5337d5061
Olive Command Line Tools (#1129)
## Describe your changes
This PR adds command line tools for Olive that can be called using
`olive` or `python -m olive` command.
- Previous commands `python -m olive.workflows.run` and `python -m
olive.platform_sdk.qualcomm.configure` are deprecated and will emit a
FutureWarning.
- All cli commands are implemented in the `olive.cli` sub-module. These
must handle the command parsing and, in some cases, the implementation
of the command too.
- Removed `olive.workflows.snpe` sub-module since the code is outdated
and obsolete.
- Some doc fixes where we need to use "``" instead of "`" for code
formatting.
- Documentation is automatic using the [`sphinx-argparse`
extension](https://sphinx-argparse.readthedocs.io/en/stable/index.html):

![image](https://github.com/microsoft/Olive/assets/94929125/59cddbe0-527d-4805-8e56-66f538af864c)


## Checklist before requesting a review
- [x] Add unit tests for this change.
- [x] Make sure all tests can pass.
- [x] Update documents if necessary.
- [x] Lint and apply fixes to your code by running `lintrunner -a`
- [x] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.
    - `olive` command line tool has been added. 
- Use `olive run` or `python -m olive` instead of `python -m
olive.workflows.run` which has been deprecated.
- [ ] Is this PR including examples changes? If yes, please remember to
update [example
documentation](https://github.com/microsoft/Olive/blob/main/docs/source/examples.md)
in a follow-up PR.

## (Optional) Issue link
2024-05-01 11:19:27 -07:00
shaahji 5f65d62588
[Performance]: Delayed Python pass module load (#1028)
## Describe your changes

### [Performance]: Delayed Python module load
Introducing olive_config.json to encapsulates all the different global
environment properties (like pass module configuration) to setup olive.
Also, merged extra_dependencies.json into olive_config.json.

User can provide a alternative configuration file with the command line
argument '--package-config'.

Instead of loading all modules (specifically passes) at launch, delay
the load until after the run config is parsed and load only
the ones that are explicitly required.

Moved a few hard-coded dependency management into the olive config.

### Release Note:
Added support for extending available Olive passes and configuring each
via data file (olive_config.json). The configuration file is provided to
Olive run with command line param `--package-config`.

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [x] Update documents if necessary.
- [x] Lint and apply fixes to your code by running `lintrunner -a`
- [x] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.
- [ ] Is this PR including examples changes? If yes, please remember to
update [example
documentation](https://github.com/microsoft/Olive/blob/main/docs/source/examples.md)
in a follow-up PR.

## (Optional) Issue link
2024-04-04 22:23:27 -07:00
Jambay Kinley f7501a1e4b
`set_tempdir` utils, abstract multi_ep tests (#960)
## Describe your changes
- Introduce a new `set_tempdir` util that sets the `tempfile.tempdir` if
provided. This helps us remove duplicated code from the repository.
- Add missing package data for python environment system.
- Abstract the engine, workflow creation and run in the multi-ep test.
This logic is same for all systems so there is a lot of duplicate code.
- Clean up aml system unit test



## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2024-02-26 12:22:09 -08:00
Mike Guo 9e7eba8c8d
ignore ruff PTH123 rule (#958)
## Describe your changes

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2024-02-26 17:28:31 +08:00
trajep 3148be4fd7
🌗 Enable windows QNN e2e test (#893)
## Describe your changes
1. Enable windows QNN e2e test
2. Added use conda path into windows ci test if it is for qnn. This is a
workaround for this kind of issue only ci pipeline:
https://community.anaconda.cloud/t/cant-install-failed-to-extract-packages-error/62687
3. Update pwsh Join-path to back-compat the version of pwsh <= 5.x, 

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2024-01-26 09:18:41 +08:00
trajep 8e2890c740
:neckbeard: QNN toolkit (#874)
## Describe your changes

QNN toolkit

CI e2e test for qnn mobile net:
https://github.com/microsoft/Olive/pull/874/checks?check_run_id=20488489220

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2024-01-18 10:38:12 +08:00
trajep 8820c3fca0
♻️ Re-structure the SNPE code (#865)
## Describe your changes

This PR is used to restructure the SNPE code to extract the common
component which can be reusable in following QNN support.

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link

---------

Co-authored-by: Mike Guo <myguo@microsoft.com>
2024-01-11 13:58:22 +08:00
trajep 06e5c11c5c
🐌 SNPE env and example fix (#860)
## Describe your changes

There are a few issues for current SNPE examples:
1. The libxx.so under customized `python3.6` need to be put visible for
system for SNPE cmd running
- put `str(Path(f"{snpe_root}/python36-env/lib"))` under
`LD_LIBRARY_PATH` can fix.
2. SNPE evaluation extent the logits wrongly, 
    - fixed in this PR.
3. We did not support tensorflow model evaluation.
    - update examples without input model evaluation.
4. Wrong metrics config for inception examples
5. Importing issue for vgg, tell that in README.md to let user update it
manually as a workaround.
6. Python3.6 seems a bit outdated for latest SNPE updates. The vgg
example failed to be run. Updated the python env to 3.8 can fix.


## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2024-01-09 14:28:42 +08:00
trajep 69c2aa7580
🫒 Auto optimization (#793)
## Describe your changes
Reopen the auto optimization PR with pass flows templates. 

![image](https://github.com/microsoft/Olive/assets/13343117/b58729e6-3832-4ef1-b5d0-f92721670ede)

Previous PR: https://github.com/microsoft/Olive/pull/610

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link

---------

Co-authored-by: Mike Guo <guotuofeng@gmail.com>
2023-12-21 13:14:45 +08:00
Mike Guo 3636ae4023
Fix setup issues (#812)
## Describe your changes
1. Exclude the test in the final wheel
2. Add the missed dockerfile for docker system
3. Add both docs/examples in the source distribution

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-12-13 17:29:35 +08:00
Mike Guo 4df44a5f45
add editorconfig rules & enable pylint (#659)
## Describe your changes

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [x] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-10-20 13:43:00 +08:00
trajep a46fdf210d
😋 Add missed license header (#618)
## Describe your changes
Add missed license header

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-09-28 22:57:35 -07:00
Mike Guo 4759bacf00
more lint rules (#605)
## Describe your changes
more lint rules
## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-09-25 21:32:56 +08:00
Mike Guo 936a101723
add lint (#603)
## Describe your changes
add lint
## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-09-25 11:26:09 +08:00
Jambay Kinley 1a7b3d5bfd
Drop python 3.7, Fix `onnxruntime` dependency setup, Whisper: Add EP and FAQ (#563)
## Describe your changes
Officially drop python 3.7 since it has already reached end of life.
Most olive dependencies have already dropped python 3.7 support so olive
was probably incompatible with it.

`onnxruntime` packages are distributed using different names but they
are all installed under the same `onnxruntime` namespace.
So, we cannot check if the required package is installed using the `try:
__import__` method. This PR uses `importlib.metadata` to check the local
ort installations and log the required steps needed. We don't want to
uninstall packages ourselves so we will just log the command for the
user to run.

Addresses the original issue in
https://github.com/microsoft/Olive/issues/557

Also update Whisper example to provide and use accelerator+ep correctly.
Added FAQ for common issues like
https://github.com/microsoft/Olive/issues/508

Update: Also fixes https://github.com/microsoft/Olive/issues/571

## Checklist before requesting a review
- [ ] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [ ] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-09-14 21:22:42 -07:00
Xiaoyu 35b0c225ca
Add Aml sku support for AMLSystem (#418)
## Describe your changes

Add Aml sku support for AMLSystem

## Checklist before requesting a review
- [x] Add unit tests for this change.
- [x] Make sure all tests can pass.
- [x] Update documents if necessary.
- [x] Format your code by running `pre-commit run --all-files`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
2023-07-26 23:21:04 -07:00
Mike Guo dbd121ea7a
explicitly close the opened files (#264)
## Describe your changes
explicitly close the opened files to prevent file handle leaks
## Checklist before requesting a review
- [x] Add unit tests for this change.
- [ ] Make sure all tests can pass.
- [x] Update documents if necessary.
- [x] Format your code by running `pre-commit run --all-files`

## (Optional) Issue link
2023-05-15 20:18:19 +08:00
leqiao-1 045508b56e
add workflow setup (#167)
add workflow setup
modify olive[openvino] to olive-ai[openvino]
2023-04-18 15:44:28 +08:00
Justin Stoecker b311be67e1
Basic DirectML latency example (#148)
This change adds an example of optimizing the SqueezeNet model (a simple
"hello world" style network) for latency with DirectML. It's nice to
have a basic sample that runs quickly and doesn't involve huge models
with external weights.

Other changes:
- Introduces an ONNX pass for basic float-to-float16 conversion outside
of standard model conversion or transformer-specific optimizer pass.
Sometimes it matters where/when this conversion occurs, but for simple
GPU inference on non-transformer models it's nice to have as a
standalone pass.
- Updates OrtPerfTuning pass to filter EPs based on the configured
device. As-is, the pass will create tuning combos for _all_ EPs in the
user's onnxruntime package.
- Adds DML references in docs.
2023-04-03 14:14:26 -07:00
Justin Stoecker 1b904c3f10
Minor fix for pass return type hints (#140) 2023-03-30 12:49:05 -07:00
Jambay Kinley deee8cfa54
Update package description (#128)
Update package descriptions
2023-03-23 18:53:16 -07:00
Jambay Kinley ff14ee7ab8
Welcome to new version of Olive (#127)
* clean repo

* olive code first commit

* add security.md
2023-03-23 17:27:01 -07:00
leqiao 2376de276c update links 2022-11-03 18:53:56 +08:00
leqiao 9ada4666ed update to ort 1.11 2022-04-20 14:14:20 +08:00
leqiao b64a5088cf update ort to 1.10 and olive to 0.3.0 2022-03-31 15:35:12 +08:00
leqiao 2c0fa40fd6 add black size 2022-03-29 14:55:26 +08:00
leqiao 2537cbece5 add throughput support 2021-11-12 16:39:08 +08:00
leqiao 2540653df8 OLive refactor 2021-10-28 19:08:33 +08:00