Skip to content

Commit

Permalink
Allow torch tensors for log_rigid3 (#1769)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs authored Apr 4, 2023
1 parent b9f1380 commit 679e245
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rerun_py/rerun_sdk/rerun/log/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@


def _to_sequence(array: Optional[npt.ArrayLike]) -> Optional[Sequence[float]]:
if isinstance(array, np.ndarray):
return np.require(array, float).tolist() # type: ignore[no-any-return]

return array # type: ignore[return-value]
return np.require(array, float).tolist() # type: ignore[no-any-return]


def _normalize_colors(colors: Optional[Union[Color, Colors]] = None) -> npt.NDArray[np.uint8]:
Expand Down

2 comments on commit 679e245

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: 679e245 Previous: 9310bd7 Ratio
arrow2/size_bytes/primitive/rows=10000/instances=100/array 144980 ns/iter (± 1210) 146399 ns/iter (± 706) 0.99
arrow2/size_bytes/primitive/rows=10000/instances=100/vec 3201 ns/iter (± 74) 3288 ns/iter (± 16) 0.97
arrow2/size_bytes/primitive/rows=10000/instances=100/vec/erased 17278 ns/iter (± 304) 17722 ns/iter (± 7) 0.97
arrow2/size_bytes/struct/rows=10000/instances=100/array 480311 ns/iter (± 6309) 485170 ns/iter (± 3186) 0.99
arrow2/size_bytes/struct/rows=10000/instances=100/vec 3269 ns/iter (± 49) 3294 ns/iter (± 67) 0.99
arrow2/size_bytes/struct/rows=10000/instances=100/vec/erased 17057 ns/iter (± 277) 17724 ns/iter (± 7) 0.96
arrow2/size_bytes/struct_large/rows=10000/instances=100/array 3182631 ns/iter (± 407907) 4564682 ns/iter (± 532516) 0.70
arrow2/size_bytes/struct_large/rows=10000/instances=100/vec 3851 ns/iter (± 81) 3984 ns/iter (± 8) 0.97
arrow2/size_bytes/struct_large/rows=10000/instances=100/vec/erased 17137 ns/iter (± 420) 17724 ns/iter (± 8) 0.97
arrow2/erased_clone/primitive/rows=10000/instances=100/cell/arc_erased 767335 ns/iter (± 13160) 779865 ns/iter (± 1306) 0.98
arrow2/erased_clone/primitive/rows=10000/instances=100/cell/wrapped_in_arc 192920 ns/iter (± 2072) 194109 ns/iter (± 307) 0.99
arrow2/erased_clone/primitive/rows=10000/instances=100/array 733752 ns/iter (± 9685) 745144 ns/iter (± 4025) 0.98
arrow2/erased_clone/primitive/rows=10000/instances=100/array/downcast_first 348329 ns/iter (± 2528) 346032 ns/iter (± 918) 1.01
arrow2/erased_clone/primitive/rows=10000/instances=100/vec/full_copy 1020285 ns/iter (± 140555) 1047521 ns/iter (± 27455) 0.97
arrow2/erased_clone/primitive/rows=10000/instances=100/vec/wrapped_in_arc 125646 ns/iter (± 1738) 127172 ns/iter (± 224) 0.99
arrow2/erased_clone/struct/rows=10000/instances=100/cell/arc_erased 4214547 ns/iter (± 626533) 4477713 ns/iter (± 361999) 0.94
arrow2/erased_clone/struct/rows=10000/instances=100/cell/wrapped_in_arc 283017 ns/iter (± 2518) 286384 ns/iter (± 577) 0.99
arrow2/erased_clone/struct/rows=10000/instances=100/array 4056283 ns/iter (± 82730) 4335741 ns/iter (± 191016) 0.94
arrow2/erased_clone/struct/rows=10000/instances=100/array/downcast_first 3473288 ns/iter (± 58519) 3654403 ns/iter (± 133389) 0.95
arrow2/erased_clone/struct/rows=10000/instances=100/vec/full_copy 1286497 ns/iter (± 186831) 1295272 ns/iter (± 28240) 0.99
arrow2/erased_clone/struct/rows=10000/instances=100/vec/wrapped_in_arc 127572 ns/iter (± 875) 127388 ns/iter (± 121) 1.00
arrow2/erased_clone/struct_large/rows=10000/instances=100/cell/arc_erased 45817191 ns/iter (± 813980) 48198887 ns/iter (± 389003) 0.95
arrow2/erased_clone/struct_large/rows=10000/instances=100/cell/wrapped_in_arc 165241 ns/iter (± 3501) 173625 ns/iter (± 287) 0.95
arrow2/erased_clone/struct_large/rows=10000/instances=100/array 45630719 ns/iter (± 859456) 47988070 ns/iter (± 518205) 0.95
arrow2/erased_clone/struct_large/rows=10000/instances=100/array/downcast_first 44724853 ns/iter (± 1053275) 44718569 ns/iter (± 434818) 1.00
arrow2/erased_clone/struct_large/rows=10000/instances=100/vec/full_copy 4597037 ns/iter (± 249191) 4610544 ns/iter (± 236176) 1.00
arrow2/erased_clone/struct_large/rows=10000/instances=100/vec/wrapped_in_arc 123945 ns/iter (± 2120) 127699 ns/iter (± 86) 0.97
arrow2_convert/serialize/primitive/instances=100000/arrow2_convert 400258 ns/iter (± 5966) 415179 ns/iter (± 9289) 0.96
arrow2_convert/serialize/primitive/instances=100000/arrow2/from_values 18534 ns/iter (± 301) 19220 ns/iter (± 32) 0.96
arrow2_convert/serialize/primitive/instances=100000/arrow2/from_vec 19691 ns/iter (± 220) 19219 ns/iter (± 21) 1.02
arrow2_convert/deserialize/primitive/instances=100000/arrow2_convert 96361 ns/iter (± 2125) 98531 ns/iter (± 279) 0.98
arrow2_convert/deserialize/primitive/instances=100000/arrow2/validity_checks 157690 ns/iter (± 1531) 160421 ns/iter (± 317) 0.98
arrow2_convert/deserialize/primitive/instances=100000/arrow2/validity_bypass 58246 ns/iter (± 225) 58292 ns/iter (± 59) 1.00
datastore/num_rows=1000/num_instances=1000/packed=false/insert/default 9510671 ns/iter (± 324457) 12274385 ns/iter (± 515633) 0.77
datastore/num_rows=1000/num_instances=1000/packed=false/insert/bucketsz=0 11404719 ns/iter (± 352669) 14833800 ns/iter (± 874699) 0.77
datastore/num_rows=1000/num_instances=1000/packed=false/insert/bucketsz=2 10899093 ns/iter (± 624780) 14164695 ns/iter (± 890858) 0.77
datastore/num_rows=1000/num_instances=1000/packed=false/insert/bucketsz=32 9784028 ns/iter (± 865076) 12140770 ns/iter (± 648749) 0.81
datastore/num_rows=1000/num_instances=1000/packed=false/insert/bucketsz=2048 9350538 ns/iter (± 356279) 11171798 ns/iter (± 594932) 0.84
datastore/num_rows=1000/num_instances=1000/packed=true/insert/default 9286325 ns/iter (± 639797) 11055164 ns/iter (± 501466) 0.84
datastore/num_rows=1000/num_instances=1000/packed=true/insert/bucketsz=0 12366963 ns/iter (± 1202142) 13091573 ns/iter (± 593220) 0.94
datastore/num_rows=1000/num_instances=1000/packed=true/insert/bucketsz=2 10905464 ns/iter (± 477890) 12893049 ns/iter (± 601100) 0.85
datastore/num_rows=1000/num_instances=1000/packed=true/insert/bucketsz=32 9553391 ns/iter (± 368295) 11717922 ns/iter (± 605858) 0.82
datastore/num_rows=1000/num_instances=1000/packed=true/insert/bucketsz=2048 9139174 ns/iter (± 391171) 11586324 ns/iter (± 546005) 0.79
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/default 1802 ns/iter (± 35) 1828 ns/iter (± 23) 0.99
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/bucketsz=0 1816 ns/iter (± 13) 1820 ns/iter (± 11) 1.00
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/bucketsz=2 1821 ns/iter (± 16) 1809 ns/iter (± 5) 1.01
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/bucketsz=32 1854 ns/iter (± 19) 1788 ns/iter (± 6) 1.04
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/bucketsz=2048 1845 ns/iter (± 15) 1790 ns/iter (± 11) 1.03
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at/default 1811 ns/iter (± 29) 1853 ns/iter (± 17) 0.98
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at/bucketsz=0 1804 ns/iter (± 3) 1836 ns/iter (± 4) 0.98
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at/bucketsz=2 1796 ns/iter (± 21) 1811 ns/iter (± 3) 0.99
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at/bucketsz=32 1809 ns/iter (± 27) 1823 ns/iter (± 1) 0.99
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at/bucketsz=2048 1793 ns/iter (± 23) 1794 ns/iter (± 0) 1.00
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/default 276 ns/iter (± 4) 280 ns/iter (± 1) 0.99
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/default 433 ns/iter (± 3) 439 ns/iter (± 0) 0.99
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/bucketsz=0 274 ns/iter (± 4) 280 ns/iter (± 0) 0.98
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/bucketsz=0 431 ns/iter (± 6) 442 ns/iter (± 0) 0.98
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/bucketsz=2 276 ns/iter (± 5) 281 ns/iter (± 0) 0.98
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/bucketsz=2 431 ns/iter (± 7) 442 ns/iter (± 0) 0.98
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/bucketsz=32 271 ns/iter (± 3) 280 ns/iter (± 0) 0.97
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/bucketsz=32 423 ns/iter (± 7) 439 ns/iter (± 0) 0.96
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/bucketsz=2048 272 ns/iter (± 4) 280 ns/iter (± 0) 0.97
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/bucketsz=2048 418 ns/iter (± 5) 434 ns/iter (± 1) 0.96
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/primary/default 280 ns/iter (± 3) 281 ns/iter (± 0) 1.00
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/secondaries/default 417 ns/iter (± 6) 439 ns/iter (± 0) 0.95
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/primary/bucketsz=0 273 ns/iter (± 4) 280 ns/iter (± 0) 0.97
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/secondaries/bucketsz=0 434 ns/iter (± 6) 442 ns/iter (± 0) 0.98
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/primary/bucketsz=2 270 ns/iter (± 5) 281 ns/iter (± 0) 0.96
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/secondaries/bucketsz=2 430 ns/iter (± 7) 442 ns/iter (± 0) 0.97
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/primary/bucketsz=32 281 ns/iter (± 0) 280 ns/iter (± 0) 1.00
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/secondaries/bucketsz=32 438 ns/iter (± 12) 439 ns/iter (± 0) 1.00
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/primary/bucketsz=2048 281 ns/iter (± 1) 281 ns/iter (± 0) 1
datastore/num_rows=1000/num_instances=1000/packed=true/latest_at_missing/secondaries/bucketsz=2048 433 ns/iter (± 4) 438 ns/iter (± 0) 0.99
datastore/num_rows=1000/num_instances=1000/packed=false/range/default 9844920 ns/iter (± 986687) 13961222 ns/iter (± 716208) 0.71
datastore/num_rows=1000/num_instances=1000/packed=false/range/bucketsz=0 2210318 ns/iter (± 47993) 2257397 ns/iter (± 55096) 0.98
datastore/num_rows=1000/num_instances=1000/packed=false/range/bucketsz=2 2207888 ns/iter (± 61548) 2270465 ns/iter (± 91341) 0.97
datastore/num_rows=1000/num_instances=1000/packed=false/range/bucketsz=32 1909944 ns/iter (± 150947) 1915579 ns/iter (± 24701) 1.00
datastore/num_rows=1000/num_instances=1000/packed=false/range/bucketsz=2048 1946839 ns/iter (± 145837) 1897215 ns/iter (± 48073) 1.03
datastore/num_rows=1000/num_instances=1000/packed=true/range/default 10935010 ns/iter (± 1238006) 11841810 ns/iter (± 742775) 0.92
datastore/num_rows=1000/num_instances=1000/packed=true/range/bucketsz=0 2134464 ns/iter (± 1109275) 2227597 ns/iter (± 69857) 0.96
datastore/num_rows=1000/num_instances=1000/packed=true/range/bucketsz=2 2100472 ns/iter (± 1140981) 2304404 ns/iter (± 119348) 0.91
datastore/num_rows=1000/num_instances=1000/packed=true/range/bucketsz=32 1808997 ns/iter (± 632529) 1934343 ns/iter (± 42744) 0.94
datastore/num_rows=1000/num_instances=1000/packed=true/range/bucketsz=2048 1783317 ns/iter (± 35715) 1832543 ns/iter (± 28719) 0.97
vector_ops/sort/instances=10000/smallvec/n=4 12076 ns/iter (± 188) 12428 ns/iter (± 35) 0.97
vector_ops/sort/instances=10000/tinyvec/n=4 9336 ns/iter (± 188) 9653 ns/iter (± 22) 0.97
vector_ops/sort/instances=10000/vec 9466 ns/iter (± 225) 9660 ns/iter (± 21) 0.98
vector_ops/split_off/instances=10000/smallvec/n=4/manual 5475 ns/iter (± 94) 5562 ns/iter (± 13) 0.98
vector_ops/split_off/instances=10000/tinyvec/n=4 2739 ns/iter (± 91) 2727 ns/iter (± 35) 1.00
vector_ops/split_off/instances=10000/tinyvec/n=4/manual 2746 ns/iter (± 205) 2745 ns/iter (± 16) 1.00
vector_ops/split_off/instances=10000/vec 2722 ns/iter (± 48) 2736 ns/iter (± 23) 0.99
vector_ops/split_off/instances=10000/vec/manual 2673 ns/iter (± 61) 2742 ns/iter (± 23) 0.97
vector_ops/swap/instances=10000/smallvec/n=4 32489 ns/iter (± 888) 32767 ns/iter (± 41) 0.99
vector_ops/swap/instances=10000/tinyvec/n=4 18256 ns/iter (± 338) 18303 ns/iter (± 16) 1.00
vector_ops/swap/instances=10000/vec 12314 ns/iter (± 107) 12308 ns/iter (± 13) 1.00
vector_ops/swap_opt/instances=10000/smallvec/n=4 42640 ns/iter (± 411) 42672 ns/iter (± 21) 1.00
vector_ops/swap_opt/instances=10000/tinyvec/n=4 28530 ns/iter (± 391) 28775 ns/iter (± 35) 0.99
vector_ops/swap_opt/instances=10000/vec 20160 ns/iter (± 375) 19787 ns/iter (± 36) 1.02
mono_points_arrow/generate_message_bundles 41779491 ns/iter (± 6391444) 44372115 ns/iter (± 669061) 0.94
mono_points_arrow/generate_messages 132007868 ns/iter (± 27797618) 134011405 ns/iter (± 1099244) 0.99
mono_points_arrow/encode_log_msg 176841355 ns/iter (± 33059725) 180489250 ns/iter (± 2330181) 0.98
mono_points_arrow/encode_total 352279676 ns/iter (± 53152618) 357357347 ns/iter (± 2299816) 0.99
mono_points_arrow/decode_log_msg 213509916 ns/iter (± 28707764) 212330777 ns/iter (± 776683) 1.01
mono_points_arrow/decode_message_bundles 70571683 ns/iter (± 16213593) 71767040 ns/iter (± 686274) 0.98
mono_points_arrow/decode_total 273615946 ns/iter (± 41406841) 283068843 ns/iter (± 1325588) 0.97
mono_points_arrow_batched/generate_message_bundles 31940268 ns/iter (± 8350507) 34595113 ns/iter (± 1689003) 0.92
mono_points_arrow_batched/generate_messages 6045203 ns/iter (± 3704275) 6826677 ns/iter (± 574841) 0.89
mono_points_arrow_batched/encode_log_msg 1551118 ns/iter (± 490045) 1556589 ns/iter (± 8327) 1.00
mono_points_arrow_batched/encode_total 52994196 ns/iter (± 4196749) 44855821 ns/iter (± 1419933) 1.18
mono_points_arrow_batched/decode_log_msg 911913 ns/iter (± 19749) 858042 ns/iter (± 2234) 1.06
mono_points_arrow_batched/decode_message_bundles 10979691 ns/iter (± 3813680) 11020570 ns/iter (± 432739) 1.00
mono_points_arrow_batched/decode_total 11399590 ns/iter (± 2440199) 12819178 ns/iter (± 637428) 0.89
batch_points_arrow/generate_message_bundles 291389 ns/iter (± 14042) 297772 ns/iter (± 876) 0.98
batch_points_arrow/generate_messages 5675 ns/iter (± 152) 5738 ns/iter (± 10) 0.99
batch_points_arrow/encode_log_msg 362829 ns/iter (± 6188) 374970 ns/iter (± 1181) 0.97
batch_points_arrow/encode_total 677278 ns/iter (± 67671) 697789 ns/iter (± 2789) 0.97
batch_points_arrow/decode_log_msg 335090 ns/iter (± 76016) 352438 ns/iter (± 850) 0.95
batch_points_arrow/decode_message_bundles 2183 ns/iter (± 29) 2202 ns/iter (± 7) 0.99
batch_points_arrow/decode_total 341184 ns/iter (± 40597) 364184 ns/iter (± 1594) 0.94
arrow_mono_points/insert 6407020500 ns/iter (± 281484887) 6065899456 ns/iter (± 14048132) 1.06
arrow_mono_points/query 1743920 ns/iter (± 134911) 1839528 ns/iter (± 13522) 0.95
arrow_batch_points/insert 5206031 ns/iter (± 1121363) 3074367 ns/iter (± 22951) 1.69
arrow_batch_points/query 15880 ns/iter (± 254) 16400 ns/iter (± 37) 0.97
arrow_batch_vecs/insert 41775 ns/iter (± 1761) 43219 ns/iter (± 168) 0.97
arrow_batch_vecs/query 501330 ns/iter (± 12293) 506037 ns/iter (± 1809) 0.99
tuid/Tuid::random 36 ns/iter (± 0) 40 ns/iter (± 0) 0.90

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 679e245 Previous: 9310bd7 Ratio
arrow_batch_points/insert 5206031 ns/iter (± 1121363) 3074367 ns/iter (± 22951) 1.69

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.