question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug with beam-size=1?

See original GitHub issue

In trying to get tests to passing with scoring (#538), I have turned up some weird behavior with scores output by Sockeye. Here are two commands using a transformer model built in the system tests. Notice:

  • The invocations differ only in the beam size (1 or 2)
  • --skip-topk is not enabled
  • With beam size of 1, the scores output should be impossible, since Sockeye outputs negative logprobs.

Any ideas?

CC: @bricksdont

$ python3 -m sockeye.translate -i src --output-type translation_with_score --use-cpu -m model --beam-size 1 2> /dev/null | head
-10.556	7 5 2 7 3 6 5 4 7 7
-10.727	9 2 4 1 6 7 8 6 8
-12.788	8 6 8 7
-10.413	0 5 0 7 5 9 0 6 3 1
-10.731	7 9 2 6 8 5 0 6 5
-12.490	5 6 3 2
-inf	
-11.242	3 9 1 3 8 7
-15.759	2 1
-10.506	8 8 8 2 4 4 5 5 2 5
$ python3 -m sockeye.translate -i src --output-type translation_with_score --use-cpu -m model --beam-size 2 2> /dev/null | head
0.003	7 5 2 7 3 6 5 4 7 7
0.001	9 2 4 1 6 7 8 6 8
0.000	8 6 8 7
0.002	0 5 0 7 5 9 0 6 3 1
0.001	7 9 2 6 8 5 0 6 5
0.001	5 6 3 2
-inf	
0.001	3 9 1 3 8 7
0.001	2 1
0.002	8 8 8 2 4 4 5 5 2 5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
tdomhancommented, Sep 27, 2018

good point regarding beam size 1. What if we changed sockeye.translate to only enable softmax skipping if the user does not specify an output handler, which uses the score?

1reaction
bricksdontcommented, Sep 26, 2018

Yes - skip_softmax is enabled by default for beam size 1. Initially, this was a CLI option, but after some discussion we changed it to default:

PR Discussion: https://github.com/awslabs/sockeye/pull/519 Commit: https://github.com/awslabs/sockeye/pull/519/commits/5c05dc3de1686303787fb7b2d17ad9037ac4564e

I think we simply never considered scoring as a usecase so far. If there is consensus to change it back to optional for inference, I will open a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How we can perform greddy decoding with espnet ? · Issue #2471 ...
Hi, I would like to know if it is possible to perform gready decoding for ASR, instead of using beam search decoding. Thank...
Read more >
Crafting error with Extra Booster, PD Beams size 1
PD Beam, size 1 with Extra Booster, gives 1 place, so from 0 to 1 If you install any booster, no matter which...
Read more >
What kind of bug is that? - PestWorld.org
Guide to identify bugs like centipedes, millipedes, earwigs, crickets, pillbugs, silverfish and box elder bugs. What to look for, where to spot them...
Read more >
trax-ml/community - Gitter
I get it to output arrays with 99+% first tokens. Meaning: All beams for the entire batch: First token is correct. Then basically...
Read more >
Sequence-to-Sequence Learning for End-to-End Program ...
We evaluate SEQUENCER on. 4,711 independent real bug fixes, as well on the Defects4J benchmark used in program repair research. SEQUENCER is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found