Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Memoize beam hypos on the way #1267

Merged
merged 4 commits into from Nov 3, 2018
Merged

Memoize beam hypos on the way #1267

merged 4 commits into from Nov 3, 2018

Conversation

uralik
Copy link
Contributor

@uralik uralik commented Nov 2, 2018

So actually previous way of getting current hypos was terrible (I did it so yeah, terrible), with ngram block 7 speed was like this on twitter:

33s elapsed: {'exs': 32, '%done': '0.31%', 'time_left': '10717s', 'accuracy': 0, 'f1': 0.08652, 'bleu': 5.141e-06, 'token_acc': 0.3022, 'loss': 4.142, 'ppl': 62.91}                                                                                                                                                        
60s elapsed: {'exs': 64, '%done': '0.62%', 'time_left': '9728s', 'accuracy': 0, 'f1': 0.07378, 'bleu': 5.256e-06, 'token_acc': 0.3022, 'loss': 4.177, 'ppl': 65.2}                                                                                                                                                          
109s elapsed: {'exs': 96, '%done': '0.92%', 'time_left': '11792s', 'accuracy': 0, 'f1': 0.08872, 'bleu': 0.004175, 'token_acc': 0.3049, 'loss': 4.102, 'ppl': 60.47}                                                                                                                                                        
159s elapsed: {'exs': 128, '%done': '1.23%', 'time_left': '12795s', 'accuracy': 0, 'f1': 0.08498, 'bleu': 0.003132, 'token_acc': 0.3106, 'loss': 4.014, 'ppl': 55.35}

with new hyps cache it is like this:

2s elapsed: {'exs': 32, '%done': '0.31%', 'time_left': '704s', 'accuracy': 0, 'f1': 0.08652, 'bleu': 5.141e-06, 'token_acc': 0.3022, 'loss': 4.142, 'ppl': 62.91}                                                                                                                                                          
6s elapsed: {'exs': 96, '%done': '0.92%', 'time_left': '733s', 'accuracy': 0, 'f1': 0.08872, 'bleu': 0.004175, 'token_acc': 0.3049, 'loss': 4.102, 'ppl': 60.47}                                                                                                                                                           
9s elapsed: {'exs': 128, '%done': '1.23%', 'time_left': '767s', 'accuracy': 0, 'f1': 0.08498, 'bleu': 0.003132, 'token_acc': 0.3106, 'loss': 4.014, 'ppl': 55.35}                                                                                                                                                          
11s elapsed: {'exs': 160, '%done': '1.54%', 'time_left': '758s', 'accuracy': 0, 'f1': 0.07828, 'bleu': 0.002505, 'token_acc': 0.2996, 'loss': 4.15, 'ppl': 63.41}

my bad

@uralik uralik merged commit 6251f6b into master Nov 3, 2018
@uralik uralik deleted the current-hypos branch November 3, 2018 14:54
stephenroller added a commit that referenced this pull request Nov 5, 2018
stephenroller added a commit that referenced this pull request Nov 13, 2018
stephenroller added a commit that referenced this pull request Nov 15, 2018
stephenroller added a commit that referenced this pull request Nov 15, 2018
* Dab.

* Simple code movement. Nothing generalizes.

* More code cut-paste.

* Docstring formatting.

* Moderate reorganization; minor docstring formatting.

* A little bit closer.

* Simplfiy slightly.

* Opinionated formatting.

* Beam search seems works for transformer, broken for seq2seq.

* Finally move the time iteration into decode for seq2seq.

* Fix some bugs around loading saved models.

* Support skipping generation for faster ppl-only validation.

* Move --input-dropout to seq2seq

* Support incremental decoding.

* Name be changin'

* Support multigpu. Integrate in Abi's fixes.

* Fix ranked candidates

* Dead code society.

* warn_once

* Lint.

* Forgot to reorder and select incremental states.

* More multigpu workarounds.

* lint.

* Be consistent in initialization.

* Make sure outputlayer has backwards compatibility.

* Bring #1267 into this branch.

* Add fast termination in greedy_decode. Bring back _init_cuda_buffer

* Fix bugs in hogwild

* Address review comments.

* Whoops forgot a cuda call.

* Simplify output layer since binary compatibility is no longer needed.

* Seq2seq version bump. (#1282)

* Seq2seq version bump.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants