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

260 Коммитов

Автор SHA1 Сообщение Дата
Wenbing Li 1445b6fdb7
Fix the current valid binSkim error and warnings. (#363)
* add qspectre check

* more fixing

* partially enable /sdl scan

* Update CMakeLists.txt

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

---------

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-02-22 09:33:04 -08:00
Scott McKay 91d75f460b
Update tutorial and example usage to provide info on installing the nightly (#364) 2023-02-17 19:27:00 -08:00
Scott McKay f3654e5bac
Fix opset 18 issues and bug due to ORT Resize issue (#362)
* - Fix Split(18) requiring num_outputs.
- Calculate `sizes` in Resize instead of using the simpler `scales`
  - ORT implementation does not round correctly when applying scales
- Update center crop to use float so we are more accurate in choosing the crop area.
- Fix minor issue with Debug step by only adding values that are altered to the renaming graph inputs.
- Update unit tests expected output due to the change in Resize using sizes instead of scales.
- Crop e2e example input so before/after image covers same area.

* Simplify.
CenteredCrop doesn't need to use float as it's dividing by 2 (so using float + floor gives the same result).
Remove Resize impl using scales - we most likely will never go back to it.
Address PR comments
Update doc
2023-02-18 06:37:05 +10:00
Wenbing Li 00b54739c5
security warning of sentencepiece (#358)
* security warning of sentencepiece

* update cmake option policy

* option set

* revert abseil change

* wrong patch name

* upgrade protobuf to 3.20.2, align with ORT 1.14

* weird patch issue

* code refinement

* typo

* Update version.txt

* undo version change

* doc refinement

* one more missing

* is ==

* disaable some case running under ort 1.13

* Update cmake/externals/sentencepieceproject.cmake

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* Update cmake/externals/sentencepieceproject.cmake

Co-authored-by: Scott McKay <skottmckay@gmail.com>

* Update cmake/externals/sentencepieceproject.cmake

Co-authored-by: Scott McKay <skottmckay@gmail.com>

* Update cmake/externals/sentencepieceproject.cmake

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* review update

* set default warning level 3 to meet some requirement

---------

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-02-16 20:50:11 -08:00
matheusgomes28 3a99be8239
If ONNXRUNTIME_PKG_DIR define, use that directory to find ort. (#361)
Co-authored-by: Matheus Gomes <a-matheusd@microsoft.com>
2023-02-15 22:22:06 -08:00
Edward Chen 36a9c991a2
Fix mobile packaging pipeline builds. (#352)
* Handle flag dependencies in gen_selectedops.py.
* Fix typos in noexcep_ops.cmake.

---------

Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-02-07 16:44:12 +10:00
Wenbing Li 1af7a56b28
update Python pipelines for release (#353)
* re-enable Python pipelines

* deprecate the direct setup.py call

* pipeline fixing

* run cmake from visual studio

* remove the self check

* support different ort versions

* remove ort 1.9 and add 1.13

* ci pipeline fixing

* fix the test with latest pytorch

* code refinement

* torch version detection

* make package python version more consistent.
2023-02-06 18:23:56 -08:00
Scott McKay 95ac242e7c
Fix sentencepiece build error (#355)
* Combined ORT + ort-ext build for Android fails due to protobuf mismatch. Move the setting of SPM_USE_BUILTIN_PROTOBUF to before the populate to fix.

* Set CACHE INTERNAL as well to avoid issue with CMP0077.
2023-02-01 13:42:26 -08:00
Scott McKay cd5ea11aaa
Move the pre/post processing scripts into the python module. (#349)
* Move the pre/post processing scripts into the python module.
Update usage/examples.

* Use better version parsing.

* Update tests, docs,

* Address PR comments.
Remove global Settings and pass onnx opset around directly where needed. Make PrePostProcessor the owner of the checker context.
2023-01-26 08:30:21 +10:00
Scott McKay c0555471df
Fix PreFast warning (#350)
* Fix PreFast warning
* Add gsl for checking narrowing conversions. Copy setup for usage in a build with exceptions disabled from ORT
2023-01-24 12:11:00 +10:00
Wenbing Li 13d9e27ccd
switch to amd64 Python package in CI pipeline (#348)
* switch to amd64 Python package in CI pipeline

* try to fix binskim errors

* try new cibuildwheel parameter

* fix some binskim issues

* fix some binskim issues

* try switch to x64 again

* undo setup.py change

* because of the quotes?

* explicit AMD64?

* output the debug info

* try fixing a setuptool issue

* cleanup

* refinement
2023-01-23 13:52:18 -08:00
Sayan Shaw 57032cafef
Added ThirdPartyNotices.txt (#341)
* Added ThirdPartyNotices.txt

* Updated ThirdPartyNotices.txt manually with extensions dependencies

* Fixed blingfire notice

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-01-20 09:39:14 -08:00
Edward Chen ec83a138a6
Add BertTokenizer to iOS package ops config. (#347)
* Add BertTokenizer to iOS package ops config.

* Also register tokenizer ops in com.microsoft.extensions.

Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2023-01-18 19:21:03 -08:00
Sayan Shaw 5568cb74ed
Added initial CustomOp template generator (#343)
* Added initial CustomOp template generator

* Added arg parsing, error check, and modularized methods

* Added test and models for the same plus refactored code in template generator

* Fixed model path issue

* Final changes

* Removed ONNX models and added model generation in test scripts, changed custom ops to random math ops

authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-01-17 21:29:38 -08:00
Edward Chen d679b920be
Copy run_android_emulator.py from ORT (#346)
Add copy of run_android_emulator.py to ORT Extensions and use it directly.
2023-01-17 14:13:02 -08:00
Edward Chen 63fe165ee8
Android package build updates (#344)
- Generate AAR with associated artifacts (javadoc.jar, sources.jar, pom).
- Fix JAR/AAR package descriptions.
- Remove `gradle -b build-android.gradle` invocation from CMake. This creates the AAR and it is not necessary to run it for each Android ABI build.
- Support building on Windows.
2023-01-13 14:06:00 -08:00
Wenbing Li 67c77d9fbc
align python package version with version.txt (#345)
* align python package version with version.txt

* Update setup.py

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* remove a line

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-01-12 14:28:32 -08:00
Scott McKay 440a3ca98b
Add ability to specify onnx opset when adding pre/post processing to model. (#342) 2023-01-11 11:03:26 +10:00
Edward Chen a09d08ca5f
Remove `.az` directory. (#339) 2023-01-09 10:07:31 -08:00
Edward Chen 9e013a9a69
Update version to 0.6.0. (#340) 2023-01-06 09:36:05 -08:00
Edward Chen d8581da434
Copy build definitions from `.az` to `.pipelines` (#338)
* Copy build definitions from .az to .pipelines.
* Fix relative paths and typo in ci.yml.
2023-01-05 08:35:29 -08:00
Scott McKay e3663fb110
Add build.py to make it easier for developers to build different variants (#318)
* Add python based build infrastructure to simplify developer builds for various platforms. Majority was copied from the ORT build script so usage is consistent with that.

Left the existing build.bat/build.sh but ideally the CI can be updated to use the new infrastructure so things are more consistent.

Updated gradle to 7.5.1 and Android gradle tools to 7.3.0.

Validated Windows and cross-compiling Android on Windows including builds with explicitly selected ops.
WASM and iOS builds aren't tested yet and might need minor tweaks.

* Update build.py to require Python 3.7, remove git submodule sync, reorder options.
* Use 'cmake -E remove' to remove file.
* Enable specifying the ORT version to fetch
* Add ability to enable Java bindings.


Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
Co-authored-by: edgchen1 <18449977+edgchen1@users.noreply.github.com>
2023-01-02 14:55:31 +10:00
Rachel Guo e0d48e255f
Add initial android packaging pipeline (#332)
* initial android packaging

* Update android_packaging.yml for Azure Pipelines

* update

* fix name

* fix

* remove popd

* move to .pipelines

* move app center running command

* update version suffix and package name

* minor update

* minor update

* update pom files

* add package op config and update

* update build variable format

* update

* enable selected op list

* update

* update selected ops

* use python 3.9 version

* modify enable option argument

* update isreleasebuild

* update isreleasebuild

* minor update about versions

* rm version.txt accidentally checkedin

* address pr comments

* update

* update

* debug trial run

* update build android gradle file version

* update get version number helper

* minor fix

* minor fix
2022-12-28 15:56:19 -08:00
Edward Chen 9baed694a3
Add iOS packaging pipeline. (#327) 2022-12-23 05:27:41 -08:00
Edward Chen 81e7799c69
Patch sentencepiece to enable iOS build. (#335) 2022-12-21 09:57:32 -05:00
Scott McKay 5d53f91f11
Minor opencv tweaks (#316)
* Separate ops in operators/cv2 that do and do not require codecs so they're easier to include/exclude from a build.
Remove jpeg2000 from opencv file formats. It costs 1MB and is (afaict) not a common format.
Add ability to enable/disable cv2 ops to gen_selectedops.py.

* Remove super resolution pre/post process ops that are no longer needed.

* Replace super resolution e2e tutorial

Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2022-12-20 13:47:17 +10:00
Edward Chen 280ec289cb
Use `object` instead of `np.object` and `str` instead of `np.str`. (#337) 2022-12-19 18:45:07 -05:00
Wenbing Li 1d8d4b1fa4
fix the ORT API version in header files. (#334)
Co-authored-by: Changming Sun <chasun@microsoft.com>
2022-12-19 10:19:59 -08:00
Scott McKay 230f0201d1
Updates to PPP model update scripts (#331)
* - Fix incorrect weights matrix for conversion from YCbCr to BGR
- Fix Resize when input is HWC or CHW by converting to NHWC/NCHW so bilinear interpolation is inferred. trilinear is inferred otherwise.
  - Not aware of a use case where we'd want to use trilinear - if one exists the temporary addition of the batch dim would need to be made explicit.
- Allow Resize to use antialias if ONNX opset is 18 or higher
- Skip adding unnecessary Mul if FloatToImageBytes multiplier is 1.0.
- Make Debug step available at the top level

Validated opset 18 Resize vs PT for super resolution and the results are now a really good match.

* Update test data to use image that shows diffs better.
Make super resolution output format configurable
Address PR comments.

* Adjust test for diffs on macos
2022-12-17 09:32:04 +10:00
Wenbing Li 13a438234e
Fix the include path issue on the ORT combined build. (#325)
* test ci pipeline

* trigger ci

* correct ORT include path

* remove unwanted script

* fixing supres code with codecs off
2022-12-16 10:48:45 -08:00
Edward Chen 0169129b19
Add version.txt and derive CMake version variables from it. (#333) 2022-12-16 10:14:28 -08:00
Rachel Guo 7b7e2a75e7
Add app center test to android ci (#329)
* wip

* integrate app center test command to CI

* add app center cli install

* update ci test

* update based on new app

* minor update yaml file

* add new line at the end of file

* update app center token and comments
2022-12-15 18:52:42 -08:00
Sayan Shaw 4ff821805a
Initial CLIP tokenizer implementation (#323)
* Initial CLIP tokenizer implementation

* Moved common code from CLIP and GPT2 tokenizers into separate file

* add the new file into cmake file list.

* Fix ustring reference issue

* merge changes from main branch

* more merge actions

* Minor changes

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
Co-authored-by: Wenbing Li <wenbingl@outlook.com>
2022-12-13 15:52:47 -08:00
Edward Chen e8611d036d
Include requirements.txt from requirements-dev.txt. (#328)
Include requirements.txt from requirements-dev.txt so that pip has context to avoid installing incompatible dependencies.
2022-12-13 10:21:32 -08:00
Wenbing Li c599b00d07
Using the header files from the ONNXRuntime package (#322)
* Using the header files from the ONNXRuntime package

* Update includes/onnxruntime_customop.hpp

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* fix the build break.

* one more fixing

* wired top project

* ort 1.9.0 used

* switch to 1.10.0 package.

* change the vmimage to latest

* URL issue

* cmake policy

* ignore onnxruntime.dll native scan

* update the Onebranch exclusedPaths

* fixing some build tool issues

* update again

* typo

* undo of ORT dll removal

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2022-12-09 14:30:24 -08:00
Wenbing Li 69e6ec7cf1
doc of how to add an operator 2022-12-09 10:52:40 -08:00
Edward Chen 9ab7e614da
Add infrastructure to build iOS static framework and xcframework (#320)
Initial changes for adding an iOS package.

Add infrastructure to build iOS static framework, xcframework, and CocoaPods package.
Add test project that uses package.
Add package build and test to CI pipeline.
2022-12-07 10:37:05 -08:00
Wenbing Li 8df25bf5a5
Fix ci pipelines failure caused by the latest transformer package (#324)
* test ci pipeline

* transformer 4.25 broken on pytorch 1.9/1.10
2022-12-06 15:21:06 -08:00
Wenbing Li 0647ce6d14
update the main doc and add a developer doc (#321)
* update the main doc and add a developer doc

* add it back

* fix some typo

* Update README.md

Co-authored-by: Nat Kershaw (MSFT) <nakersha@microsoft.com>

Co-authored-by: Nat Kershaw (MSFT) <nakersha@microsoft.com>
2022-12-02 16:27:58 -08:00
Wenbing Li 77bddf6419
using the cmake bundled in visual studio (#319)
* using the cmake bundled in visual studio

* script is batch file

* switch to vsdevcmd

* remove the quotation mark not needed

* one more change
2022-11-29 09:54:49 -08:00
Scott McKay 1cab9711ff
Starter changes for supporting pre/post processing for vision models. (#312)
* Initial changes for supporting mobilenet and superresolution.
- Script to update model with pre/post processing
- custom ops for decode/encode
  - user just has to provide jpg or png bytes
  - superresolution can return the updated image in jpg or png
- models for testing

Updated cmake setup to enable building of the vision pre/post processing ops
  - opencv2 is treated as an internal dependency rather than the mechansim for selecting which operators to include.

* Add extra check in decode.
2022-11-24 07:40:56 +10:00
Guenther Schmuelling 52ae76d3df
fix wasm ort builds (#313)
Co-authored-by: Scott McKay <Scott.McKay@microsoft.com>
2022-11-22 17:03:46 +10:00
Wenbing Li fec9af97aa
a naive decoder for sentencepiece tokenization (#314)
* a naive decoder for sentencepiece tokenization

* typo fixing

* add a unit test for the decoder
2022-11-21 11:10:30 -08:00
Wenbing Li 187411d5c9
Add an android test app for extensions AAR package in CI pipeline (#308)
* an android test app for extensions AAR package

* add the pipeline

* fxing the Android CI pipeline

* fix the build issus on macOS

* more fixings

* more fixings

* switch to jdk 11

* gradlew path issue

* update the command lines

* split the test task

* better name
2022-11-08 10:19:12 -08:00
Sayan Shaw 4683276158
Fixed attribute not found issues for hf_bert_tokenizer (#311)
* Fixed do_lower_case attribute not found issue

* Added check for strip_accents

* Fixed typo

* Changed strip_accents handling

Co-authored-by: sayanshaw <sayanshaw@microsoft.com>
2022-11-01 13:42:10 -07:00
Changming Sun c7578c525e
Update tsaoptions.json (#309) 2022-10-25 15:23:33 -07:00
Wenbing Li 3b8423ab67
Generate Python 4-version packages for windows in OneBranch (#307) 2022-10-19 13:56:10 -07:00
Sayan Shaw 23201d84ba
Updated json and re2 version as per ort req (#305)
Co-authored-by: sayanshaw <sayanshaw@microsoft.com>
2022-10-14 17:33:53 -07:00
Wenbing Li 379cf02d5c
Build multiple Android ABIs into one AAR package. (#302)
* support multiple ABIs in one AAR package.

* refine ndk version implementation

* fix ndk version issue

* comments

* typo
2022-10-11 14:53:22 -07:00
Changming Sun 4189db8129
Update tsaoptions.json to explicitly set template name (#301) 2022-10-05 17:50:19 -07:00