Skip to content

Commit

Permalink
Update src/datasets/builder.py
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
  • Loading branch information
mariosasko and lhoestq authored Dec 9, 2022
1 parent 75e5eaa commit 74b3cad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/datasets/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ def download_and_prepare(
"'use_auth_token' was deprecated in version 2.7.1 and will be removed in 3.0.0. Pass `use_auth_token` to the initializer/`load_dataset_builder` instead.",
FutureWarning,
)
else:
use_auth_token = self.use_auth_token

output_dir = output_dir if output_dir is not None else self._cache_dir
# output_dir can be a remote bucket on GCS or S3 (when using BeamBasedBuilder for distributed data processing)
Expand Down

1 comment on commit 74b3cad

@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==6.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.010316 / 0.011353 (-0.001037) 0.005391 / 0.011008 (-0.005617) 0.099026 / 0.038508 (0.060518) 0.037873 / 0.023109 (0.014764) 0.299006 / 0.275898 (0.023108) 0.373496 / 0.323480 (0.050016) 0.008488 / 0.007986 (0.000503) 0.005567 / 0.004328 (0.001239) 0.073936 / 0.004250 (0.069686) 0.049995 / 0.037052 (0.012943) 0.311035 / 0.258489 (0.052546) 0.360055 / 0.293841 (0.066214) 0.044534 / 0.128546 (-0.084012) 0.015619 / 0.075646 (-0.060027) 0.336910 / 0.419271 (-0.082362) 0.052361 / 0.043533 (0.008828) 0.303095 / 0.255139 (0.047956) 0.316049 / 0.283200 (0.032849) 0.116580 / 0.141683 (-0.025103) 1.464904 / 1.452155 (0.012750) 1.489841 / 1.492716 (-0.002875)

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.255765 / 0.018006 (0.237759) 0.520204 / 0.000490 (0.519715) 0.002633 / 0.000200 (0.002433) 0.000088 / 0.000054 (0.000034)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.028738 / 0.037411 (-0.008673) 0.108321 / 0.014526 (0.093795) 0.120167 / 0.176557 (-0.056390) 0.159762 / 0.737135 (-0.577373) 0.126316 / 0.296338 (-0.170023)

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.396588 / 0.215209 (0.181379) 3.959785 / 2.077655 (1.882130) 1.748793 / 1.504120 (0.244673) 1.567017 / 1.541195 (0.025822) 1.615650 / 1.468490 (0.147160) 0.684719 / 4.584777 (-3.900057) 3.721551 / 3.745712 (-0.024161) 2.153053 / 5.269862 (-3.116808) 1.510234 / 4.565676 (-3.055442) 0.084331 / 0.424275 (-0.339944) 0.011857 / 0.007607 (0.004250) 0.512142 / 0.226044 (0.286098) 5.142105 / 2.268929 (2.873177) 2.245971 / 55.444624 (-53.198654) 1.889990 / 6.876477 (-4.986487) 1.987419 / 2.142072 (-0.154653) 0.832524 / 4.805227 (-3.972703) 0.165066 / 6.500664 (-6.335598) 0.062700 / 0.075469 (-0.012769)

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.476629 / 1.841788 (-0.365158) 15.451294 / 8.074308 (7.376986) 25.189942 / 10.191392 (14.998550) 0.864984 / 0.680424 (0.184560) 0.534582 / 0.534201 (0.000381) 0.445649 / 0.579283 (-0.133634) 0.444818 / 0.434364 (0.010454) 0.278779 / 0.540337 (-0.261558) 0.285654 / 1.386936 (-1.101282)
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.007777 / 0.011353 (-0.003576) 0.005339 / 0.011008 (-0.005669) 0.096701 / 0.038508 (0.058193) 0.033900 / 0.023109 (0.010791) 0.404252 / 0.275898 (0.128354) 0.434906 / 0.323480 (0.111427) 0.006007 / 0.007986 (-0.001979) 0.004231 / 0.004328 (-0.000097) 0.073525 / 0.004250 (0.069274) 0.042666 / 0.037052 (0.005614) 0.411769 / 0.258489 (0.153280) 0.466772 / 0.293841 (0.172931) 0.036894 / 0.128546 (-0.091652) 0.012567 / 0.075646 (-0.063079) 0.330935 / 0.419271 (-0.088336) 0.049085 / 0.043533 (0.005552) 0.400081 / 0.255139 (0.144942) 0.422807 / 0.283200 (0.139607) 0.106146 / 0.141683 (-0.035537) 1.486498 / 1.452155 (0.034343) 1.589465 / 1.492716 (0.096748)

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.300162 / 0.018006 (0.282156) 0.528773 / 0.000490 (0.528283) 0.001569 / 0.000200 (0.001369) 0.000091 / 0.000054 (0.000037)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.030687 / 0.037411 (-0.006724) 0.113934 / 0.014526 (0.099408) 0.127460 / 0.176557 (-0.049097) 0.167225 / 0.737135 (-0.569910) 0.133515 / 0.296338 (-0.162823)

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.424932 / 0.215209 (0.209723) 4.242355 / 2.077655 (2.164700) 2.012885 / 1.504120 (0.508765) 1.819755 / 1.541195 (0.278561) 1.883450 / 1.468490 (0.414960) 0.706245 / 4.584777 (-3.878532) 3.890255 / 3.745712 (0.144543) 4.252168 / 5.269862 (-1.017694) 1.616397 / 4.565676 (-2.949279) 0.085184 / 0.424275 (-0.339091) 0.012197 / 0.007607 (0.004590) 0.534821 / 0.226044 (0.308776) 5.330656 / 2.268929 (3.061728) 2.561910 / 55.444624 (-52.882714) 2.196656 / 6.876477 (-4.679821) 2.358413 / 2.142072 (0.216340) 0.841140 / 4.805227 (-3.964088) 0.169734 / 6.500664 (-6.330930) 0.064337 / 0.075469 (-0.011132)

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.518196 / 1.841788 (-0.323592) 15.419315 / 8.074308 (7.345007) 12.131688 / 10.191392 (1.940296) 0.900707 / 0.680424 (0.220283) 0.600295 / 0.534201 (0.066094) 0.422554 / 0.579283 (-0.156729) 0.423626 / 0.434364 (-0.010737) 0.249972 / 0.540337 (-0.290366) 0.253285 / 1.386936 (-1.133651)

Please sign in to comment.