Commit f81e366
authored
[Data] [stats] Add RefBundle retrieval time metric to iterator dataset stats (#58422)
## Why These Changes Are Needed
This PR adds a new metric to track the time spent retrieving `RefBundle`
objects during dataset iteration. This metric provides better visibility
into the performance breakdown of batch iteration, specifically
capturing the time spent in `get_next_ref_bundle()` calls within the
`prefetch_batches_locally` function.
## Related Issue Number
N/A
## Example
```
dataloader/train = {'producer_throughput': 8361.841782656593, 'iter_stats': {'prefetch_block-avg': inf, 'prefetch_block-min': inf, 'prefetch_block-max': 0, 'prefetch_block-total': 0, 'get_ref_bundles-avg': 0.05172277254545271, 'get_ref_bundles-min': 1.1991999997462699e-05, 'get_ref_bundles-max': 11.057470971999976, 'get_ref_bundles-total': 15.361663445999454, 'fetch_block-avg': 0.31572694455743233, 'fetch_block-min': 0.0006362799999806157, 'fetch_block-max': 2.1665870369999993, 'fetch_block-total': 93.45517558899996, 'block_to_batch-avg': 0.001048687573988573, 'block_to_batch-min': 2.10620000302697e-05, 'block_to_batch-max': 0.049948245999985375, 'block_to_batch-total': 2.048086831999683, 'format_batch-avg': 0.0001013781433686053, 'format_batch-min': 1.415700000961806e-05, 'format_batch-max': 0.009682661999988795, 'format_batch-total': 0.19799151399888615, 'collate-avg': 0.01303446213312943, 'collate-min': 0.00025646699998560507, 'collate-max': 0.9855495820000328, 'collate-total': 25.456304546001775, 'finalize-avg': 0.012211385266257683, 'finalize-min': 0.004209667999987232, 'finalize-max': 0.3785081949999949, 'finalize-total': 23.848835425001255, 'time_spent_blocked-avg': 0.04783407008137157, 'time_spent_blocked-min': 1.2316999971062614e-05, 'time_spent_blocked-max': 12.46102861700001, 'time_spent_blocked-total': 93.46777293900004, 'time_spent_training-avg': 0.015053571562211652, 'time_spent_training-min': 1.3704999958008557e-05, 'time_spent_training-max': 1.079616685000019, 'time_spent_training-total': 29.399625260999358}}
```
## Checks
- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
- [x] Unit tests
- [ ] Release tests
- [ ] This PR is not tested :(
---------
Signed-off-by: xgui <[email protected]>
Signed-off-by: Xinyuan <[email protected]>1 parent dbb3909 commit f81e366
File tree
4 files changed
+41
-2
lines changed- python/ray/data
- _internal
- block_batching
- tests
- release/train_tests/benchmark
4 files changed
+41
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| 326 | + | |
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
| |||
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| 339 | + | |
337 | 340 | | |
338 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
339 | 346 | | |
340 | 347 | | |
341 | 348 | | |
| |||
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | | - | |
| 368 | + | |
362 | 369 | | |
363 | 370 | | |
364 | 371 | | |
| |||
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
374 | | - | |
| 381 | + | |
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
565 | 570 | | |
566 | 571 | | |
567 | 572 | | |
| 573 | + | |
568 | 574 | | |
569 | 575 | | |
570 | 576 | | |
| |||
1098 | 1104 | | |
1099 | 1105 | | |
1100 | 1106 | | |
| 1107 | + | |
1101 | 1108 | | |
1102 | 1109 | | |
1103 | 1110 | | |
| |||
1146 | 1153 | | |
1147 | 1154 | | |
1148 | 1155 | | |
| 1156 | + | |
1149 | 1157 | | |
1150 | 1158 | | |
1151 | 1159 | | |
| |||
1843 | 1851 | | |
1844 | 1852 | | |
1845 | 1853 | | |
| 1854 | + | |
| 1855 | + | |
1846 | 1856 | | |
1847 | 1857 | | |
1848 | 1858 | | |
| |||
1880 | 1890 | | |
1881 | 1891 | | |
1882 | 1892 | | |
| 1893 | + | |
1883 | 1894 | | |
1884 | 1895 | | |
1885 | 1896 | | |
| |||
1911 | 1922 | | |
1912 | 1923 | | |
1913 | 1924 | | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
1914 | 1932 | | |
1915 | 1933 | | |
1916 | 1934 | | |
| |||
1973 | 1991 | | |
1974 | 1992 | | |
1975 | 1993 | | |
| 1994 | + | |
1976 | 1995 | | |
1977 | 1996 | | |
1978 | 1997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
504 | 505 | | |
505 | 506 | | |
506 | 507 | | |
| |||
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| 700 | + | |
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
| |||
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
| 745 | + | |
743 | 746 | | |
744 | 747 | | |
745 | 748 | | |
| |||
845 | 848 | | |
846 | 849 | | |
847 | 850 | | |
| 851 | + | |
848 | 852 | | |
849 | 853 | | |
850 | 854 | | |
| |||
866 | 870 | | |
867 | 871 | | |
868 | 872 | | |
| 873 | + | |
869 | 874 | | |
870 | 875 | | |
871 | 876 | | |
| |||
985 | 990 | | |
986 | 991 | | |
987 | 992 | | |
| 993 | + | |
988 | 994 | | |
989 | 995 | | |
990 | 996 | | |
| |||
1080 | 1086 | | |
1081 | 1087 | | |
1082 | 1088 | | |
| 1089 | + | |
1083 | 1090 | | |
1084 | 1091 | | |
1085 | 1092 | | |
| |||
1101 | 1108 | | |
1102 | 1109 | | |
1103 | 1110 | | |
| 1111 | + | |
1104 | 1112 | | |
1105 | 1113 | | |
1106 | 1114 | | |
| |||
1537 | 1545 | | |
1538 | 1546 | | |
1539 | 1547 | | |
| 1548 | + | |
1540 | 1549 | | |
1541 | 1550 | | |
1542 | 1551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
0 commit comments