Commit 2f4be9a
authored
Add check that tensor sizes match in DataTransferManager::CopyTensors (#27008)
### Description
<!-- Describe your changes. -->
Add check that tensor sizes match in DataTransferManager::CopyTensors
before calling the IDataTransfer implementation so that the check is
done in one place.
We check the sizes match in DataTransferManager::CopyTensor[Async] so
this makes things consistent when a batched copy is done.
It is not required for DataTransferManager::CopySparseTensors. The
default implementation of IDataTransfer::CopySparseTensors is not
overridden by any EP so all sparse tensor copies (single or batched) end
up going via SparseTensor::Copy which has size checks.
### 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. -->
TRT RTX had a bug and was returning an output value that was an
incorrect size. When pre-allocated outputs on a different device were
provided we hit DataTransferManager::CopyTensors which had no check the
sizes matched, leading to a heap checker violation.1 parent a3e477e commit 2f4be9a
File tree
2 files changed
+66
-27
lines changed- onnxruntime
- core/framework
- test/framework
2 files changed
+66
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
59 | 58 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 59 | + | |
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
| |||
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
78 | | - | |
79 | | - | |
| 75 | + | |
80 | 76 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 77 | + | |
84 | 78 | | |
85 | 79 | | |
86 | 80 | | |
| |||
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
100 | | - | |
101 | | - | |
| 94 | + | |
102 | 95 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 96 | + | |
106 | 97 | | |
107 | 98 | | |
108 | 99 | | |
| |||
130 | 121 | | |
131 | 122 | | |
132 | 123 | | |
133 | | - | |
134 | | - | |
| 124 | + | |
135 | 125 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
| |||
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
151 | | - | |
| 147 | + | |
| 148 | + | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
155 | | - | |
| 152 | + | |
| 153 | + | |
156 | 154 | | |
157 | 155 | | |
158 | 156 | | |
| |||
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | | - | |
187 | | - | |
| 184 | + | |
188 | 185 | | |
189 | | - | |
190 | | - | |
191 | | - | |
| 186 | + | |
192 | 187 | | |
193 | 188 | | |
194 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments