Commit graph

1649 commits

Author SHA1 Message Date
Hariharan Seshadri
5c2e474751
Add provision in ORT for session options to be parsed when available via model file (#2449)
* Initial commit

* Fix gitmodules

* Nits

* Nits

* Updates

* Update

* More changes

* Updates

* Update

* Some updates

* More changes

* Update

* Update

* Merge

* Update

* Updates

* More changes

* Update

* Fix nits

* Updates

* Fix warning

* Fix build

* Add comment

* PR feedback

* PR feedback

* Updates

* Updates

* Update

* More changes

* Fix build break

* Comment test for now

* Updates

* Updates

* PR feedback

* Updates

* Nits

* Add tests

* Fix build

* Fix build

* Fix build

* Fix build break

* Fix build

* Nits

* PR feedback

* More change

* Expose GetSessionOptions in pybind logic and add unit test for python

* Fix build

* PR feedback

* PR feedback
2019-12-03 16:56:07 -08:00
shahasad
178d059111 Setup java ci (#2528) 2019-12-03 14:21:51 -08:00
Tianlei Wu
b50878dcf0 Disable Attention fusion tests when DISABLE_CONTRIB_OPS is defined (#2529) 2019-12-03 14:21:21 -08:00
Ashwini Khade
e32eff826c
enable nuget package testing on centos7 (#2527)
* add centos tests to linux cpu ci pipeline

* Disable failing test

* use centos6 instead of centos7

* change back to centos7

* add dotnet runtime dependency

* fix dotnet runtime dependencies

* install dotnet sdk instead of runtimes

* add more dotnet dependencies

* temporary skip failing test

* ix lib path

* reenable failing test
2019-12-03 10:16:45 -08:00
RandySheriffH
85a4ed8cf7
fix cuda kernel causing invalid mem access (#2523) 2019-12-03 09:16:00 -08:00
Tianlei Wu
66254eb25a
Update BERT model optimization python script (#2521)
Add support of GPT2 model optimization:
* Match subgraph of Gelu Approximation (using Tanh).
* Fuse LayerNormalization if SkipLayerNormalization is not ready.
* Output model even if embedding layer is not fused.
* Improve Reshape Fusion to improve coverage.
* Refine constant input checking, and output fused op counter.

Update script according to latest op improvements:
* Fusion of Add Bias and Gelu.
* Fuse SkipLayerNormalization and Add Bias.

Other:
* Add ReduceSum for mask as intermediate step.
* Refactor verbose setting.
2019-12-03 08:40:51 -08:00
Sreekanth Yalachigere
31ea11a696 Renaming MKL-DNN as DNNL (#2515)
* DNNL: Moving Files to rename file names

* DNNL name change

* azure pipeline updated

* disable ceil/dialation and enable Opset10

* disable ceil/dialation tests in Python

* mlperf_ssd_resnet34_1200 disabled
2019-12-03 07:34:23 -08:00
Changming Sun
3d627362a0
Upgrade Windows CPU CI pipeline to use VS 2019 (#2519) 2019-12-02 23:05:35 -08:00
Scott McKay
e8b327d657
Fix constant folding of node assigned to CUDA (#2510)
* Constant folding bug fix/improvements
  - Handle constant folding for node that is assigned to a non cpu EP
  - Check for errors in optimizer execution frame setup
  - Improve CUDA partitioning to look for initializers in parent graphs
  - Add unit test

Fixes #2474
2019-12-03 16:28:44 +10:00
Changming Sun
4354023913
Make link time optimization work on Linux (#2477) 2019-12-02 22:25:41 -08:00
baowenlei
25c260fdef Add parallel for tensorized gemm (#2517)
* add parallel for tensorize gemm

* add option to control parallel

* change to a more clean way to control
2019-12-02 22:05:46 -08:00
KeDengMS
c1be615c45
[NupharEP] refine parallel schedule control (#2514)
* [NupharEP] Add parallel schedule to JIT function name
Update Nuphar docker to use Python 3.6 and ubuntu 18.04

* Update notebook

* Avoid JIT cache file name conflict
2019-12-02 17:40:51 -08:00
Zhang Lei
784eca0dcd
Cuda pad() for opset 11 (#2490)
* Cuda pad opset 11.

* Handle type conversion issue in building.
2019-12-02 16:28:17 -08:00
Jeff Bloomfield
b9faa0b6fd Fix kernel registry validation to reenable DML kernels 2019-12-02 15:43:44 -08:00
Scott McKay
ddaad86605
CUDA Loop (#2444)
* Implement CUDA Loop operator.

* Add control flow node implicit input handling to the memcpy transformer and allocation planner.
2019-12-03 08:29:21 +10:00
Zhang Lei
50eb140119
Cuda Resize Operator for opset 11. (#2484)
* Cuda Resize Operator for opset 11.
2019-12-02 13:42:21 -08:00
xavier dupré
c42148a0c3 Improves softmax function for standard ml 2019-12-02 10:48:46 -08:00
Dmitri Smirnov
ec88f6d8d6
Add DataFrameTool (#2456)
Add DataFrameTool to feed inputs from Panda DataFrame
2019-12-02 10:12:03 -08:00
Yulong Wang
89824b35e9
optimize CPU implementation of Attention (#2496) 2019-12-01 14:43:38 -08:00
Tianlei Wu
0f57e0a49e
Change mask input of EmbedLayerNormalization op to be optional (#2495)
Change mask input of EmbedLayerNormalization op to be optional
2019-12-01 08:36:06 -08:00
liuziyue
0edd4ef6ca
EmbedLayerNormalization fusion (#2452)
Embed Layer Normalization Fusion
2019-11-28 14:03:58 -08:00
KeDengMS
60208463a9
[NupharEP] Enable parallel schedule (#2505)
* [NupharEP] Enable parallel schedule
* Update TVM with the fix to TVM threadpool to use OpenMP if possible
* Add parallel schedule when trying to vectorize
With this change, BERT squad perf on a 4-core (8 HT) CPU goes from 187ms to 150ms

* Address CR, docs and cmake update

* Doc fix

* Fix mkl

* Fix TVM windows build when using mklml
2019-11-28 08:35:56 -08:00
Yufeng Li
005305be6e
Implement AddGelu and SkipLayerNorm (#2487)
* Implement AddGelu and SkipLayerNorm
2019-11-28 08:29:59 -08:00
Zhang Lei
ee0bde6b69 Enable three type of Equal() to version 11. (#2508) 2019-11-28 03:03:43 -08:00
Dmitri Smirnov
75b4747701
Fix a memleak in pybind. (#2503) 2019-11-27 15:32:05 -08:00
Scott McKay
1fdf1006ac
Various fixes coming out of discussions in #2436 (#2497)
- Add --skip_tests option to build.py based on github feedback
  - Add debug output at end of run_subprocess so it's clearer when the output is from a different process running
  - Add check for scipy as it's required by gen_test_models.py for the onnx tests
  - Use log.warning instead of warnings.warn for consistency. We use the logger almost everywhere and somewhat randomly used warnings.warn in two places.
  - Add check for 'wheel' dependency not being found in setup.py and handle more gracefully
  - Fix invalid input name in Keras tests
2019-11-28 07:03:23 +10:00
Zhang Lei
04b6097db4
Cuda Clip() for op set 11. (#2411)
* Cuda Clip() for op set 11.
* make min_val and max_value input CPU memory directly.
* Remove original cu file useless "#pragma once"
* merge duplicate logic into one class.
2019-11-27 12:42:45 -08:00
Yulong Wang
ccbd778d0d optimize CPU implementation of EmbedLayerNorm (#2491)
* optimize CPU implementation of EmbedLayerNorm
* use atomic in parallelization
2019-11-27 12:34:57 -08:00
Tianlei Wu
e57b735bb9 Add a transformer to use Gelu approximation for cuda provider (#2480)
* Add Gelu Approximation Transformer to convert Gelu or AddGeluFusion to FastGelu to get better inference performance.
2019-11-27 10:15:50 -08:00
Yulong Wang
7c7d5a149c
Disable thread pool creation when enabled OpenMP (#2485) 2019-11-27 02:09:18 -08:00
Yulong Wang
e29fb5cef1
Add BatchParallelFor, TryParallelFor, TryBatchParallelFor into ThreadPool (#2476) 2019-11-27 00:32:26 -08:00
Xiang Zhang
d6c84925d5 move logSessionCreation after session is initialized (#2481) 2019-11-26 19:09:22 -08:00
Zhang Lei
ca8ff8c91c
Enable conv/conv_transpose for opset 11 in cuda execution provider. (#2401)
Enable conv/conv_transpose and existing pooling for opset 11 in cuda execution provider.

They are of spec dilates/strides change related cuda pooling ops for op set 11.
2019-11-26 11:35:28 -08:00
Changming Sun
1ca0e0866e Revert "Remove DeviceAllocatorRegistry class (#2451)"
This reverts commit 6a88d03621.
2019-11-25 23:43:10 -08:00
Scott McKay
4cac18f666
Optimize CPU Transpose for a single axis moving (#2461)
* Optimize CPU Transpose for one axis moving either inwards or outwards. We have optimizations for NCHW <-> NHWC in CUDA but not CPU. This provides a more generic optimization to the CPU implementation.

Tested performance in both directions with data sizes of 8, 16, 32 and 64 bits, size of axis being moved of 3, 16 and 32, and number of elements to move of 100x100, 300x300 and 1000x1000.

Across all tests the average improvement even with the overhead of python was 2.5x. No cases were slower. Some were 6x faster.

Binary size increase in RelWithDebInfo build is ~5K.

NOTE: See PR comments for details of performance comparison with Eigen. Eigen is slightly faster but increases binary size by 55K just for support of rank 4 input. Binary size would be further increased to support different ranks.
2019-11-26 14:05:44 +10:00
shahasad
882f28a74b
Fix NuGet end to end tests for custom op dll (#2472) 2019-11-25 15:26:09 -08:00
Tianlei Wu
5dce9be4f9
Add Attention Fusion Transformer (#2445)
Add Attention Fusion Transformer to fuse multi-head self attention subgraph to one node for optimizing Bert model inference performance.

It supports BERT model exported from PyTorch. It fuses about 20 nodes into one Attention node, and could significantly improve the inference speed of BERT model.

Support symbolic (first dimension for batch size) in input shape.
2019-11-25 14:46:37 -08:00
Ashwini Khade
4caf5c9c13
add additional test data set for nuget pipeline (#2448)
* add SAS token to download internal test data for nuget pipeline

* update azure endpoint

* fix keyvault download step

* fix variable declaration for secret group

* fix indentation

* fix yaml syntax for variables

* fix setting secrets for script

* fix env synctax

* Fix macos pipeline

* attempt to add secrets to windows download data

* fix mac and win data download

* fix windows data download

* update test data set url and location
2019-11-25 13:08:03 -08:00
KeDengMS
e0b51e4d95
Symbolic shape inference improvements: (#2460)
* Symbolic shape inference improvements:
- add a mode to guess unknown ops' output rank
- add support for GatherND
- add support for If
- fix a bug in get_int_values when then tensor rank > 1D, by treating it as no sympy data
- add symbol to literal merge when ONNX silently merges dims
- fix a bug in Concat when input dim is 0
- fix a bug in ConstantOfShape that computed dim is not updated
- add support for dynamic shape in ConstantOfShape
- fix a bug in Loop output shape that loop iterator dim is not inserted at dim 0
- add support for dynamic padding in Pad
- add support for dynamic shape in Reshape
- add support for Resize with opset > 10, by treating output dims as dynamic
- fix a bug in Slice when starts/ends are dynamic
- restrict input model to opset 7 and above
- make output model optional to avoid disk write when testing

Run model tests for symbolic shape inference

Reduce 2GB docker image size of nuphar
2019-11-25 10:31:13 -08:00
Pranav Sharma
a01816335d
Allow more than one invocation of CreateEnv in the same process. (#2467)
* Allow more than one invocation of CreateEnv in the same process.

* Fix centos build
2019-11-24 22:34:10 -08:00
Yufeng Li
b3bfc094b9
Fuse SkipLayerNorm with Bias (#2453)
Fuse SkipLayerNorm with Bias
2019-11-22 14:20:46 -08:00
Changming Sun
e7131f6d12 Pull the latest image before running docker build 2019-11-22 13:48:37 -08:00
Changming Sun
0341ee9060
Clean up build.py (#2446) 2019-11-22 12:14:03 -08:00
Yufeng Li
d49cbf6e08
Parallel Gelu with ParallelFor (#2399)
Parallel Gelu to get better performance for Gelu
2019-11-22 11:48:46 -08:00
shahasad
ca0ed96621
CSharp api and test for loading custom op shared library (#2420)
- Added C-API test for loading custom op shared lib.
- Made some changes in C++ api header and C-api implementation to get it working.
- Added C# API and corresponding test for loading custom op shared library.
2019-11-21 15:45:49 -08:00
Changming Sun
6a88d03621
Remove DeviceAllocatorRegistry class (#2451)
Remove DeviceAllocatorRegistry class
2019-11-21 13:00:25 -08:00
Yang Chen
d486481455
Correctly handle implicit inputs for fused nodes (#2390)
* Correctly handle implicit inputs for fused nodes

Previously, nuphar's partitioning function didn't include
node's implicit inputs into the inputs list of MetaDef, and hence
a crash was triggered in the onnx graph checker.

This commit fixed the issue. Furthermore, it also fixed a related
issue where we didn't add implicit inputs into
graph_inputs_excluding_initializers_ in Graph::SetGraphInputsOutputs.

the issue was that graph_inputs_including_initializers_ populated by
SetInputs (e.g. called by FunctionImpl::FunctionImpl) may contain
implicit inputs which were not of any node's initializers in the graph.
Because they were not part of any initializers, these implicit inputs
couldn't be visited by going through all nodes' inputs.
Consequently, they would *not* be added into graph_inputs_excluding_initializers_.

We fixed the issue by first copying the populated graph_inputs_including_initializers_
into graph_inputs_excluding_initalizers_, which then had both initializers and
non-initializers as its initial content. Later, we erase initializers from the
list. In this way, we can ensure all implicit inputs to remain in
graph_inputs_excluding_initializers_.

* refined comments and fixed duplicates

Address CR by revisiting comments in terms of implicit inputs

Also fixed an issue by skipping duplicates while copying inputs
from graph_inputs_including_initializers_.

* address CR

explain why we need to collect nodes' implicit inputs

* don't rely on pointer values for iterating std::set

Previously, openvino relied on iterating a set of NodeArg pointers
to construct inputs and outputs for a fused graph. It could cause
non-determinism. The reason was that although iterating std::set by
itself is stable, pointer values of NodeArgs may vary. Consequently,
we could end up visiting the set's elements in different orders for
different runs for the same test, which resulted in constructing
inputs (and outputs) with different orders to the fused graph.
For example, for the same test, we may have inputs [A, B] in some
runs but inputs[B, A] in others.

Let's use std::string as the key type to avoid such nondeterminism.

This commit also added implicit inputs into meta->inputs while returning
the capability from the openvino provider.

* Fixed another latent issue in openvino's GetCapability function

The issue was that we couldn't simply erase fused_inputs and fused_outputs
while iterating the nodes. For example, an output NodeArg may have multiple
uses, and it's wrong if we erase it from fused_outputs when we encounter only
one of its uses as input.
2019-11-21 10:27:09 -08:00
Changming Sun
6bcf95477e
Fix Windows GPU C API packaging pipeline failure (#2440)
Fix Windows GPU C API packaging pipeline failure (#2440)
2019-11-20 14:00:37 -08:00
Scott McKay
87d3794ad2
Add CUDA Scan operator. (#2403)
* Add Scan CUDA op.
Uses CPU implementation for logic.
Added some device specific functors for handling when data needs to be manipulated on a different device.
Added ability to override the materialization logic in the OrtValue slicer so DML can plugin their handling.
2019-11-21 07:59:06 +10:00
baowenlei
9b7b5e2c27
Adjust codegen vectorization width from target (#2439)
* Adjust codegen vectorization width from target
2019-11-20 13:28:15 -08:00