-
Notifications
You must be signed in to change notification settings - Fork 38
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
Sort and unsort the input texts for transformers #66
base: main
Are you sure you want to change the base?
Conversation
Without this PR:
With this PR:
Run the below command on GPU-1:
|
Update doc and benchmark. |
the indices in the original input list. | ||
""" | ||
is_ascending = -1 if reverse else 1 | ||
sorted_idx = sorted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any perf for large data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuyan2do Do you mean the benchmarking result on a larger dataset than the data in our benchmark script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also have similar worry, as it loaded all data into memory, and then sort. Please check perf on a larger dataset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the test results on a larger dataset
- 5,242,880 of examples (~ 16GB): sort took ~4.4 seconds; unsort took: 1.4 seconds;
- 15,728,640 of examples (~ 48GB): sort took ~14.0 seconds; unsort took: 4.6 seconds;
Sort the input text by their length so that the padding for each batch can be as small as possible.