Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename LargeList.dtype to LargeList.feature #7106

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

albertvillanova
Copy link
Member

@albertvillanova albertvillanova commented Aug 16, 2024

Rename LargeList.dtype to LargeList.feature.

Note that dtype is usually used for NumPy data types ("int64", "float32",...): see Value.dtype.

However, LargeList attribute (like Sequence.feature) expects a FeatureType instead.

With this renaming:

  • we avoid confusion about the expected type and
  • we also align LargeList with Sequence.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

good idea

@albertvillanova albertvillanova merged commit 88f646c into main Aug 26, 2024
15 checks passed
@albertvillanova albertvillanova deleted the rename-large-list-attr branch August 26, 2024 04:26
Copy link

Show benchmarks

PyArrow==8.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.005598 / 0.011353 (-0.005755) 0.004327 / 0.011008 (-0.006681) 0.063961 / 0.038508 (0.025453) 0.031039 / 0.023109 (0.007930) 0.245586 / 0.275898 (-0.030312) 0.273765 / 0.323480 (-0.049715) 0.003463 / 0.007986 (-0.004523) 0.002871 / 0.004328 (-0.001457) 0.049169 / 0.004250 (0.044918) 0.049342 / 0.037052 (0.012290) 0.259255 / 0.258489 (0.000766) 0.295688 / 0.293841 (0.001847) 0.029527 / 0.128546 (-0.099019) 0.012507 / 0.075646 (-0.063139) 0.209420 / 0.419271 (-0.209851) 0.036666 / 0.043533 (-0.006866) 0.272031 / 0.255139 (0.016892) 0.272585 / 0.283200 (-0.010614) 0.020004 / 0.141683 (-0.121679) 1.158605 / 1.452155 (-0.293550) 1.230930 / 1.492716 (-0.261787)

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.109196 / 0.018006 (0.091189) 0.377759 / 0.000490 (0.377270) 0.000222 / 0.000200 (0.000022) 0.000043 / 0.000054 (-0.000011)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.018961 / 0.037411 (-0.018450) 0.063189 / 0.014526 (0.048663) 0.075253 / 0.176557 (-0.101303) 0.122912 / 0.737135 (-0.614223) 0.077961 / 0.296338 (-0.218378)

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.278425 / 0.215209 (0.063216) 2.748336 / 2.077655 (0.670681) 1.468410 / 1.504120 (-0.035710) 1.347859 / 1.541195 (-0.193336) 1.389175 / 1.468490 (-0.079315) 0.742833 / 4.584777 (-3.841943) 2.358930 / 3.745712 (-1.386782) 3.062720 / 5.269862 (-2.207141) 1.912264 / 4.565676 (-2.653412) 0.079263 / 0.424275 (-0.345012) 0.005212 / 0.007607 (-0.002396) 0.332482 / 0.226044 (0.106438) 3.287045 / 2.268929 (1.018116) 1.827862 / 55.444624 (-53.616762) 1.525087 / 6.876477 (-5.351390) 1.581742 / 2.142072 (-0.560330) 0.791737 / 4.805227 (-4.013490) 0.135774 / 6.500664 (-6.364890) 0.043700 / 0.075469 (-0.031769)

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) 0.982104 / 1.841788 (-0.859683) 12.227639 / 8.074308 (4.153331) 9.492719 / 10.191392 (-0.698673) 0.144792 / 0.680424 (-0.535632) 0.014844 / 0.534201 (-0.519357) 0.304919 / 0.579283 (-0.274364) 0.262955 / 0.434364 (-0.171409) 0.339517 / 0.540337 (-0.200821) 0.430929 / 1.386936 (-0.956007)
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.005982 / 0.011353 (-0.005371) 0.004199 / 0.011008 (-0.006809) 0.050674 / 0.038508 (0.012166) 0.032713 / 0.023109 (0.009604) 0.270071 / 0.275898 (-0.005827) 0.300469 / 0.323480 (-0.023011) 0.005159 / 0.007986 (-0.002826) 0.002961 / 0.004328 (-0.001368) 0.048403 / 0.004250 (0.044152) 0.042024 / 0.037052 (0.004971) 0.288927 / 0.258489 (0.030438) 0.321412 / 0.293841 (0.027571) 0.032436 / 0.128546 (-0.096110) 0.012472 / 0.075646 (-0.063175) 0.060527 / 0.419271 (-0.358744) 0.034222 / 0.043533 (-0.009311) 0.276259 / 0.255139 (0.021120) 0.293168 / 0.283200 (0.009969) 0.019245 / 0.141683 (-0.122438) 1.180766 / 1.452155 (-0.271388) 1.220269 / 1.492716 (-0.272447)

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.110082 / 0.018006 (0.092076) 0.364221 / 0.000490 (0.363731) 0.000221 / 0.000200 (0.000021) 0.000044 / 0.000054 (-0.000011)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.022923 / 0.037411 (-0.014488) 0.078022 / 0.014526 (0.063496) 0.089543 / 0.176557 (-0.087013) 0.129855 / 0.737135 (-0.607280) 0.090891 / 0.296338 (-0.205448)

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.304169 / 0.215209 (0.088960) 2.969772 / 2.077655 (0.892117) 1.582647 / 1.504120 (0.078527) 1.464446 / 1.541195 (-0.076749) 1.485422 / 1.468490 (0.016932) 0.720105 / 4.584777 (-3.864672) 0.966730 / 3.745712 (-2.778982) 3.017549 / 5.269862 (-2.252313) 1.924574 / 4.565676 (-2.641103) 0.079938 / 0.424275 (-0.344337) 0.005684 / 0.007607 (-0.001923) 0.364093 / 0.226044 (0.138048) 3.569470 / 2.268929 (1.300541) 1.956535 / 55.444624 (-53.488089) 1.669432 / 6.876477 (-5.207045) 1.687596 / 2.142072 (-0.454476) 0.802725 / 4.805227 (-4.002502) 0.132874 / 6.500664 (-6.367790) 0.041403 / 0.075469 (-0.034067)

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.033317 / 1.841788 (-0.808471) 12.590652 / 8.074308 (4.516344) 10.618609 / 10.191392 (0.427217) 0.131833 / 0.680424 (-0.548591) 0.015675 / 0.534201 (-0.518526) 0.300804 / 0.579283 (-0.278479) 0.127253 / 0.434364 (-0.307111) 0.342559 / 0.540337 (-0.197779) 0.464302 / 1.386936 (-0.922634)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants