Commit graph

123 commits

Author SHA1 Message Date
Changming Sun
228dd16893
Bump clang-format from 18.1.8 to 19.1.6 (#23346)
To replace #23327
2025-01-14 09:02:04 -08:00
A-Satti
f5293d253c
Update Intel Thread Counts (#22894)
### Description
The default thread count methodology by onnxruntime did not account for
new upcoming Intel microarchitectures leading to a suboptimal thread
count. Optimizing the thread count for new Intel microarchitectures
reveal gains on the majority of models across datatypes and shows gains
up to ~1.5x speedup.


### Motivation and Context
Applications should run on Intel with the most performant thread
configuration for the majority of models. With new microarchitectures,
adjusting the thread count methodology is required to take advantage of
their differences.
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2024-12-06 13:56:50 -08:00
Justin Chu
c203d89958
Update ruff and clang-format versions (#21479)
ruff -> 0.5.4
clang-format -> 18
2024-07-24 11:50:11 -07:00
mindest
5b9369e93c
Fix typos according to reviewdog report. (#21335)
### Description
Fix typos based on reviewdog report but with some
exceptions/corrections.
2024-07-22 13:37:32 -07:00
Changming Sun
2c53b4a534
Remove core/common/gsl.h (#20894)
### Description
It might be easier if we just directly include the original gsl headers.
"core/common/gsl.h" is an indirection that doesn't provide extra help.
2024-07-08 18:09:39 -07:00
Rachel Guo
19793de1b3
#19921 [Dup] LLC Core count calculations updated (#20171)
### Description
<!-- Describe your changes. -->

See #19921 Just to address one comment:
https://github.com/microsoft/onnxruntime/pull/19921#discussion_r1543398640

since this is an external branch. need to open another pull request for
this.

### 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. -->

---------

Co-authored-by: Sai Kishan Pampana <sai.kishan.pampana@intel.com>
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Jian Chen <cjian@microsoft.com>
2024-04-02 16:53:47 -07:00
Sheil Kumar
5197db1980
Diable __cpuid call for ARM64EC (#19592)
Diable __cpuid call for ARM64EC

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2024-02-21 15:45:44 -08:00
Sheil Kumar
3c49aacd56
Disable __cpuid check on arm64 builds as intrinsic is not available (#19574)
Disable __cpuid check on arm64 builds as intrinsic is not available

Motivation
Breaking the arm64 build.

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2024-02-20 13:13:40 -08:00
Sheil Kumar
1508c2ee39
Restrict L2 Cache Core check to Intel devices (#19483)
### Description
Limit SoC core detection via 2 level cache core logic to Intel and
Hybrid processors.

### Motivation and Context
The following code was added to add support for a new class of CPU cores
present in Intel’s next generation Intel Core Ultra mobile processors.
This code is essential to avoid placing threads on low performing SoC
cores that don’t have L3 cache. SoC cores are meant to specialize in
system bringup and help improve responsiveness and power usage, in other
words they are not meant to run compute heavy AI workloads. In order to
avoid broad exposure of this logic, it is currently designed to be
restricted to Intel platforms that have hybrid enabled.

---------

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2024-02-14 10:31:03 -08:00
Sheil Kumar
0b7048e7d6
Update winml to use #cores - #soc cores by Default as the number of intraopthreads (#18384)
Update winml to use #cores - #soc cores by Default as the number of
intraopthreads

---------

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2023-11-28 09:26:48 -08:00
Justin Chu
c250540722
Bump linter versions (#18341)
Bump linter versions and run format.
2023-11-08 13:04:40 -08:00
Sheil Kumar
cb9408e89c
Enable cpp20 builds for DML EP and WinML API (#17800)
Enable cpp20 builds for DML EP and WinML API

1) Missing typename for templated types
2) unmove helper for inline references to rvalue temporaries
This is okay since per the standard a temporary bound to a reference
parameter in a function call exists until the end of the full expression
containing that function call: if the function returns a reference,
which outlives the full expression, it becomes a dangling reference.

3) static now not needed for template specializations

---------

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2023-10-06 10:33:38 -07:00
cao lei
32f5658abb
remove gsl to make status.h independent from gsl (#17402)
### Description
<!-- Describe your changes. -->
Make status.h independent from gsl.


### 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. -->
In the coming new feature external EP API (see the prototype
https://github.com/microsoft/onnxruntime/pull/16718), we need to expose
stream in the public header, however, stream is dependent on status.h
which is dependent on gsl. We are seeking a way to decouple stream from
gsl.

From Changming's comment offline, prefast is disabled so all
GSL_SUPPRESS are not taking any effect now. He will handle the warnings
when enable prefast in the future
2023-09-13 21:47:43 -07:00
Justin Chu
416dc2e84d
Fix clang-format comment indents on Windows for winml/ (#17144)
On Windows, clang-format has a bug when AlignTrailingComments.Kind is
set to `Leave`
(https://clang.llvm.org/docs/ClangFormatStyleOptions.html#aligntrailingcomments),
where it will keep adding indentation to comments after each formatting
runs.

This PR changes to always align comments so we do not hit the bug.

As a consequence of the options change we need to reformat some of the
files. Note that this option is aligned with the rest of the repository.
2023-08-14 23:50:14 -04:00
Jeff Bloomfield
0180c0429f
Fix DML regression from allocator refactor and enable unrounded weight allocation in ORT API (#17030)
This addresses a DML performance regression from the following PR
resulting in allocations not being rounded and pooled in the DML
execution provider.

https://github.com/microsoft/onnxruntime/pull/15833

This also fixes a pre-existing limitation that allocations during
session initialization (primarily large weights and persistent
resources) only bypassed rounding and pooling while using the Winml API.
The allocator now also respects a caller's rounding mode parameter when
provided.
2023-08-10 17:02:24 -07:00
Justin Chu
eeef157888
Format c++ code under winml/ (#16660)
winml/ was previously excluded from lintrunner config. This change
includes the directory and adds the clang-format config file specific to
winml/ that fits existing style.

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
2023-07-25 21:56:50 -07:00
Sheil Kumar
0c956bef0a
[WinML] Fix warnings in OnnxruntimeEngine and OnnxruntimeEngineBuilder (#16679)
Fix [prefast:Warning]: C6101 (in
'_winml::OnnxruntimeEngine::CreateTensorValueFromDefaultAllocator'
Fix [prefast:Warning]: C6101 (in
'_winml::OnnxruntimeEngineBuilder::CreateEngine'

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2023-07-12 13:09:50 -07:00
Sheil Kumar
f46956056d
Add WinML Experimental API to Register ORT CustomOps Libraries (#16535)
Add WinML Experimental API to Register ORT CustomOps Libraries

---------

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2023-06-30 22:17:35 -07:00
cao lei
0c5f492493
remove AllocatorMgr class (#16509)
### Description
Remove AllocatorManager class


### Motivation and Context
After the refactor PR #15833 is in, AllocatorManager class is not
referenced anymore.
2023-06-28 15:43:19 -07:00
cao lei
dd72192cf4
ExecutionProvider API refactor - move allocator from EP level to SessionState level and indexed by OrtDevice (#15833)
### Description
This PR is to refactor ExecutionProvider API for memory management,
which is to move allocators from EP level to SessionState level and
indexed by OrtDevice



### 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. -->
This PR is to refactor ExecutionProvider API for memory management,
which is to move allocators from EP level to SessionState level and
indexed by OrtDevice. By this change, EP level will shift the burden of
maintaining allocators, which will be user friendly for EP developers

---------

Co-authored-by: Lei Cao <leca@microsoft.com@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2023-06-19 17:44:45 -07:00
Numfor Tiapo
f44f6c5b2e
Fix Prefast Errors (#15651)
This PR adds fixes for prefast errors with the following codes:

- C26814
- C26451
- C26400
2023-04-25 16:41:39 -07:00
Sheil Kumar
7ccdf9ad8c
User/sheilk/sequence fix (#15239)
Ensure that Loop operators run on CPU.
Fix memcpy for Sequence Tensors, so that empty sequences (like when
SequenceEmpty runs on DirectML) can be copied back to CPU.
2023-03-31 12:57:25 -07:00
Numfor Tiapo
e0dcbc3832
Fix C26436 prefast errors (#13774)
Fixes errors 9196, 9214, 9255, and 9314.

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-12-01 09:07:44 -08:00
Numfor Tiapo
aa1390e963
Fix Prefast Errors (#13675)
Fixes all C28204, C6031, and C26814 prefast errors.

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-11-28 09:16:22 -08:00
Numfor Tiapo
49e5a11ccd
Fix SDL and Prefast Errors (#13465)
Fixes Errors 1978844, 1978870, 1978850, 1978855, and 9245

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-10-28 09:41:18 -07:00
Numfor Tiapo
56387c3c31
Fix SDL Unmatched Annotation Errors (#13162)
Fixes 3 SDL unmatched annotation errors.

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-09-30 15:36:30 -07:00
Brian Martin
c20abcab87
User/brianma/eo (#13152)
fixing SDL issues. One was a SAL mismatch, the other was handling an
optional null pointer.
2022-09-30 09:43:56 -07:00
Yulong Wang
1a402a3f25
replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -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
Jingqiao Fu
f4fd67cc2c
Revert "add load from buffer (#10162)" (#10590)
This reverts commit 5cd57bb726.
2022-03-08 13:35:23 -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
Jingqiao Fu
2fa333443a
Add telemetry for device kind (#10431)
Add telemetry for device kind
2022-02-17 13:56:22 -08:00
Sheil Kumar
2dd5e75ba8
Incorrect output after GPU to GPU inference via VideoFrame and Gray8 models (#10425)
* If the tensor is of gray8 format, we should call the gray8 shader

* other check (which resolves to unknown in this case) is incorrectly being compared to constant and not DXGI_FORMAT

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-01-28 08:45:57 -08:00
Jingqiao Fu
5cd57bb726
add load from buffer (#10162)
* Add LoadFromBuffer API
2022-01-10 10:51:48 -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
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
9fb3fac5a0
Enable LearningModel::LoadFromFilePath in UWP Apps (#9790)
Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-11-17 19:09:31 -08:00
Brian Martin
20ec48129b
fix typo in LearningModelDevice.cpp (#9787)
Ivalid -> Invalid
2021-11-17 15:29:34 -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
Ginés Hidalgo
13e64f8ff7
Remove all warnings C4800: Implicit conversion from 'int32_t/int64_t' to bool. Possible information loss (#9535) 2021-11-08 10:12:27 -08: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
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
Xiang Zhang
778680202b remove unused functions to avoid warnings 2021-07-28 18:03:00 -07:00
Xiang Zhang
73660d78df
Fix WinML build warnings in HStringFromUTF8 (#8519) 2021-07-27 22:29:58 -07:00
Sheil Kumar
eec8e1394a
Memory map files on windows to speed up model load (#8349)
* Memory map files on windows to speed up model load

* fix custom ops

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-07-12 11:52:08 -07:00
Sheil Kumar
bd5067a2ff
Cannot upgrade SDK version because winml_lib_telemetry pulls in SDK cppwinrt version (#7795)
* fix telemetry includes

* add dependencies

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-05-24 08:00:24 -07:00