Skip to content

Commit

Permalink
Update stream.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoestq committed Dec 3, 2021
1 parent 520e9ff commit 10ec8c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ The following example demonstrates how to tokenize a :class:`datasets.IterableDa
'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ..., 1, 1]}
In a training loop
^^^^^^^^^^^^^^^^^^
Stream in a training loop
^^^^^^^^^^^^^^^^^^^^^^^^^

:class:`datasets.IterableDataset`s can be integrated into a training loop. First, shuffle the dataset:
Expand Down

1 comment on commit 10ec8c6

@github-actions
Copy link

Choose a reason for hiding this comment

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

Show benchmarks

PyArrow==3.0.0

Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.064041 / 0.011353 (0.052688) 0.003645 / 0.011008 (-0.007363) 0.030672 / 0.038508 (-0.007836) 0.031959 / 0.023109 (0.008850) 0.294941 / 0.275898 (0.019043) 0.335310 / 0.323480 (0.011830) 0.073346 / 0.007986 (0.065360) 0.002987 / 0.004328 (-0.001341) 0.009380 / 0.004250 (0.005130) 0.036474 / 0.037052 (-0.000579) 0.287689 / 0.258489 (0.029200) 0.336942 / 0.293841 (0.043101) 0.076622 / 0.128546 (-0.051924) 0.008619 / 0.075646 (-0.067028) 0.243011 / 0.419271 (-0.176260) 0.041470 / 0.043533 (-0.002063) 0.300787 / 0.255139 (0.045648) 0.330202 / 0.283200 (0.047002) 0.069231 / 0.141683 (-0.072451) 1.729215 / 1.452155 (0.277060) 1.794608 / 1.492716 (0.301892)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.244607 / 0.018006 (0.226601) 0.407429 / 0.000490 (0.406940) 0.003149 / 0.000200 (0.002949) 0.000089 / 0.000054 (0.000035)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.032292 / 0.037411 (-0.005120) 0.021828 / 0.014526 (0.007302) 0.026501 / 0.176557 (-0.150056) 0.187133 / 0.737135 (-0.550002) 0.027749 / 0.296338 (-0.268589)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.457946 / 0.215209 (0.242737) 4.573514 / 2.077655 (2.495859) 2.094303 / 1.504120 (0.590183) 1.887759 / 1.541195 (0.346565) 1.957679 / 1.468490 (0.489189) 0.442902 / 4.584777 (-4.141875) 4.250666 / 3.745712 (0.504953) 2.003179 / 5.269862 (-3.266683) 0.808724 / 4.565676 (-3.756952) 0.052564 / 0.424275 (-0.371711) 0.011143 / 0.007607 (0.003536) 0.563020 / 0.226044 (0.336975) 5.683745 / 2.268929 (3.414816) 2.515088 / 55.444624 (-52.929536) 2.188033 / 6.876477 (-4.688444) 2.272884 / 2.142072 (0.130812) 0.560866 / 4.805227 (-4.244362) 0.115111 / 6.500664 (-6.385553) 0.060026 / 0.075469 (-0.015443)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.604193 / 1.841788 (-0.237594) 11.805249 / 8.074308 (3.730941) 29.570742 / 10.191392 (19.379350) 0.797859 / 0.680424 (0.117436) 0.532855 / 0.534201 (-0.001346) 0.350087 / 0.579283 (-0.229196) 0.476366 / 0.434364 (0.042002) 0.234638 / 0.540337 (-0.305700) 0.247433 / 1.386936 (-1.139503)
PyArrow==latest
Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.061010 / 0.011353 (0.049657) 0.003419 / 0.011008 (-0.007589) 0.028034 / 0.038508 (-0.010474) 0.029203 / 0.023109 (0.006094) 0.337156 / 0.275898 (0.061257) 0.372982 / 0.323480 (0.049502) 0.071104 / 0.007986 (0.063118) 0.002878 / 0.004328 (-0.001450) 0.006594 / 0.004250 (0.002343) 0.035510 / 0.037052 (-0.001542) 0.357422 / 0.258489 (0.098933) 0.363116 / 0.293841 (0.069275) 0.074620 / 0.128546 (-0.053926) 0.008475 / 0.075646 (-0.067172) 0.240953 / 0.419271 (-0.178318) 0.039543 / 0.043533 (-0.003989) 0.343700 / 0.255139 (0.088561) 0.378278 / 0.283200 (0.095079) 0.069803 / 0.141683 (-0.071880) 1.725938 / 1.452155 (0.273783) 1.780513 / 1.492716 (0.287797)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.247619 / 0.018006 (0.229612) 0.390776 / 0.000490 (0.390287) 0.000539 / 0.000200 (0.000339) 0.000073 / 0.000054 (0.000018)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.028985 / 0.037411 (-0.008426) 0.020896 / 0.014526 (0.006370) 0.025465 / 0.176557 (-0.151092) 0.188922 / 0.737135 (-0.548214) 0.028388 / 0.296338 (-0.267951)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.457767 / 0.215209 (0.242558) 4.526338 / 2.077655 (2.448684) 1.988592 / 1.504120 (0.484473) 1.819528 / 1.541195 (0.278333) 1.955147 / 1.468490 (0.486657) 0.445027 / 4.584777 (-4.139750) 4.253366 / 3.745712 (0.507654) 3.109679 / 5.269862 (-2.160183) 0.814710 / 4.565676 (-3.750966) 0.053149 / 0.424275 (-0.371126) 0.010727 / 0.007607 (0.003120) 0.573922 / 0.226044 (0.347878) 5.758180 / 2.268929 (3.489251) 2.471243 / 55.444624 (-52.973381) 2.107877 / 6.876477 (-4.768600) 2.304160 / 2.142072 (0.162087) 0.565111 / 4.805227 (-4.240116) 0.114665 / 6.500664 (-6.385999) 0.057929 / 0.075469 (-0.017540)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.584281 / 1.841788 (-0.257507) 11.633283 / 8.074308 (3.558975) 28.891976 / 10.191392 (18.700584) 0.742224 / 0.680424 (0.061800) 0.553705 / 0.534201 (0.019504) 0.345793 / 0.579283 (-0.233491) 0.464328 / 0.434364 (0.029964) 0.224312 / 0.540337 (-0.316026) 0.234283 / 1.386936 (-1.152653)

CML watermark

Please sign in to comment.