Conversation
feihugis
left a comment
There was a problem hiding this comment.
@JulianneKnott Thanks for updating HF models! I did a pass and left some minor comments. Did you check if all the changed code have been used during the inference?
| #https://github.com/huggingface/transformers.git \ | ||
| export BASELINE_REPO=$CACHE_DIR/transformers_v4.12.0 | ||
| git_clone_if_not_in_cache \ | ||
| https://github.com/JiushengChen/transformers.git \ |
There was a problem hiding this comment.
Some context about this forked repo, it is to add param "no_repeat_ngram_size", see
JiushengChen/Transformers@db97043
There was a problem hiding this comment.
To clarify, this is no longer needed since fastseq uses it's own run_eval_hf.py for the baseline?
| is_greedy_gen_mode = (num_beams == 1) and (num_beam_groups == 1) and do_sample is False | ||
| is_sample_gen_mode = (num_beams == 1) and (num_beam_groups == 1) and do_sample is True | ||
| is_beam_gen_mode = (num_beams > 1) and (num_beam_groups == 1) and do_sample is False | ||
| is_beam_sample_gen_mode = (num_beams > 1) and (num_beam_groups == 1) and do_sample is True | ||
| is_group_beam_gen_mode = (num_beams > 1) and (num_beam_groups > 1) |
There was a problem hiding this comment.
Are our changes compatible with all these generation modes?
There was a problem hiding this comment.
The beam search updates are only applied for is_beam_gen_mode. The model-specific updates (ie attention) are applied in all cases.
There was a problem hiding this comment.
Does it also work with is_group_beam_gen_mode?
There was a problem hiding this comment.
no is_group_beam_gen_mode does not use the updates. Should that be added?
There was a problem hiding this comment.
If the optimizations can also work for group_beam_gen_mode, we can add it. We can support it in the another PR later if it will take some time to support it.
There was a problem hiding this comment.
I think it will take some time to make it work for both, so I think it's best if group_beam_gen_mode goes in another pr
feihugis
left a comment
There was a problem hiding this comment.
Thanks @JulianneKnott for the revisions! The PR looks good to me!
Updating Fastseq for compatibility with huggingface transformers v4.12.0.
Benchmarks (samples/sec):