Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Fairseq v0.10.2 compatible - #104

Merged
Julianne Knott (JulianneKnott) merged 80 commits into
mainfrom
fairseq_v0.10.2_compatible
Oct 27, 2021
Merged

Fairseq v0.10.2 compatible#104
Julianne Knott (JulianneKnott) merged 80 commits into
mainfrom
fairseq_v0.10.2_compatible

Conversation

@JulianneKnott

Copy link
Copy Markdown
Contributor

Updated generate.py to be compatible with Fairseq v0.10.2.
Speed tbd.

@JiushengChen

Copy link
Copy Markdown
Contributor

Avoid checking in those txt files and old backup file - "generate_old.py".

@feihugisFei Hu (feihugis) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Julianne Knott (@JulianneKnott) for this PR! I did a pass and have one question for the files under results: are they used for comparing the outputs from fastseq and fairseq? It will be very helpful if we can add a unit test to automatically check it. We can also integrate it with our CI in the next step.

Comment threadbenchmarks/models/fs_wmt.sh Outdated
Comment threadfastseq/optimizer/fairseq/generate_old.py Outdated
@JulianneKnott

Copy link
Copy Markdown
ContributorAuthor

Thanks Julianne Knott (@JulianneKnott) for this PR! I did a pass and have one question for the files under results: are they used for comparing the outputs from fastseq and fairseq? It will be very helpful if we can add a unit test to automatically check it. We can also integrate it with our CI in the next step.

Yes. Didn't mean to commit them and will remove them on the next commit. Will look into adding a unit test also.

@JulianneKnott

Copy link
Copy Markdown
ContributorAuthor

Benchmark Info:

Util Model Task Split BatchSize Samples Tokens Bleu Rouge Loss Perplexity Runtime(seconds) Throughput(samples/s) Throughput(tokens/s)
fairseq_v0.10.2 bart.large.cnn cnn_dm/len-1024.bin valid 32 13367 1098036 17.93 NA NA NA 3875 3.4 283.4
fairseq_v0.10.2+fastseq_v0.0.4 bart.large.cnn cnn_dm/len-1024.bin valid 32 13367 1098036 17.93 NA NA NA 3028 4.4 362.6

@feihugisFei Hu (feihugis) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current code looks good to me. As this change will break the other parts of the main branch, could we create another branch (e.g., fairseq-0.10.2) for this work? After finishing all the tasks, it can be merged to the main branch.

@JulianneKnott

Copy link
Copy Markdown
ContributorAuthor

Updated beam search optimizer.
Benchmarks:

Util Model Task Split BatchSize Samples Tokens Bleu Rouge Loss Perplexity Runtime(seconds) Throughput(samples/s) Throughput(tokens/s)
fairseq_v0.10.2+fastseq_v0.0.4 bart.large.cnn cnn_dm/len-1024.bin valid 256 13367 1098278 17.90 NA NA NA 718 18.6 1529.6

@JulianneKnottJulianne Knott (JulianneKnott) changed the title Fairseq v0.10.2 compatible - generate.py updatedFairseq v0.10.2 compatibleSep 15, 2021
@JulianneKnott

Copy link
Copy Markdown
ContributorAuthor

Updated el attention optimizer
Benchmarks:

Util Model Task Split BatchSize Samples Tokens Bleu Rouge Loss Perplexity Runtime(seconds) Throughput(samples/s) Throughput(tokens/s)
fairseq_v0.10.2+fastseq_v0.0.4 bart.large.cnn cnn_dm/len-1024.bin valid 320 13367 1098535 17.92 NA NA NA 621 21.5 1769.0

Comment threadfastseq/optimizer/fairseq/beam_search_optimizer.py Outdated
Comment threadfastseq/optimizer/fairseq/beam_search_optimizer.py
Comment threadfastseq/optimizer/fairseq/beam_search_optimizer.py Outdated
Comment threadfastseq/optimizer/fairseq/el_attention_optimizer.py
Comment threadfastseq/optimizer/fairseq/el_attention_optimizer.py Outdated
Comment threadsetup.py Outdated

@feihugisFei Hu (feihugis) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Julianne Knott (@JulianneKnott) ! LGTM. Just find some very minor issues. After fixing, the PR will be good to merge.

Comment threadbenchmarks/models/fs_prophetnet.sh

def step(self, step, lprobs, scores):
super()._init_buffers(lprobs)
class BeamSearch(BeamSearch):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if people will get confused when the child class has the same name with the parent class? What do Julianne Knott (@JulianneKnott) think of it?

Comment threadfastseq/optimizer/fairseq/el_attention_optimizer.py Outdated
Comment threadfastseq/optimizer/fairseq/el_attention_optimizer.py Outdated
Comment threadfastseq/optimizer/fairseq/el_attention_optimizer.py Outdated

@yuyan2doYu Yan (yuyan2do) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Just added a few suggestions inline.

Another question: Is there any test cover converting a model to its TorchScript version? If not, we need do it manually to verify our change do not break this functionality.

Comment threadazure-pipelines.yml Outdated
Comment threadazure-pipelines.yml Outdated
Comment threadexamples/prophetnet/README.md
Comment threadfastseq/config.py
metavar='N',
help='number of worker for post process')
parser.add_argument(
'--decode_hypothesis',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is this param used?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

ifargs.decode_hypothesis:
also lines: 211, 218, 240 in the same file

Comment threadtests/run_fairseq_tests.sh Outdated
@JulianneKnott
Julianne Knott (JulianneKnott) deleted the fairseq_v0.10.2_compatible branch October 27, 2021 23:47
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@JulianneKnott@JiushengChen@feihugis@yuyan2do