Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MT task for espnet2 with IWSLT14 recipe #4111

Merged
merged 18 commits into from
Feb 27, 2022
Merged

Conversation

siddalmia
Copy link
Contributor

@siddalmia siddalmia commented Feb 25, 2022

Hi,

I have prepared MT task for espnet2 along with an IWSLT14 recipe. The code works till the training stage. Current TODOs are -

  • Fix the inference stage
  • Apply black

Thanks to @simpleoier @ftshijt @CoderPat with help at various stages of the build.

@mergify mergify bot added the ESPnet2 label Feb 25, 2022
@ftshijt ftshijt added MT Machine translation New Features Recipe WIP Work in process labels Feb 26, 2022
@siddalmia siddalmia changed the title [WIP] MT task for espnet2 with IWSLT14 recipe MT task for espnet2 with IWSLT14 recipe Feb 26, 2022
@siddalmia
Copy link
Contributor Author

@sw005320 @ftshijt I think we should be ready to merge this PR.

With the help of @pyf98 and @CoderPat I will make another PR with good configs for MT.

Thanks!

@ftshijt ftshijt removed the WIP Work in process label Feb 26, 2022
Copy link
Collaborator

@ftshijt ftshijt left a comment

Choose a reason for hiding this comment

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

Looks cool! Some minor comments

egs2/TEMPLATE/mt1/mt.sh Show resolved Hide resolved
egs2/TEMPLATE/mt1/mt.sh Show resolved Hide resolved
egs2/TEMPLATE/mt1/mt.sh Outdated Show resolved Hide resolved
@siddalmia
Copy link
Contributor Author

Thanks @ftshijt @simpleoier. I have addressed your comments and now just rechecking the entire pipeline!

@siddalmia
Copy link
Contributor Author

@ftshijt @simpleoier done! thanks for the review!

@ftshijt
Copy link
Collaborator

ftshijt commented Feb 26, 2022

Many thanks! the next step would just be fixing the CI issues

@codecov
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #4111 (8e43b78) into master (637d8c3) will decrease coverage by 0.76%.
The diff coverage is 1.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4111      +/-   ##
==========================================
- Coverage   80.94%   80.18%   -0.77%     
==========================================
  Files         435      438       +3     
  Lines       37651    38012     +361     
==========================================
+ Hits        30477    30479       +2     
- Misses       7174     7533     +359     
Flag Coverage Δ
test_integration_espnet1 67.13% <ø> (ø)
test_integration_espnet2 52.06% <0.00%> (-0.01%) ⬇️
test_python 66.06% <1.10%> (-0.63%) ⬇️
test_utils 24.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
espnet2/bin/mt_inference.py 0.00% <0.00%> (ø)
espnet2/bin/mt_train.py 0.00% <0.00%> (ø)
espnet2/bin/st_inference.py 0.00% <ø> (ø)
espnet2/bin/st_train.py 0.00% <ø> (ø)
espnet2/tasks/mt.py 0.00% <0.00%> (ø)
espnet2/asr/encoder/transformer_encoder.py 80.85% <66.66%> (-1.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 637d8c3...8e43b78. Read the comment docs.

Copy link
Collaborator

@ftshijt ftshijt left a comment

Choose a reason for hiding this comment

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

LGTM! Many thanks!

Copy link
Contributor

@sw005320 sw005320 left a comment

Choose a reason for hiding this comment

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

I think it looks good to me.
I have minor comments, so please reflect them in the later PR.

Please also summarize TODOs for the further developments (adding tests, tuning the performance, adding models, etc.)

self.embed = torch.nn.Sequential(
pos_enc_class(output_size, positional_dropout_rate)
)
if input_size == output_size:
Copy link
Contributor

Choose a reason for hiding this comment

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

What’s this?
Can you add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just to handle cases when input and output size is different by simply adding a linear projection to output size. Will add a comment thanks!

@@ -15,8 +15,6 @@ def test_Encoder_forward_backward(input_layer, positionwise_layer_type):
)
if input_layer == "embed":
x = torch.randint(0, 10, [2, 10])
elif input_layer is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no need for a special test for input_layer none. It is handled due to the changes I made in transformer_encoder.py

@sw005320 sw005320 added this to the v.0.10.7 milestone Feb 27, 2022
@sw005320 sw005320 merged commit 640327b into espnet:master Feb 27, 2022
@sw005320
Copy link
Contributor

I think it looks good to me. I have minor comments, so please reflect them in the later PR.

Please also summarize TODOs for the further developments (adding tests, tuning the performance, adding models, etc.)

We should also add some documents.

@ftshijt
Copy link
Collaborator

ftshijt commented Feb 27, 2022

The roadmap may be updated here #3988

@pyf98
Copy link
Collaborator

pyf98 commented Feb 27, 2022

Thanks. I've started my initial experiment on IWSLT'14 De-En.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants