Commit 02f4882
authored
[FFI] Re-introduce the boxed primitive values (#17257)
* Revert "Revert "[FFI][RUNTIME] Introduce runtime boxed types for int/float/bool" (#17252)"
This reverts commit 11be832.
* [FFI] Re-introduce the boxed primitive values
Initially introduced in #16183,
these changes were reverted in
#17252 due to performance
degredation in some Relax models. This could occur when a model
contained a large number of calls to `"vm.builtin.tuple_getitem"`,
which may occur when model weights are provided as a tuple.
This PR re-applies the changes from
#16183, but with the performance
degredation resolved. The root cause was unnecessary type-checking
when converting from an untyped `tvm::ArrayNode*` to the typed
`tvm::Array<T>`, in the case where `T` is `ObjectRef`.
* Correct typo from T to U1 parent b3d01c2 commit 02f4882
File tree
184 files changed
+3278
-1225
lines changed- include/tvm
- ir
- meta_schedule
- relay/attrs
- runtime
- container
- target
- tir
- schedule
- python/tvm
- _ffi
- _ctypes
- _cython
- driver/tvmc
- ir
- meta_schedule
- relax
- op
- testing
- training
- relay
- backend/contrib/ethosu
- op
- contrib
- transform
- runtime
- script/parser/tir
- te
- hybrid
- tir
- schedule
- topi
- arm_cpu
- cuda
- rust
- tvm-rt/src
- tvm-sys/src
- src
- auto_scheduler
- search_policy
- contrib/msc/core
- printer
- driver
- ir
- meta_schedule
- database
- mutator
- schedule_rule
- schedule/cuda
- node
- relax
- backend/vm
- op/tensor
- relay
- backend
- contrib
- cmsisnn
- cutlass
- ethosn
- ethosu
- example_target_hooks
- tensorrt
- uma
- ir
- op
- tensor
- transforms
- runtime
- crt/common
- disco
- minrpc
- relax_vm
- script/printer
- doc_printer
- ir
- relax
- support
- target
- llvm
- te
- operation
- schedule
- tir
- analysis
- ir
- op
- schedule
- primitive
- transforms
- tests
- cpp
- relay/backend
- python
- all-platform-minimal-test
- arith
- codegen
- ir
- relax
- distributed
- relay
- runtime
- te
- tir-base
- tir-schedule
- tir-transform
- tvmscript
- vta/python/vta
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
184 files changed
+3278
-1225
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| |||
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
318 | 367 | | |
319 | 368 | | |
320 | 369 | | |
| |||
347 | 396 | | |
348 | 397 | | |
349 | 398 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 399 | + | |
| 400 | + | |
356 | 401 | | |
357 | 402 | | |
358 | 403 | | |
| |||
371 | 416 | | |
372 | 417 | | |
373 | 418 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
381 | 422 | | |
382 | 423 | | |
383 | 424 | | |
| |||
412 | 453 | | |
413 | 454 | | |
414 | 455 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
419 | 459 | | |
420 | 460 | | |
421 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
774 | 783 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
789 | 798 | | |
| 799 | + | |
790 | 800 | | |
791 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
792 | 808 | | |
793 | 809 | | |
794 | 810 | | |
795 | 811 | | |
796 | 812 | | |
797 | | - | |
798 | | - | |
799 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
800 | 819 | | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | 820 | | |
806 | 821 | | |
807 | 822 | | |
808 | 823 | | |
809 | 824 | | |
810 | | - | |
811 | | - | |
812 | | - | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
813 | 845 | | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
818 | 887 | | |
819 | | - | |
820 | 888 | | |
821 | 889 | | |
822 | 890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
275 | 304 | | |
276 | 305 | | |
277 | 306 | | |
| |||
285 | 314 | | |
286 | 315 | | |
287 | 316 | | |
288 | | - | |
| 317 | + | |
| 318 | + | |
289 | 319 | | |
290 | 320 | | |
291 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
193 | | - | |
| 195 | + | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| |||
0 commit comments