Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

[Numpy Refactor] BART #1282

Merged
merged 37 commits into from
Jul 30, 2020
Merged

[Numpy Refactor] BART #1282

merged 37 commits into from
Jul 30, 2020

Conversation

zheyuye
Copy link
Member

@zheyuye zheyuye commented Jul 29, 2020

Description

As #1241 requeted, BART model from fairseq is now available as well as its conversion script. Most of the test cases for Bart are covered by test_models_transformer.py

TODO

  • BART Inference model for Machine Translation
  • Denosing training scripts of BART
  • Fine-tuning result of BART on Machine Translation, Querstion Answering and Text Classification

cc @dmlc/gluon-nlp-team

@zheyuye zheyuye added enhancement New feature or request numpyrefactor labels Jul 29, 2020
@classmethod
def from_cfg(cls, cfg,
use_pooler=False,
classifier_activation=False):
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to remove the classifier_activation flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could remove this and consider applying an activation layer as default setting for the pooler.

commit 510d991
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 02:33:22 2020 +0800

    test

commit 1b5fa7b
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:48:01 2020 +0800

    fix comment1

commit 6533601
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:27:44 2020 +0800

    fix comment

commit a8853f9
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:10:06 2020 +0800

    Squashed commit of the following:

    commit 232e0b6
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 01:05:17 2020 +0800

        update

    commit 995e5d7
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 01:01:56 2020 +0800

        fix

    commit 9623240
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 00:52:17 2020 +0800

        fix

    commit d9c4140
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 23:07:10 2020 +0800

        fix transformer

    commit e49fbe1
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 22:18:12 2020 +0800

        update

    commit 1f75b26
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 22:04:08 2020 +0800

        test bart

    commit 5bab516
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 21:34:47 2020 +0800

        fix cfg

    commit 6c62a29
    Merge: 3366cf3 033214e
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 21:33:10 2020 +0800

        Merge remote-tracking branch 'upstream/numpy' into bart

    commit 033214e
    Author: Xingjian Shi <[email protected]>
    Date:   Wed Jul 29 00:36:57 2020 -0700

        [Numpy] Fix SQuAD + Fix GLUE downloading (dmlc#1280)

        * Update run_squad.py

        * Update run_squad.py

        * Update prepare_glue.py

    commit 3c87457
    Author: Xingjian Shi <[email protected]>
    Date:   Tue Jul 28 18:03:21 2020 -0700

        Add layout + compute_layout support: TransformerNMT, BERT, ALBERT, ELECTRA, MobileBERT, RoBERTA, XLMR (dmlc#1258)

        * Add layout support

        * fix test

        * Update transformer.py

        * Update transformer.py

        * Update README.md

        * try to add set_layout

        * update test case

        * fix

        * update

        * update

        * update

        * Update bert.py

        * fix bug

        * update

        * Update test_models_bert.py

        * Update tokenizers.py

        * add compute layout

        * Update xlmr.py

        * Update test_models_bert.py

        * revise test cases

        * Update layers.py

        * move jieba to try import

        * fix

        * Update transformer.py

        * fix

        * Update bert.py

        * Update setup.py

        * Update test_models_bert.py

        * Update test_models_bert.py

        * fix

        * update

        * Revise

        * Update electra.py

        * Update electra.py

        * Update test_models_electra.py

        * fix

        * fix bug

        * Update test_models_albert.py

        * add more testcases

        * fix

        * Update albert.py

        * Update albert.py

        * fix bug

        * fix testcase

        * Update test_models_electra.py

        * Update bert.py

        * update

        * Update test_models_electra.py

        * Update mobilebert.py

        * Update mobilebert.py

        * update mobilebert

        * Update test_models_mobilebert.py

        * Update mobilebert.py

        * fix bug

        * Update roberta.py

        * fix roberta

        * update

        * update

        * fix import

        * fix bug

        * update

        * reduce test workloads

        * address comment

        * address comment

    commit 4d43f82
    Author: Sheng Zha <[email protected]>
    Date:   Mon Jul 27 20:21:00 2020 -0700

        add subversion/wget to docker, add readme (dmlc#1279)

    commit d76897b
    Author: phile <[email protected]>
    Date:   Tue Jul 28 10:10:13 2020 +0800

        Add embedding related methods in numpy version (dmlc#1263)

        * A draft for embedding

        * fix embed_loader

        * add hyperbolic space and some updates

        * revise evaluation

        * fix

        * simple fixes

        * move l2norm to op.py

        * new features

        * fix

        * update

        * add tests, update

        * newline
commit 9e1ffde
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 11:42:01 2020 +0800

    todo

commit 9a7c343
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 10:53:15 2020 +0800

    revert gelu

commit 0425346
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 10:49:52 2020 +0800

    re-upload bart

commit 516ae84
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 03:32:35 2020 +0800

    use_qkv_bias for transformer

commit 9d60cda
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 03:17:28 2020 +0800

    classifier_activation

commit 510d991
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 02:33:22 2020 +0800

    test

commit 1b5fa7b
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:48:01 2020 +0800

    fix comment1

commit 6533601
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:27:44 2020 +0800

    fix comment

commit a8853f9
Author: ZheyuYe <[email protected]>
Date:   Thu Jul 30 01:10:06 2020 +0800

    Squashed commit of the following:

    commit 232e0b6
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 01:05:17 2020 +0800

        update

    commit 995e5d7
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 01:01:56 2020 +0800

        fix

    commit 9623240
    Author: ZheyuYe <[email protected]>
    Date:   Thu Jul 30 00:52:17 2020 +0800

        fix

    commit d9c4140
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 23:07:10 2020 +0800

        fix transformer

    commit e49fbe1
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 22:18:12 2020 +0800

        update

    commit 1f75b26
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 22:04:08 2020 +0800

        test bart

    commit 5bab516
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 21:34:47 2020 +0800

        fix cfg

    commit 6c62a29
    Merge: 3366cf3 033214e
    Author: ZheyuYe <[email protected]>
    Date:   Wed Jul 29 21:33:10 2020 +0800

        Merge remote-tracking branch 'upstream/numpy' into bart

    commit 033214e
    Author: Xingjian Shi <[email protected]>
    Date:   Wed Jul 29 00:36:57 2020 -0700

        [Numpy] Fix SQuAD + Fix GLUE downloading (dmlc#1280)

        * Update run_squad.py

        * Update run_squad.py

        * Update prepare_glue.py

    commit 3c87457
    Author: Xingjian Shi <[email protected]>
    Date:   Tue Jul 28 18:03:21 2020 -0700

        Add layout + compute_layout support: TransformerNMT, BERT, ALBERT, ELECTRA, MobileBERT, RoBERTA, XLMR (dmlc#1258)

        * Add layout support

        * fix test

        * Update transformer.py

        * Update transformer.py

        * Update README.md

        * try to add set_layout

        * update test case

        * fix

        * update

        * update

        * update

        * Update bert.py

        * fix bug

        * update

        * Update test_models_bert.py

        * Update tokenizers.py

        * add compute layout

        * Update xlmr.py

        * Update test_models_bert.py

        * revise test cases

        * Update layers.py

        * move jieba to try import

        * fix

        * Update transformer.py

        * fix

        * Update bert.py

        * Update setup.py

        * Update test_models_bert.py

        * Update test_models_bert.py

        * fix

        * update

        * Revise

        * Update electra.py

        * Update electra.py

        * Update test_models_electra.py

        * fix

        * fix bug

        * Update test_models_albert.py

        * add more testcases

        * fix

        * Update albert.py

        * Update albert.py

        * fix bug

        * fix testcase

        * Update test_models_electra.py

        * Update bert.py

        * update

        * Update test_models_electra.py

        * Update mobilebert.py

        * Update mobilebert.py

        * update mobilebert

        * Update test_models_mobilebert.py

        * Update mobilebert.py

        * fix bug

        * Update roberta.py

        * fix roberta

        * update

        * update

        * fix import

        * fix bug

        * update

        * reduce test workloads

        * address comment

        * address comment

    commit 4d43f82
    Author: Sheng Zha <[email protected]>
    Date:   Mon Jul 27 20:21:00 2020 -0700

        add subversion/wget to docker, add readme (dmlc#1279)

    commit d76897b
    Author: phile <[email protected]>
    Date:   Tue Jul 28 10:10:13 2020 +0800

        Add embedding related methods in numpy version (dmlc#1263)

        * A draft for embedding

        * fix embed_loader

        * add hyperbolic space and some updates

        * revise evaluation

        * fix

        * simple fixes

        * move l2norm to op.py

        * new features

        * fix

        * update

        * add tests, update

        * newline
@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #1282 into numpy will increase coverage by 0.06%.
The diff coverage is 87.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##            numpy    #1282      +/-   ##
==========================================
+ Coverage   84.14%   84.21%   +0.06%     
==========================================
  Files          41       42       +1     
  Lines        6157     6316     +159     
==========================================
+ Hits         5181     5319     +138     
- Misses        976      997      +21     
Impacted Files Coverage Δ
src/gluonnlp/models/bart.py 85.16% <85.16%> (ø)
src/gluonnlp/layers.py 86.78% <100.00%> (ø)
src/gluonnlp/models/transformer.py 98.52% <100.00%> (+0.43%) ⬆️

Copy link
Member

@sxjscience sxjscience left a comment

Choose a reason for hiding this comment

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

Minor comments about the embedding initializer. LGTM overall.

@sxjscience sxjscience merged commit 2294421 into dmlc:numpy Jul 30, 2020
@zheyuye zheyuye deleted the bart branch July 31, 2020 02:32
@zheyuye zheyuye mentioned this pull request Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request numpyrefactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants