Commit graph

119 commits

Author SHA1 Message Date
Sumit Agarwal
5b16593192
[DML EP] Attention Kernel bug fix (#13879)
### Description
- Use same data type as input for mask_index tensor which is used as DML
GEMM API's C parameter.
- Remove gsl header include as it is already gets included transitively.



### Motivation and Context
- Why is this change required? What problem does it solve?
Bug found in internal conformance testing.
- If it fixes an open issue, please link to the issue here.
N/A
2022-12-07 15:24:27 -08:00
Yi Zhang
ae2a9373ab
reenable quant model tests (#13871)
### Description

### Motivation and Context
Test data in the image has been fixed.
2022-12-07 23:33:22 +08:00
Yi Zhang
a9a9c34d98
Fix WinML Test Case: create LearningModelBinding for every testcase (#13587)
### Description
Fix #13509

### Motivation and Context
The exception was caused by the incorrect fetches, which was from the
binding with last test cases.

efcbdac58e/onnxruntime/core/session/onnxruntime_c_api.cc (L809-L815)
2022-11-09 11:20:48 +08:00
Yi Zhang
e160688a9b
Skip some failed models winml and training workflows on Windows CPU (#13407)
### Description
1. update model name structure in model_tests.cpp with source name. To
avoid
`Condition test_param_names.count(param_name) == 0 failed. Duplicate
parameterized test name 'BERT_Squad_opset10_CPU'`
2. skip some failed models https://github.com/onnx/models/issues/568


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2022-10-25 10:05:04 +08:00
Edward Chen
454f77cd94
Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791)
# Motivation
Currently, ORT minimal builds use kernel def hashes to map from nodes to
kernels to execute when loading the model. As the kernel def hashes must
be known ahead of time, this works for statically registered kernels.
This works well for the CPU EP.
For this approach to work, the kernel def hashes must also be known at
ORT format model conversion time, which means the EP with statically
registered kernels must also be enabled then. This is not an issue for
the always-available CPU EP. However, we do not want to require that any
EP which statically registers kernels is always available too.
Consequently, we explore another approach to match nodes to kernels that
does not rely on kernel def hashes. An added benefit of this is the
possibility of moving away from kernel def hashes completely, which
would eliminate the maintenance burden of keeping the hashes stable.

# Approach
In a full build, ORT uses some information from the ONNX op schema to
match a node to a kernel. We want to avoid including the ONNX op schema
in a minimal build to reduce binary size. Essentially, we take the
necessary information from the ONNX op schema and make it available in a
minimal build.
We decouple the ONNX op schema from the kernel matching logic. The
kernel matching logic instead relies on per-op information which can
either be obtained from the ONNX op schema or another source.
This per-op information must be available in a minimal build when there
are no ONNX op schemas. We put it in the ORT format model.
Existing uses of kernel def hashes to look up kernels are replaced
with the updated kernel matching logic. We no longer store
kernel def hashes in the ORT format model’s session state and runtime
optimization representations. We no longer keep the logic to
generate and ensure stability of kernel def hashes.
2022-09-20 14:24:59 -07:00
Sumit Agarwal
f78ed1388a Fixed build break: inbox version of WindowsAI repo 2022-09-09 18:25:01 -07:00
Sumit Agarwal
bcdddb47ba Merge remote-tracking branch 'origin/main' into WindowsAI 2022-09-09 17:34:48 -07:00
sumitsays
05c65a54b3
[DML EP] Contrib Op: FusedMatMul (#12898)
* Contrib Op: FusedMatMul for DML EP

* Added relevant comments and extra validation

* Polish

* More polish

* Last polish

* Addressed comment on the PR

* Addressed comment on the R

* Removed un-necessary comments

* Used c++ standard function

* used std::c++ algorithms function

* Removed unsed code

Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
Co-authored-by: Dwayne Robinson <fdwr@hotmail.com>
2022-09-09 09:37:38 -07:00
Sheil Kumar
535b0835f2
User/sheilk/dft fixes (#12862)
* DirectML DFT Tests and Fixes

* Dynamicaly allocate temporaries using the allocator...

* Allocate during compute

* wrong dims

* CR feedback
2022-09-07 13:21:56 -07:00
Yulong Wang
1a402a3f25
replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00
Chun-Wei Chen
6246662b1d
[Dup] Fix SAME_UPPER/SAME_LOWER (auto_pad attribute) in ConvTranspose (#12537)
* Fix SAME_UPPER/SAME_LOWER (auto_pad attribute) in ConvTranspose

* Bump ONNX 1.10.2 globally

* load ONNX_VERSION from VERSION_NUMBER

* /

* revert deprecate warning in ORT 1.12

* add a comment about why removing cntk_simple_seg

* correct the implem in DML as well
2022-08-22 15:35:34 -07:00
Sheil Kumar
7d712c8f8b
Fix WinML Tests are still targetting deprecated (deleted) experimental signal op definitions (#12006)
* fix winml tests

* remove legacy test

* switch idft -> dft+inverse attr

* upgrade opset 13->17 for signal ops tests
2022-06-27 16:35:50 -07:00
Gary Miguel
e8b0d24071
Support per-test tolerances for ONNX tests (#11775)
Prior to this every test shared the same tolerances. This meant
that if an ONNX test failed due to a small but acceptable difference in
output, the only alternative was to disable the test entirely.

In op set 17, the DFT operator is being added. Without this change, the
tests for that operator fail because the output is off by about 5e-5.
It's better to keep test coverage for this new op rather than disable
the test entirely.

Also prior to this change, the global tolerances were not shared between
C++, JavaScript, and Python tests. Now they are.

Also fix various minor issues raised by linters.

Unblocks https://github.com/microsoft/onnxruntime/issues/11640.
2022-06-14 15:12:23 -07:00
Sheil Kumar
22739137c4
Update signal op defs to match onnx17 defs, and add more tests (#11631) 2022-05-28 16:00:09 -07:00
Sheil Kumar
6255194659
All LearningModelSessions created from a common LearningModelDevice should share the same thread pool (#11457)
* Share thread pools between devices

* make tests reuse device

* Change cpu thread pool options for dml sessions to use 1 thread with no spinning

* fix test failure

* Update missing type constraints for dft

* Add comment and rename inference session parameter

* default missing causing inconsistent test behavior

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-05-13 11:12:43 -07:00
Sheil Kumar
85fa168dc1
Add optional dft_length input to the DFT and IDFT operators. (#11427)
* Add optional dft_length input.

* CR Feedback

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-05-03 16:17:43 -07:00
Sheil Kumar
027565b3b2
Add multi-dim dft test, and fix complex idft (#10947)
* fix complex multi-dim dft

* Add multi-dim dft test, and fix complex idft

* remove incorrect inplace specification

* Add DFT tests

* update epsilon to 1000ths place

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-03-22 10:08:12 -07:00
Sheil Kumar
810c18e809
fix complex multi-dim dft (#10896)
Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-03-17 12:45:51 -07:00
Sheil Kumar
860f28254e
Update DFT definition to more closely align with PyTorch by enabling axis attribute, and arbitrary tensor rank. (#10842)
* Add axis attribute

* fix breaks

* Enable axis-specified DFT

* remove static cast

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-03-15 15:27:12 -07:00
Jingqiao Fu
f4fd67cc2c
Revert "add load from buffer (#10162)" (#10590)
This reverts commit 5cd57bb726.
2022-03-08 13:35:23 -08:00
Numfor Tiapo
9ad95bf068
Skip SetName test on inbox build (#10699) 2022-03-02 10:28:58 -08:00
Numfor Tiapo
5fbfca3d58
Add Experimental API for setting model name (#10518)
* Add experimental API for editing model name

* Change EditModelName to 'SetName'

* Change API to pass c_string

* Update SetName to edit the proto

* Test that the model proto gets changed

* Remove comments

* Skip inbox tests

* Use filehelper path

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-02-25 14:23:49 -08:00
Dwayne Robinson
6db6ee5710 Merged PR 6973543: ORT DML EP Opset 13 more complete
Extend opset 13 support for:
- Split-13
- Squeeze-13
- Unsqueeze-13
- Reshape-13
- QuantizeLinear-13
- DequantizeLinear-13
- ReduceSum-13
- Resize-13

Also:
- Rename the file where all the opset versions are stored from "OperatorRegistration.h" to "OperatorVersions.h", which will make it much less confusing in the future when looking given there's another file called "OperatorRegistration.h" that corresponds to "OperatorRegistration.cpp".
- Detemplatize many of the OperatorHelper.h constructors, which duplicate multiple instantiations due to the operator helper classes not sharing a common base class, by wrapping them with an adapter. Ideally there would be a common COM base interface that both IMLOperatorKernelCreationContext and IMLOperatorShapeInferenceContext implementation objects would implement, which a wrapper in MLOperatorAuthorHelper.h could QI for.
- Fix style formatting issues in OperatorHelper.h (sorry for the noise).

```
Summary: Total=4679, Passed=4355, Failed=0, Blocked=0, Not Run=0, Skipped=324
```

Corresponding WindowsAI PR:
https://microsoft.visualstudio.com/WindowsAI/_git/WindowsAI/pullrequest/6973645

Related work items: #36672908, #36672926
2022-02-18 01:41:07 +00:00
Ryan Lai
c07e251cec Merged PR 6835169: RI 12/9/21 - 01/12/22
Build is green https://microsoft.visualstudio.com/WindowsAI/_build/results?buildId=43713985&view=results

![image.png](https://microsoft.visualstudio.com/274e76ac-6b29-4f77-a85d-7914c77cabd5/_apis/git/repositories/853d2ddc-663c-4fe8-8036-dbf0d50db2d9/pullRequests/6835169/attachments/image.png)

Related work items: #37712737
2022-01-13 00:25:51 +00:00
Dwayne Robinson
4ff78aae45
Merge pull request #9917 from microsoft/user/dwayner/FnsCandyTolerance30696168
Update WinML model tests for FNS candy and Inception float16
2021-12-02 22:45:45 -08:00
Sheil Kumar
5edaa75ef6
Fix LoadFromStream to not use wss::Buffer internally (#9918)
Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-12-02 21:29:06 -08:00
Dwayne Robinson
6e4c534ce2 Relax tolerance slightly more for Intel after autopilot run 2021-12-02 19:42:31 -08:00
Dwayne Robinson
77e67a6de7 Add one more example line 2021-12-02 13:34:01 -08:00
Dwayne Robinson
ef7671b938 Comment out old lines 2021-12-02 13:30:34 -08:00
Dwayne Robinson
7a3abd863f Update WinML model test tolerances for tiny_yolov2 and FNS_Candy 2021-12-02 00:48:54 -08:00
Ryan Lai
d8a7e1d159 Merged PR 6718335: RI 11/30 from github
Pipeline green https://microsoft.visualstudio.com/WindowsAI/_build/results?buildId=42142807&view=results

![image.png](https://microsoft.visualstudio.com/274e76ac-6b29-4f77-a85d-7914c77cabd5/_apis/git/repositories/853d2ddc-663c-4fe8-8036-dbf0d50db2d9/pullRequests/6718335/attachments/image.png)

Related work items: #37220320
2021-11-30 21:29:25 +00:00
Sheil Kumar
53c43e9949
WinML RT API: Add PixelRange Metadata to Bind() call PropertySet (#9827)
* Enable Normalization Binding Metadata

* copy paste error

* Small fix.

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-11-24 13:44:25 -08:00
Sheil Kumar
3d0bd2596f
Enable creating OrtValues from ID3D12Resources from the onnxruntime C-API (#9686)
* Add onnxruntime-windows api.

* minor fixes

* add to package headers

* Build ort_dml_api for provider extensions.

* Cleanup

* misc comment

* remove winml specific comments

* use dml check in onnxruntime

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/session/onnxruntime_c_api.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update onnxruntime/core/session/onnxruntime_c_api.cc

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update onnxruntime/core/session/ort_apis.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update winml/test/adapter/AdapterSessionTest.cpp

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update onnxruntime/core/session/onnxruntime_c_api.cc

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update winml/adapter/winml_adapter_c_api.cpp

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/session/onnxruntime_c_api.h

Co-authored-by: Pranav Sharma <prs@microsoft.com>

* Update onnxruntime/core/session/onnxruntime_c_api.cc

Co-authored-by: Pranav Sharma <prs@microsoft.com>

* Update winml/adapter/winml_adapter_c_api.cpp

* PR feedback

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* Update include/onnxruntime/core/providers/dml/dml_provider_factory.h

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>

* PR feedback

* merge resolution and unreference param

* (naming) Remove Dml prefix

* maybe unused version

* move DML code into DML path. CIs failing because DML is not available when --use_dml is not on

* fix warning causing local build failures after merging

* Change getvaluememoryinfo to gettensormemoryinfo

* minor breaks

* fix comment paste

* fix comment

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>
Co-authored-by: Pranav Sharma <prs@microsoft.com>
2021-11-13 03:34:54 -08:00
Sheil Kumar
a17bdaf725
Enable JoinModels API in WinML+RT Experimental API (#9746)
* Dynamic onnx model fusion

* empty node names shoudl remain empty

* comments and cleanup

* logic reversed for promoting_unlined_outputs

* PR feedback

* type

* typo

* fix model outputs with promote unlinked output

* remove disembodied model

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-11-12 16:56:31 -08:00
sumitsays
88f61a1b2d
[DmlEp] DmlEp acknowledges ORT_NO_EXCEPTIONS (#9622)
* Make DmlEp Clang compatible for EPIC
* Fix build issues occurred when engine/lotus points to ORT Github latest
* Fix more build errors
* Fixed one build issue and removed temporary changes for Clang
* Addressed comments on the PR.
* [WIP] - DmlEp ORT NO Exception
* Made DmlEp compatible with ORT_NO_EXCEPTION
* Fixed typo
* Addressed comments on the PR, mostly nit styling and using approriate HR error code
* Added dependency of ErrorHandling.h
* Addressed comment on the PR
Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
2021-11-01 17:32:43 -07:00
Ginés Hidalgo
79436a2d5b
Avoided warning C5038 (#9543)
Updated several DML EP files to avoid warning C5038: data member 'member1' will be initialized after data member 'member2' / base class 'base_class'

More information:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=msvc-160
2021-10-30 00:36:22 -07:00
Sheil Kumar
775f862067
Add new option to disable cpu sync for tensors (#8490)
* add options to disable cpu copy back

* null check proprties

* only affect gpu outputs

* change name to disabletensorcpusync

* slight refactoring

* Globally enable ms-experimental ops

* change meaning of ms_experimental to mean *all* ms_experimental ops. Some experimental ops will still be enabled globally without this flag like audio ops.

* remove changes incorrectly merged

* bad merge

* add test

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-08-27 13:29:52 -07:00
Tiago Koji Castro Shibata
62c0d24340
Fix Windows Store build (#8753)
* Remove APIs unavailable in Store in #8349, #8178, #8065

* Add UWP stubs of C runtime functions

* Remove UWP incompatible tests from UWP build

* Remove incompatible tests from Store

* Use UWP stubs in store only

* Skip partition check outside of Windows

* Remove unused WRL include

* Workaround Windows header not including what it uses

* Fix precompiled header name clash

* Workaround SDK bugs

* DXCore workaround in Win7

* Fix warning

* Fix more warnings

* Bump WinML to target Windows 8

* Fix more warnings

* Remove unnecessary workarounds

* Remove Desktop only APIs from DML adapter
2021-08-23 11:19:03 -07:00
Changming Sun
436ac6dd5f
Rename ml_value.h to ort_value.h (#8726) 2021-08-13 07:04:56 -07:00
Adrian Tsai
caacf249c5
Disable candy_opset9 WinML model test on Qualcomm Adreno (#8647)
Bug #31652854 also repros on Qualcomm Adreno (down to the exact same pixel). This change disables this model test for Qualcomm, in addition to the existing disablement for Intel.
2021-08-11 17:57:12 -07:00
ytaous
0725f80d2d
Revert "Fix Windows Store build (#8481)" (#8679)
This reverts commit 53e7831b53.
2021-08-11 00:37:36 -07:00
Tiago Koji Castro Shibata
53e7831b53
Fix Windows Store build (#8481)
* Remove APIs unavailable in Store in #8349, #8178, #8065

* Add UWP stubs of C runtime functions

* Remove UWP incompatible tests from UWP build

* Remove incompatible tests from Store

* Use UWP stubs in store only

* Skip partition check outside of Windows

* Remove unused WRL include

* Workaround Windows header not including what it uses

* Fix precompiled header name clash

* Workaround SDK bugs

* DXCore workaround in Win7

* Fix warning

* Fix more warnings

* Bump WinML to target Windows 8

* Fix more warnings

* Remove unnecessary workarounds
2021-08-10 15:19:30 -07:00
Tiago Koji Castro Shibata
fc331cbd5d
Accept success codes other than S_OK in RoInitialize (#7979)
* Accept success codes other than S_OK in RoInitialize

* Use multithreaded apartment in raw WinML tests
2021-06-07 18:06:31 -07:00
Billy Franscois
0e935b8718
Fix typo (#7872)
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2021-06-02 10:39:23 -07:00
sumitsays
e344a583b0
updated sampleTolerance of model fp16_inception_v1 for GPU execution provider (#7533)
Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
2021-05-03 12:08:31 -07:00
Ori Levari
dfca1a09d5
Add Thread Spinning Session Option in WinML (#7498)
Co-authored-by: Ori Levari <orlevari@microsoft.com>
2021-04-30 11:44:58 -07:00
Adrian Tsai
f13b378995
Re-disable tests (#7495) 2021-04-28 21:50:22 -07:00
sumitsays
d67c86265b
Enabled fp16-inception-v1 test (#7406)
Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
2021-04-22 23:05:03 -07:00
Brian Martin
3eb2d349a6
fix typo in scenariotestscppwinrt.cpp (#7334)
the word is spelled, "resetting".
2021-04-14 08:26:55 -07:00
Ryan Lai
10102c09b6
Add better model test error messaging (#7239) 2021-04-05 14:59:19 -07:00