Skip to content

Commit

Permalink
Force dtype to ensure Windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Sep 15, 2021
1 parent a189740 commit c8f251b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def fetch_function(indices):
def ensure_shapes(input_dict):
return {key: tf.ensure_shape(val, output_signature[key].shape) for key, val in input_dict.items()}

tf_dataset = tf.data.Dataset.from_tensor_slices(np.arange(len(self)))
tf_dataset = tf.data.Dataset.from_tensor_slices(np.arange(len(self), dtype=np.int64))

if shuffle:
tf_dataset = tf_dataset.shuffle(len(self))
Expand Down

1 comment on commit c8f251b

@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.013662 / 0.011353 (0.002309) 0.005174 / 0.011008 (-0.005834) 0.036979 / 0.038508 (-0.001529) 0.035285 / 0.023109 (0.012176) 0.361297 / 0.275898 (0.085399) 0.425192 / 0.323480 (0.101712) 0.009655 / 0.007986 (0.001669) 0.004312 / 0.004328 (-0.000016) 0.010393 / 0.004250 (0.006143) 0.049502 / 0.037052 (0.012449) 0.344364 / 0.258489 (0.085875) 0.426338 / 0.293841 (0.132497) 0.035325 / 0.128546 (-0.093221) 0.010271 / 0.075646 (-0.065375) 0.300629 / 0.419271 (-0.118643) 0.054116 / 0.043533 (0.010583) 0.352647 / 0.255139 (0.097508) 0.392000 / 0.283200 (0.108801) 0.146245 / 0.141683 (0.004562) 1.959629 / 1.452155 (0.507474) 2.003228 / 1.492716 (0.510511)

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.237416 / 0.018006 (0.219409) 0.539112 / 0.000490 (0.538622) 0.005888 / 0.000200 (0.005688) 0.000107 / 0.000054 (0.000053)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.042503 / 0.037411 (0.005091) 0.031397 / 0.014526 (0.016872) 0.028076 / 0.176557 (-0.148481) 0.129572 / 0.737135 (-0.607564) 0.031351 / 0.296338 (-0.264988)

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.478170 / 0.215209 (0.262961) 4.840945 / 2.077655 (2.763290) 2.261775 / 1.504120 (0.757655) 1.921395 / 1.541195 (0.380200) 1.944136 / 1.468490 (0.475646) 0.499230 / 4.584777 (-4.085547) 6.215440 / 3.745712 (2.469727) 6.647885 / 5.269862 (1.378023) 3.365613 / 4.565676 (-1.200064) 0.061150 / 0.424275 (-0.363125) 0.008920 / 0.007607 (0.001313) 0.644863 / 0.226044 (0.418819) 6.176884 / 2.268929 (3.907955) 2.904958 / 55.444624 (-52.539667) 2.257677 / 6.876477 (-4.618800) 2.280091 / 2.142072 (0.138018) 0.652272 / 4.805227 (-4.152956) 0.141859 / 6.500664 (-6.358805) 0.127222 / 0.075469 (0.051753)

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.081618 / 1.841788 (-0.760169) 15.065690 / 8.074308 (6.991382) 41.855115 / 10.191392 (31.663723) 0.930643 / 0.680424 (0.250219) 0.598135 / 0.534201 (0.063934) 0.278093 / 0.579283 (-0.301190) 0.698783 / 0.434364 (0.264419) 0.428343 / 0.540337 (-0.111995) 0.431844 / 1.386936 (-0.955092)
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.010178 / 0.011353 (-0.001175) 0.005670 / 0.011008 (-0.005338) 0.036909 / 0.038508 (-0.001599) 0.037610 / 0.023109 (0.014501) 0.351392 / 0.275898 (0.075494) 0.434296 / 0.323480 (0.110816) 0.008103 / 0.007986 (0.000117) 0.006553 / 0.004328 (0.002224) 0.010093 / 0.004250 (0.005842) 0.039696 / 0.037052 (0.002643) 0.356058 / 0.258489 (0.097569) 0.390420 / 0.293841 (0.096579) 0.030973 / 0.128546 (-0.097574) 0.012177 / 0.075646 (-0.063469) 0.329922 / 0.419271 (-0.089349) 0.053690 / 0.043533 (0.010157) 0.345407 / 0.255139 (0.090268) 0.389918 / 0.283200 (0.106718) 0.112081 / 0.141683 (-0.029602) 1.977111 / 1.452155 (0.524957) 2.008847 / 1.492716 (0.516130)

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.388934 / 0.018006 (0.370928) 0.560972 / 0.000490 (0.560482) 0.058495 / 0.000200 (0.058295) 0.000612 / 0.000054 (0.000558)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.043566 / 0.037411 (0.006154) 0.026550 / 0.014526 (0.012024) 0.030694 / 0.176557 (-0.145862) 0.143015 / 0.737135 (-0.594120) 0.036590 / 0.296338 (-0.259749)

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.492090 / 0.215209 (0.276881) 4.884965 / 2.077655 (2.807311) 2.351565 / 1.504120 (0.847445) 2.048434 / 1.541195 (0.507240) 2.139097 / 1.468490 (0.670607) 0.506746 / 4.584777 (-4.078031) 6.430274 / 3.745712 (2.684562) 6.213256 / 5.269862 (0.943394) 3.302040 / 4.565676 (-1.263636) 0.060932 / 0.424275 (-0.363344) 0.005891 / 0.007607 (-0.001716) 0.649177 / 0.226044 (0.423132) 6.328320 / 2.268929 (4.059391) 2.963901 / 55.444624 (-52.480724) 2.334551 / 6.876477 (-4.541926) 2.467375 / 2.142072 (0.325303) 0.657697 / 4.805227 (-4.147530) 0.146497 / 6.500664 (-6.354167) 0.060635 / 0.075469 (-0.014834)

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.055173 / 1.841788 (-0.786615) 14.676538 / 8.074308 (6.602230) 40.520582 / 10.191392 (30.329190) 0.857777 / 0.680424 (0.177353) 0.636143 / 0.534201 (0.101942) 0.268884 / 0.579283 (-0.310399) 0.677339 / 0.434364 (0.242975) 0.470103 / 0.540337 (-0.070235) 0.428160 / 1.386936 (-0.958776)

CML watermark

Please sign in to comment.