Skip to content

Conversation

ddaspit
Copy link
Contributor

@ddaspit ddaspit commented Oct 20, 2023

This change is Reviewable

Copy link
Collaborator

@johnml1135 johnml1135 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ddaspit)


machine/jobs/huggingface/hugging_face_nmt_model_factory.py line 74 at r1 (raw file):

            num_beams=self._config.huggingface.generate_params.num_beams,
            batch_size=self._config.huggingface.generate_params.batch_size,
            truncation=TruncationStrategy.LONGEST_FIRST,

Wouldn't this cause memory issues with the odd super-long segment of 2000 tokens? Why the need for the change?

Copy link
Contributor Author

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @johnml1135)


machine/jobs/huggingface/hugging_face_nmt_model_factory.py line 74 at r1 (raw file):

Previously, johnml1135 (John Lambert) wrote…

Wouldn't this cause memory issues with the odd super-long segment of 2000 tokens? Why the need for the change?

This doesn't change the behavior for Serval at all. It simply changes the default truncation strategy for the HuggingFaceNmtEngine back to not truncate. Serval jobs still use the longest first truncation strategy. We are just now setting it in the HuggingFaceNmtModelFactory, which is the more appropriate place.

@johnml1135
Copy link
Collaborator

machine/jobs/huggingface/hugging_face_nmt_model_factory.py line 74 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

This doesn't change the behavior for Serval at all. It simply changes the default truncation strategy for the HuggingFaceNmtEngine back to not truncate. Serval jobs still use the longest first truncation strategy. We are just now setting it in the HuggingFaceNmtModelFactory, which is the more appropriate place.

ok.

@johnml1135
Copy link
Collaborator

It looks like the tokenizer code is not mixed with this pull request.

@ddaspit ddaspit force-pushed the truncation-strategy branch from 4a4fa4d to 167f3e9 Compare October 20, 2023 18:54
@ddaspit ddaspit force-pushed the truncation-strategy branch from 167f3e9 to 4023940 Compare October 20, 2023 18:55
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...translation/huggingface/hugging_face_nmt_engine.py 91.19% <100.00%> (ø)

📢 Thoughts on this report? Let us know!.

Copy link
Collaborator

@johnml1135 johnml1135 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 10 files reviewed, all discussions resolved

@johnml1135 johnml1135 merged commit 9188ba3 into main Oct 20, 2023
@ddaspit ddaspit deleted the truncation-strategy branch October 20, 2023 20:13
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