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

Only pad documents to largest documents in the column #25

Open
NohTow opened this issue Aug 1, 2024 · 1 comment
Open

Only pad documents to largest documents in the column #25

NohTow opened this issue Aug 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@NohTow
Copy link
Collaborator

NohTow commented Aug 1, 2024

Right now, for simplicity, during distillation we pad every document to the max length so we can easily stack them to compute the scores.
An optimization would be to only pad them to the longest in the column (since we are proceeding the documents column by column) and add the padding afterwards

@NohTow
Copy link
Collaborator Author

NohTow commented Aug 9, 2024

Update: we are now working on the batch level so we can only pad to the longest document in the whole batch (instead of to max_doc_length). This can be achieved by simply setting pad_document to false in the tokenize function defined in the collator.
However, I am letting it to true as the default right now since I surprisingly observed more VRAM usage when setting it to false (and also need to bench its performance impact w.r.t the .compile function).

@NohTow NohTow added the enhancement New feature or request label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant