Commit graph

11997 commits

Author SHA1 Message Date
mindest
1fa219d7d5
DecoderMaskedMultiHeadAttention CPU kernel. (#22292)
### Description
DecoderMaskedMultiHeadAttention CPU kernel.
2024-10-12 13:43:00 -07:00
George Wu
332173509d
fixups for doxygen. add c++ wrapper for setEpDynamicOptions (#22416)
follow up to https://github.com/microsoft/onnxruntime/pull/22282

replaces https://github.com/microsoft/onnxruntime/pull/22388
2024-10-11 21:59:33 -07:00
kunal-vaishnavi
18e81f8785
Fix Whisper export for FP16 CUDA (#22410)
### Description
This PR fixes a bug when the ONNX checker is called while exporting
Whisper for FP16 CUDA with optional flags.

### Motivation and Context
Sometimes, the ONNX checker raises an error depending on the optional
flags passed. By wrapping the ONNX checker in a try-except, the
conversion can continue even if the checker fails.
2024-10-11 17:37:36 -07:00
Ted Themistokleous
572e43c5d7
[MIGraphX EP/ ROCm EP] add gfx1200, gfx1201 to CMAKE_HIP_ARCHITECTURES (#22348)
### Description
Add additonal gfx targets for AMD GPU support


### Motivation and Context
Required to integrate mainline onnxruntime support for AMD GPUs

---------

Co-authored-by: Stefan Sokolovic <stsokolo@amd.com>
Co-authored-by: Jeff Daily <jeff.daily@amd.com>
2024-10-11 17:31:36 -07:00
Edward Chen
d7367653ab
Remove clean_docker_image_cache.py and clean-build-docker-image-cache-pipeline.yml. (#22409)
Clean up old script and build definition.
2024-10-11 14:25:13 -07:00
anujj
23d48ea647
Add TensorRT-Model-Optimizer INT4 AWQ support in onnxruntime tools (#22390)
[TensorRT-Model-Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer)
have a implementation for INT4 AWQ. Adding the support in onnxruntime
tools to quantized the models with TensorRT-Model-Optimizer
2024-10-11 13:31:54 -07:00
Kyle
cdebf37105
Add Digital Signature to DLLs in Maven Build (#22401)
### Description
* Add digital signature to dll files in jar files.
* Jar file names: onnxruntime-{version}.jar,
onnxruntime_gpu-{version}.jar

### Motivation and Context
#19204
2024-10-11 12:14:03 -07:00
mindest
d1627d2c7f
[ROCm] Register op kernel for Sqrt BFloat16 (#22404)
### Description
ROCm CI fails since adding test for BFloat16, Sqrt op (introduced in
#22068).
2024-10-11 11:02:40 -07:00
Justin Chu
64007ffb79
Create suggestions to autofix files (#22115) 2024-10-11 10:52:19 -07:00
mindest
3c80aa9fee
Add CPU kernels for DynamicTimeWarping and UnfoldTensor. (#22033)
### Description
Add CPU kernels for DynamicTimeWarping and UnfoldTensor.
2024-10-11 09:44:18 -07:00
Dmitri Smirnov
f1f3d94e2d
Accomodate BE platforms. Make sure we always write flatbuffers LE (#22375)
### Description
<!-- Describe your changes. -->
flatbuffers always write data in LE and it is automatically traslated
to/from BE as needed,
but only if we use proper accessors. This would work for shape.
However, we store parameters as bytes, so we need to swap bytes as
needed for BE.

### Motivation and Context
Address https://github.com/microsoft/onnxruntime/issues/22364
2024-10-11 09:14:44 -07:00
sheetalarkadam
c06ecd415c
RC releases to Maven for Android (#22391)
### Description
Aallows alpha, beta and rc version releases to Maven for Android
artifacts.



### Motivation and Context
Helpful to release rc versions or test artifacts to Maven for testing.
For example, a new QNN android package is being released and it will be
nice to test the RC version for dependencies before release

## Future Work
Allow RC version for all Maven artifacts.
2024-10-11 08:58:02 -07:00
Changming Sun
6ada97c84c
Fix a build issue when statically link to MSVC Runtime (#22393)
Yesterday I updated ABSL to a newer version which added a new cmake
option: ABSL_MSVC_STATIC_RUNTIME . I wasn't aware of it. This PR fixes
it.
2024-10-10 20:09:13 -07:00
Indy Zhu
b4fb32d80d
Pick changes from onnx/onnx#6010 to support EinSum shape inference (#22376)
### Description
<!-- Describe your changes. -->
Pick up onnx/onnx#6010 to support EinSum shape inference


### 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 change allows EinSum operator's output shape to be inferenced so
that it can run on accelerators.
2024-10-10 13:24:08 -07:00
sheetalarkadam
dd2ea8469e
Add qnn android package (#22296)
### Description
Pre built QNN Android package


### Future Work
1. Setting up CI with Browserstack- onnxruntime_tests and Android test
2. ESRP Release to Maven
2024-10-10 10:37:22 -07:00
Kevin Chen
709368ea14
Remove deprecation warnings for TensorRT 10.5 builds (#22374)
### Description
In TensorRT 10.5, the APIs `platformHasFastFp16` and
`platformHasFastInt8` have been deprecated.

Ignore these deprecation warnings.

Signed-off-by: Kevin Chen <kevinch@nvidia.com>
2024-10-10 08:49:10 -07:00
Tianlei Wu
2584d02c5e
Fix SAM2 benchmark script on cuda graph (#22377)
### Description
Update segment anything 2 benchmark script:
(1) Fix cuda graph in benchmark. Make sure --use_cuda_graph takes effect
and random_inputs() generates according to the dtype of the model.
(2) Add a parameter to enable profiling.
(3) Use latest cuda 12.6.2 and cudnn 9.5.
(4) Update README.md.

### Motivation and Context
Previous, --use_cuda_graph does not take effect. This fixes the
benchmark.
2024-10-10 08:46:44 -07:00
Luis E. P.
1bc546af61
Add SetEpDynamicOptions and remove workload_type from run/session options (#22282)
### Description
Add SetEpDynamicOptions and Remove workload_type from run/session
options.

### Motivation and Context
Added SetEpDynamicOptions as a dynamic way of changing EP settings even
in the middle of a Run
Using workload_type run/session options to set Efficient/Default mode
for workloads does not cover all the scenarios and can lead to priority
inversions. Working on a new API to support setting Efficient/Default
mode for workloads.

---------

Co-authored-by: Luis E. Pena <luispena@microsoft.com>
2024-10-09 22:54:22 -07:00
Changming Sun
2bef89c171
Upgrade absl to the latest released version (#22365)
### Description
Resolve #21976 .  
 
ABSL generally does not have forward/backward compatibility. Our code is
only compatible with one fixed LTS version. So it's important to fix the
version number there when using find_package to detect an installed
version.
2024-10-09 20:21:40 -07:00
Changming Sun
dcf1e0c3b0
Re-enable CUDA 12 python package test pipeline (#22370)
### Description
It runs after "Python-CUDA-Packaging-Pipeline" that runs on a CPU
machine that skipped all tests.
This testing pipeline is for doing the tests.
2024-10-09 20:21:27 -07:00
Yi Zhang
25b1c38e87
Add conv fp16 kernel in xnnpack EP (#22301)
### Description
Add FP16 kernels of Conv and ConvTranspose

[AB#50186](https://aiinfra.visualstudio.com/6a833879-cd9b-44a4-a9de-adc2d818f13c/_workitems/edit/50186)



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

---------
2024-10-10 08:48:09 +08:00
Tianlei Wu
2b0ea6c834
Fix security warning: use sha256 instead of md5 (#22373)
### Description

Fix S360 warning: Use of unapproved hash algorithm or API MD5.
2024-10-09 17:24:46 -07:00
Tianlei Wu
5cc2529379
Fix EmbedLayerNormalization fusion related to LayerNormalization optional input (#22371)
This fixes a bug found by libfuzzer: 

LayerNormalization third input (beta) is optional. The following code
has potential out of bound access if the input is not available:
```
NodeArg* beta = layer_norm_node.MutableInputDefs()[2];
```

This adds a check to ensure the third input exists before fusion.

[AB#49036](https://aiinfra.visualstudio.com/6a833879-cd9b-44a4-a9de-adc2d818f13c/_workitems/edit/49036)
2024-10-09 17:24:21 -07:00
Tianlei Wu
071b607807
[CUDA] Add CUDA_VERSION and CUDNN_VERSION etc. arguments to Dockerfile.cuda (#22351)
### Description

* Add a few arguments CUDA_VERSION, CUDNN_VERSION, OS, GIT_COMMIT,
GIT_BRANCH and ONNXRUNTIME_VERSION to the Dockerfile.cuda to allow for
more flexibility in the build process.
* Update README.md to include the new arguments and their usage.
* Output labels to image so that it is easy to inspect the image. 

Available CUDA versions for ubuntu 24.04 can be found
[here](https://hub.docker.com/r/nvidia/cuda/tags), and available CUDNN
versions can be found
[here](https://pypi.org/project/nvidia-cudnn-cu12/#history). Example
command line to build docker image:
```
  docker build -t onnxruntime-cuda --build-arg CUDA_VERSION=12.6.1 \
                                   --build-arg CUDNN_VERSION=9.5.0.50 \
                                   --build-arg GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
                                   --build-arg GIT_COMMIT=$(git rev-parse HEAD) \
                                   --build-arg ONNXRUNTIME_VERSION=$(cat ../VERSION_NUMBER) \
                                   -f Dockerfile.cuda ..
```

Example labels from `docker inspect onnxruntime-cuda`:
```
            "Labels": {
                "CUDA_VERSION": "12.6.1",
                "CUDNN_VERSION": "9.5.0.50",
                "maintainer": "Changming Sun <chasun@microsoft.com>",
                "onnxruntime_git_branch": "main",
                "onnxruntime_git_commit": "bc84958dcef5c6017ae58085f55b669efd74f4a5",
                "onnxruntime_version": "1.20.0",
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.version": "24.04"
            }
```

### Motivation and Context
https://github.com/microsoft/onnxruntime/pull/22339 has hard-coded the
cuda and cudnn versions. User might want to choose specified cuda and
cudnn version during building docker image.
2024-10-09 12:06:33 -07:00
Hector Li
3b00024b55
Fix the QNN nuget package issue (#22358)
Fix the QNN nuget package issue

### Description
Inside the package, folder name \runtimes\win-arm64\ was changed to \runtimes\win-ARM64\, which breaks lib copy settings in Microsoft.ML.OnnxRuntime.QNN.props.


### Motivation and Context
Fix issue: https://github.com/microsoft/onnxruntime/issues/21692
2024-10-09 08:41:23 -07:00
Changming Sun
9ee963110e
Update manylinux version (#22355)
### Description
Update the commit from 59600894a2c1c18290944b83e989bfe618975230 to
1887322ed36d522409a6b805d4e7942cf76a8e40


### Motivation and Context
The new one has python 3.13.

AB#50959
2024-10-08 23:11:11 -07:00
Pranav Sharma
c415991c16
Revert "ThreadPool: Spend less time busy waiting. (#21545)" (#22350)
This reverts commit 4e15b229a0.

Reason: We are seeing an increase in the number of deadlocks after this
PR. We have a release coming up next week and do not have enough time to
investigate the root cause, hence reverting this PR temporarily.
Moreover, this is causing an increase int he binary size.

### Description
We are seeing an [increase in the number of
deadlocks](https://github.com/microsoft/onnxruntime/pull/22315#issuecomment-2394821893)
after this PR. We have a release coming up next week and do not have
enough time to investigate the root cause, hence reverting this PR
temporarily.

### Motivation and Context
See above.
2024-10-08 17:50:26 -07:00
Yulong Wang
c5d28cac4d
Initial WebGPU EP checkin (#22318)
### Description

This change introduces the WebGPU EP into ONNX Runtime.

To make the PR as simple as possible, this PR excluded the following:
- C API changes for WebGPU EP
- actual implementation of WebGPU EP. Currently in this PR, WebGPU is a
stub implementation that does not register any kernel.
- Python IO Binding update
- Node.js IO Binding update

This PR now contains only 43 file changes (while the working branch
contains 130+) and hopefully this makes it easier to review.

There is going to be separated PRs for each mentioned above.

Current working branch: #21904
2024-10-08 16:10:46 -07:00
Edward Chen
bc84958dce
Remove duplicate fp32_bits definition. (#22340)
Remove duplicate fp32_bits definition in onnxruntime/core/mlas/lib/cast.cpp
2024-10-08 11:57:00 -07:00
Tianlei Wu
8595e56d8e
[CUDA] Update Docker to use Ubuntu 24.04, cuda 12.6, cudnn 9.4 and python 3.12 (#22339)
### Description
Serve as example to build and run onnxruntime-gpu with latest software
stack.

To build docker image:
```
git clone https://github.com/microsoft/onnxruntime
cd onnxruntime/dockerfiles
docker build -t onnxruntime-cuda -f Dockerfile.cuda ..
```

To launch the docker image built from previous step (and mount the code
directory to run a unit test below):
```
cd ..
docker run --rm -it --gpus all -v $PWD:/code onnxruntime-cuda /bin/bash
```

Then run the following in docker image to verify that the cuda provider
is good:
```
python /code/onnxruntime/test/python/onnxruntime_test_python_cudagraph.py
```

### Motivation and Context
https://github.com/microsoft/onnxruntime/issues/22335
2024-10-08 09:54:46 -07:00
Changming Sun
d98340968e
Stop publishing python 3.8/3.9 packages (#22343)
### Description
1. Stop publishing python 3.8/3.9 packages, to align with numpy. 
2. Add a trigger for CUDA12's python test pipeline.
2024-10-08 09:50:05 -07:00
aciddelgado
cc0193cd42
Fix Memory Issue GQA CPU Rotary (#22290)
### Description
In GQA there was a memory issue which was best described by @edgchen1
[here](https://github.com/microsoft/onnxruntime/issues/22252#issuecomment-2384559255)

> here's the problematic code:
> 
>
d9de054eb5/onnxruntime/contrib_ops/cpu/bert/group_query_attention.cc (L149-L157)
> 
> annotated:
> 
> ```c++
>     if (packed_qkv) {
>       // Q is an OrtValue declared in the enclosing scope.
>       OrtValue RotaryQKV;
> Tensor::InitOrtValue(element_type, TensorShape({batch_size, num_heads_
+ 2 * kv_num_heads_, sequence_length, head_size}), allocator,
RotaryQKV);
>       // Save pointer to Q's data in q_input.
>       q_input = Q.Get<Tensor>().Data<T>();
>       k_input = q_input + num_heads_ * sequence_length * head_size;
>       q_rotary = RotaryQKV.GetMutable<Tensor>()->MutableData<T>();
>       k_rotary = q_rotary + num_heads_ * sequence_length * head_size;
> // Overwrite Q with RotaryQKV (OrtValues contain shared_ptr to
contained value).
>       // Now, q_input is pointing to freed memory.
>       Q = RotaryQKV;
>     }
> ```
> 
> later on, when we use `q_input`, there is a read access violation.
> 
>
d9de054eb5/onnxruntime/contrib_ops/cpu/bert/group_query_attention.cc (L170-L172)
> 
> this problem showed up when CPU allocator sharing between sessions was
enabled. in that case, the CPU allocator's arena was disabled. I suspect
that the default usage of the arena hid this issue.
> 
> though I debugged into the first branch, this appears to be a problem
in both branches:
> 
>
d9de054eb5/onnxruntime/contrib_ops/cpu/bert/group_query_attention.cc (L149-L168)





### Motivation and Context
Fixes a crucial bug. The issue was found here
https://github.com/microsoft/onnxruntime/issues/22252
2024-10-08 09:22:05 -07:00
stsokolo
efb8703a25
[MIGraphX EP Support]Add rocm to transformers/benchmark.py script (#22299)
### Description
Add ROCm EP option to benchmark.py script when using int8 quantization.



### 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. -->
Without this change benchmarks with int8 quantization cannot be run with
ROCm execution provider.
2024-10-07 21:57:18 -07:00
Xavier Dupré
407c1ab2e2
Fix conversion of TensorData, TensorsData to json (#22166)
### Description
Fix write_calibration_table to support TensorData, TensorsData
2024-10-06 19:13:03 -07:00
Scott McKay
280c013d67
Fix warning when building on Windows (#22327)
### Description
<!-- Describe your changes. -->
Specify type to fix warning


### 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. -->
2024-10-06 15:51:58 +10:00
jingyanwangms
5036e63d58
Increanse TensorRT tolerance from default 1e-5 to 1e-3 after TRT 10.4 (#22321)
### Description
Increanse TensorRT tolerance from default 1e-5 to 1e-3 after TRT 10.4

### 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. -->
2024-10-05 18:06:06 +10:00
mingmingtasd
004bd36f3d
[WebNN EP] Support Tile operator (#22148)
PTAL, thanks! @Honry , @fdwr thanks!
2024-10-05 00:56:55 -07:00
chenduan-amd
98a75900ef
[VitisAI]Add interface to get configurations from Sessionoption (#22096)
### Description
Add interface to get config_options from onnxruntime.



### Motivation and Context
to support config session_options after EP Append, So need get
configurations on ep end.
2024-10-05 00:12:44 -07:00
Wanming Lin
39c8b3759f
[JS/WebGPU] Fixed bugs in inputs validation of Resize (#21955)
- 'scales' and 'sizes' may be empty tensor, make sure it's 1D tensor and
non-empty
- Make sure 'scales' and 'sizes' if present its length is non-zero
2024-10-04 18:29:53 -07:00
Tianlei Wu
b5ef85555a
Support onnx data types (bfloat16, float8) in python I/O binding APIs (#22306)
### Description
(1) Support onnx data types in python APIs:
* IOBinding.bind_input
* IOBinding.bind_output
* ortvalue_from_shape_and_type

(2) Add unit tests, which serves an example of running BFloat16 or
Float8 models in Python.

Other minor changes:
(3) replace deprecated NP_TYPE_TO_TENSOR_TYPE by helper API.
(4) Rename ortvalue_from_numpy_with_onnxtype to
ortvalue_from_numpy_with_onnx_type.

The integer of onnx element type can be found in
(https://onnx.ai/onnx/api/mapping.html). Note that FLOAT4E2M1 is not
supported yet.

### Motivation and Context

Current python API does not support Bfloat16 and float8 (FLOAT8E4M3FN,
FLOAT8E4M3FNUZ, FLOAT8E5M2, FLOAT8E5M2FNUZ) types, and other new data
types like INT4, UInt4 etc.

This removes the limitation.

https://github.com/microsoft/onnxruntime/issues/13001
https://github.com/microsoft/onnxruntime/issues/20481
https://github.com/microsoft/onnxruntime/issues/20578
2024-10-04 17:29:15 -07:00
Dmitri Smirnov
96a1ce1c04
[C#] Address Packaging pipeline failure (#22307)
### Description
Add new test data copy to 2 more test projects.
2024-10-04 17:28:09 -07:00
Dmitri Smirnov
9f3676bc31
Address leftover comments for Lora support (#22322)
### Description
Address comments


### Motivation and Context
Re: https://github.com/microsoft/onnxruntime/pull/22046
2024-10-04 16:43:26 -07:00
Dmitri Smirnov
0645ad19a4
[PyBind] Expose enable_mem_arena property for SessionOptions (#22323)
### Description
Expose enable_mem_arena property for SessionOptions

### Motivation and Context
https://github.com/microsoft/onnxruntime/issues/22271
2024-10-04 16:43:15 -07:00
Changming Sun
715b74d61a
Re-enable codesign for maven packages (#22308)
### Description
PR #22217 was reverted.  This PR re-enables it.


### Motivation and Context
2024-10-04 14:30:17 -07:00
Tianlei Wu
f3f33bfa05
Upgrade cutlass to 3.5.1 and cudnn frontend to 1.7.0 (#22316)
### Description
Upgrade cutlass to 3.5.1
Upgrade cudnn_frontend to 1.7.0
2024-10-04 11:48:50 -07:00
Changming Sun
f25f3868a7
Auto regenerate LORA's fbs files (#22313)
### Description

A left-over of PR #22046 

### Motivation and Context
Right now our VCPKG pipelines are broken.
2024-10-04 10:01:19 -07:00
Edward Chen
1df215e9bb
Update arena creation check in Environment::CreateAndRegisterAllocator() to check for 32-bit builds instead of non-x86_64 builds. (#22304) 2024-10-04 09:03:16 -07:00
jingyanwangms
bb0c1f0a05
Update cuda version in release pipeline (#22305)
### Description
With TensorRT 10.4 update, the name of TensorRT windows package changed


### 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. -->
2024-10-03 22:28:28 -07:00
Ranjit Ranjan
d0ddfa9b9e
[AIX] build fix for using system install protobuf/onnx (#22302)
### Description
Fixing merge issue occurred in
https://github.com/microsoft/onnxruntime/pull/22272

### Motivation and Context
To build onnxruntime using system installed protobuf/onnx.
2024-10-03 19:29:42 -07:00
Jing Fang
a80bf8d158
Reduce matmulnbits UT time (#22303)
### Description
Flatten MatMulNbits UT and reduce unnecessary loops.



### Motivation and Context
Reduce matmulnbits UT time
2024-10-03 16:24:56 -07:00