Commit graph

8359 commits

Author SHA1 Message Date
Chi Lo
c964da7ea2
FasterTransformer model wrapper using custom op (#15013)
### Description
<!-- Describe your changes. -->
We are introducing the FasterTransfomer model-level integration using
ORT [custom op runtime
wrapper](https://github.com/microsoft/onnxruntime/pull/13427).
In order to make the FT wrapper/integration work, two things need to be
done:

- New API `KernelInfoGetConstantInput_tensor`. (Done in this PR)
During custom op kernel initialization, it needs to get the model
weights (saved as node's constant inputs) ready for FT's weights
instantiation. What's why we need to add this new API to make kernel
info capable of getting constant inputs.

- Custom op and custom op kernel to wrap FT model. (Will provide in
onnxruntime extensions or inference examples)
During custom op kernel initialization, it can fetch attributes from
kernel info to determine which kind of FT model instance create. During
custom op kernel compute/inference, it can get input/output from kernel
context and then assign input/output buffers for model instance to run.
2023-03-20 09:05:30 -07:00
PeixuanZuo
32a4eebc17
[ROCm] add rocm5.4.2 to python package pipeline (#15081)
add rocm5.4.2 to python package pipeline:
https://download.onnxruntime.ai/onnxruntime_nightly_rocm542.html
2023-03-20 10:30:14 +08:00
Adrian Lizarraga
e42f7487df
Add logging APIs for custom operators (#14416)
### Description
Add logging APIs for custom ops.

This PR introduces a `OrtLogger` type, which can be retrieved from a
`OrtKernelInfo` or `OrtKernelContext`. The kernel info's logger is the session logger stored
in the execution provider. The kernel context's logger is a run logger.



### Motivation and Context
Allows custom ops to log information in a manner consistent with
built-in ops.

Example usage in custom op:
```C++
struct MyCustomKernel {
  MyCustomKernel(const OrtApi& api, const OrtKernelInfo* info) {
    Ort::ConstKernelInfo kinfo(info);
    this->logger_ = kinfo.GetLogger();
    // ...
    ORT_CXX_LOGF_NOEXCEPT(this->logger_, OrtLoggingLevel::ORT_LOGGING_LEVEL_ERROR, "Error: %s", err_msg);
  }

  void Compute(OrtKernelContext* context) {
    ORT_CXX_LOG(this->logger_, OrtLoggingLevel::ORT_LOGGING_LEVEL_VERBOSE, "Calling compute...");
    // ...
  }

  // ...
 private:
  Ort::Logger logger_;
};
```
2023-03-17 15:05:28 -07:00
Kevin Chen
2023836c2f
Fix CUDA tests for Ampere cards, and bump layernorm tests opset version (#14761)
### Description

Three main changes:

* `qOrdered*` tests fail 100% on Ampere+ cards with cublas error.
Disable them on these cards.
* Bump LayerNormalization tests to opset 17, to be consistent with the
ONNX specification. Mark TRT EP as a provider that does not do error
checking on faulty LayerNorm definitions
* Remove null tensor for optional `bias` input for LayerNorm. Optional
inputs should be omitted entirely.


### Motivation and Context

Streamlines testing for CUDA and TRT with later NVIDIA architectures.

Signed-off-by: Kevin Chen <kevinch@nvidia.com>
2023-03-17 09:30:01 -07:00
cloudhan
98ab4a62d6
Fix ROCm 5.2.3 pipeline (#15073)
Make CK optional again.
2023-03-17 15:59:57 +08:00
pengwa
1ccb79476c
Fix training gpu ci related to pl upgrade (#15092)
### Fix training gpu ci related to pl upgrade

As new version of pln relased, old parameter of pln.Trainer, gpus looks
not supported. So we switch to new params to make it work.

```
['/home/onnxruntimedev/miniconda3/bin/python3', 'orttraining_test_ortmodule_torch_lightning_basic.py', '--train-steps=470', '--epochs=2', '--batch-size=256', '--data-dir', '/mnist'] 

/home/onnxruntimedev/miniconda3/lib/python3.8/site-packages/torch/onnx/utils.py:1794: FutureWarning: The first argument to symbolic functions is deprecated in 1.13 and will be removed in the future. Please annotate treat the first argument (g) as GraphContext and use context information from the object instead. warnings.warn( Traceback (most recent call last): File "orttraining_test_ortmodule_torch_lightning_basic.py", line 101, in <module> main() File "orttraining_test_ortmodule_torch_lightning_basic.py", line 96, in main trainer = pl.Trainer(**kwargs) File "/home/onnxruntimedev/miniconda3/lib/python3.8/site-packages/pytorch_lightning/utilities/argparse.py", line 69, in insert_env_defaults return fn(self, **kwargs) TypeError: __init__() got an unexpected keyword argument 'gpus'
```
2023-03-17 13:26:58 +08:00
Yi-Hong Lyu
5ac3a37be5
Add float16 Tanh support (#15048) 2023-03-16 18:57:38 -07:00
PeixuanZuo
4a8cd4256a
fix miopen new API cannot be supported by ROCm5.2.3 (#15077)
miopenTensorLayout_t was added after MIOpen version 2.18.0. Define it
in ORT when use MIOpen version lower than 2.18.0.
2023-03-17 08:40:35 +08:00
PeixuanZuo
55174bb2e9
Fix Nhwcconv with asymmetric padding (#15050)
1. Fix Nhwcconv with asymmetric padding. The slice axies are (1,2) with
NHWC layout.
2. For ROCm EP, Move Addbias after SliceOutUnwantedOutputSection,
because before that, the actual output of Conv is s_.y_data.
2023-03-17 08:38:25 +08:00
dependabot[bot]
6a6513f9c0
Bump @sideway/formula from 3.0.0 to 3.0.1 in /js/react_native (#15028)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0
to 3.0.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5b44c1bffc"><code>5b44c1b</code></a>
3.0.1</li>
<li><a
href="9fbc20a02d"><code>9fbc20a</code></a>
chore: better number regex</li>
<li><a
href="41ae98e042"><code>41ae98e</code></a>
Cleanup</li>
<li><a
href="c59f35ec40"><code>c59f35e</code></a>
Move to Sideway</li>
<li>See full diff in <a
href="https://github.com/sideway/formula/compare/v3.0.0...v3.0.1">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~marsup">marsup</a>, a new releaser for
<code>@​sideway/formula</code> since your current version.</p>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@sideway/formula&package-manager=npm_and_yarn&previous-version=3.0.0&new-version=3.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/onnxruntime/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 10:17:38 -07:00
dependabot[bot]
3059a73b38
Bump @sideway/formula from 3.0.0 to 3.0.1 in /js/react_native/e2e (#15029)
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0
to 3.0.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5b44c1bffc"><code>5b44c1b</code></a>
3.0.1</li>
<li><a
href="9fbc20a02d"><code>9fbc20a</code></a>
chore: better number regex</li>
<li><a
href="41ae98e042"><code>41ae98e</code></a>
Cleanup</li>
<li><a
href="c59f35ec40"><code>c59f35e</code></a>
Move to Sideway</li>
<li>See full diff in <a
href="https://github.com/sideway/formula/compare/v3.0.0...v3.0.1">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~marsup">marsup</a>, a new releaser for
<code>@​sideway/formula</code> since your current version.</p>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@sideway/formula&package-manager=npm_and_yarn&previous-version=3.0.0&new-version=3.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/onnxruntime/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 10:16:40 -07:00
Pranav Sharma
6600fd792a
Fix CPU memory leak due to external weights not getting memory unmapped when using non-CPU EP. (#15040) 2023-03-16 08:01:46 -07:00
Yi Zhang
1e7849c2c8
Add compilation cache in iOS pipeline (#15070)
### Description
<!-- Describe your changes. -->

### Motivation and Context
iOS pipeline duration could be reduced to 20 more minutes from 90 more
minutes

https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=921577&view=results

### Ref
https://ccache.dev/manual/4.8.html#_c_modules
2023-03-16 21:43:18 +08:00
Vincent Wang
25e537770f
[CUDA] Fix Alignment of SkipLayerNorm Vectorized Kernel (#15054)
Some of our vectorized kernels (including SkipLayerNorm) doesn't check
the alignment of data pointer. While ORT's allocator may guarantee the
alignment, but since training is using PyTorch's allocator, which cannot
guarantee that, we need to add the data pointer check before we call any
vectorized kernel.

This PR is to fix such data pointer alignment issue for SkipLayerNorm's
vectorized kernel. We found this issue when running huggingface's swinv2
model. The PR also refactored the code for SkipLayerNorm kernel to make
it simpler.
2023-03-16 15:23:23 +08:00
cloudhan
a5ab88247b
ROCm Flash Attention (#14838)
Adds flash attention via composable kernel for ROCm EP
2023-03-16 10:39:58 +08:00
Yi Zhang
881f3f6be3
[Fix] Error in Linux_Packaging_combined_GPU of nuget packaing pipeline (#15060)
### Description


### Motivation and Context
It caused by the #14958, in the nuget packaging pipeline, it calls
get_docker_image.py directly rather than by get-docker-image-steps.yml.
Considering the difference, one parameter is added for compatibility.


### Test Link

https://dev.azure.com/aiinfra/Lotus/_build/results?buildId=288042&view=logs&j=505ca2b7-596d-550d-8417-9b1519e87977
2023-03-16 08:49:37 +08:00
Hariharan Seshadri
ed7ab1660d
[CUDA] Add option to use DecoderMaskedMultiheadAttention in BeamSearch (#14990) 2023-03-15 17:16:32 -07:00
Yufeng Li
da084b0fc1
check axis range for LayerNorm (#14845)
### Description
<!-- Describe your changes. -->
Add check on axis to make sure it is in a valid range


### 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. -->
2023-03-15 14:44:59 -07:00
Changming Sun
5213546e62
Change how to find npm (#15001) 2023-03-15 11:10:10 -07:00
wejoncy
32533dd1c2 fix 2023-03-15 13:23:56 +08:00
JiCheng
cc15ceef4e Update onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
6bdb03281a clean comments 2023-03-15 13:23:56 +08:00
wejoncy
762ea2402e fix 2023-03-15 13:23:56 +08:00
JiCheng
8db28d9139 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.h
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
8d00961321 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
c10462b5f5 ORT_UNUSED_PARAMETER 2023-03-15 13:23:56 +08:00
wejoncy
92fabf57ea comments 2023-03-15 13:23:56 +08:00
JiCheng
cd3173d531 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
dad772ef09 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
8aeed1e87d amend 2023-03-15 13:23:56 +08:00
wejoncy
5fe61c53a3 comments 2023-03-15 13:23:56 +08:00
JiCheng
d236085845 Update onnxruntime/core/providers/nnapi/nnapi_builtin/model.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
d490908836 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_execution_provider.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
a8ed956fa7 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_execution_provider.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
de5e58c077 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_execution_provider.h
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
d70b5b38e2 amend 2023-03-15 13:23:56 +08:00
wejoncy
fdc970a40d rename constant var 2023-03-15 13:23:56 +08:00
wejoncy
18015f0f55 use span 2023-03-15 13:23:56 +08:00
JiCheng
4ca84ac303 Update onnxruntime/core/providers/nnapi/nnapi_builtin/model.h
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
28a4cfeeef refactor 2023-03-15 13:23:56 +08:00
wejoncy
adfd38edb9 Fail early when getting device 2023-03-15 13:23:56 +08:00
wejoncy
82ae138143 address comments 2023-03-15 13:23:56 +08:00
JiCheng
36aac0036b Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
760a2b99d0 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.h
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
JiCheng
7c6fc31b65 Update onnxruntime/core/providers/nnapi/nnapi_builtin/nnapi_api_helper.cc
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-03-15 13:23:56 +08:00
wejoncy
adf990f30f more docs 2023-03-15 13:23:56 +08:00
wejoncy
028c2372fa remove disable_cpu_soft temporarily 2023-03-15 13:23:56 +08:00
wejoncy
30151323da move init_device to ctor 2023-03-15 13:23:56 +08:00
JiCheng
d135bb7c0c Update nnapi_execution_provider.cc 2023-03-15 13:23:56 +08:00
JiCheng
781e72f663 Update nnapi_api_helper.cc 2023-03-15 13:23:56 +08:00