Porting a fairseq translation model
Summary
Hugging Face documents the transfer of a WMT19 translation model from fairseq to Transformers. The focus is on reproducible weight mapping, tokenisation and identical outputs. The ported system comes from fairseq and was trained for WMT19.
Ideas
- A model port is only successful when preprocessing, weights and decoding match.
- Numerical comparison tests protect against silent errors in seemingly compatible layers.
Insights
- Porting is a translation task whose correctness can only be proven through reference behaviour.
Facts
- Porting requires an explicit mapping of the parameters between the two implementations.
Critique
- Identical test outputs do not automatically cover errors outside the inputs that were checked.
Recommendations
- Define reference inputs and expected logits before you port a model architecture.
References
Read the original article on Hugging Face
Links to the original source and the Web Archive open in a new tab.