Repository navigation
Commit ed97214
authored
[ET-VK][ez] Add padded_numel_ member to vTensor for shader bounds checking (pytorch#16856)
Introduce a new padded_numel_ member to the vTensor class that stores the total number of elements based on padded sizes (before packing). This value is useful for bounds checking in shader code, as it represents the logical size of the padded tensor before any int8 packing is applied. The padded_numel_ is computed as utils::multiply_integers(padded_sizes_) and is maintained alongside numel_ (based on original sizes) and physical_numel_ (after packing). Also adds corresponding accessor functions padded_sizes_of() and padded_numel_of() to ComputeGraph for convenient access to these values from ValueRefs.
Differential Revision: [D91281383](https://our.internmc.facebook.com/intern/diff/D91281383/)1 parent 46afcfa commit ed97214
4 files changed
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| 712 | + | |
712 | 713 | | |
713 | 714 | | |
714 | 715 | | |
| |||
761 | 762 | | |
762 | 763 | | |
763 | 764 | | |
| 765 | + | |
764 | 766 | | |
765 | 767 | | |
766 | 768 | | |
| |||
793 | 795 | | |
794 | 796 | | |
795 | 797 | | |
| 798 | + | |
796 | 799 | | |
797 | 800 | | |
798 | 801 | | |
| |||
817 | 820 | | |
818 | 821 | | |
819 | 822 | | |
| 823 | + | |
820 | 824 | | |
821 | 825 | | |
822 | 826 | | |
| |||
1076 | 1080 | | |
1077 | 1081 | | |
1078 | 1082 | | |
1079 | | - | |
| 1083 | + | |
1080 | 1084 | | |
1081 | 1085 | | |
1082 | 1086 | | |
| |||
1139 | 1143 | | |
1140 | 1144 | | |
1141 | 1145 | | |
| 1146 | + | |
1142 | 1147 | | |
1143 | 1148 | | |
1144 | 1149 | | |
| |||
1150 | 1155 | | |
1151 | 1156 | | |
1152 | 1157 | | |
1153 | | - | |
| 1158 | + | |
1154 | 1159 | | |
1155 | 1160 | | |
1156 | 1161 | | |
| |||
1173 | 1178 | | |
1174 | 1179 | | |
1175 | 1180 | | |
1176 | | - | |
| 1181 | + | |
1177 | 1182 | | |
1178 | 1183 | | |
1179 | 1184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| |||
508 | 511 | | |
509 | 512 | | |
510 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
511 | 518 | | |
512 | 519 | | |
513 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
358 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
| |||
0 commit comments