Add lexical shortlists to marian-server (#560)

* Add lexical shortlists to marian-server

* Update CHANGELOG
This commit is contained in:
Roman Grundkiewicz 2019-12-06 03:41:36 +00:00 committed by Marcin Junczys-Dowmunt
parent 734a8791dd
commit c343ced9e1
2 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Added
- Support for lexical shortlists in marian-server
- Support for 8-bit matrix multiplication with FBGEMM
- CMakeLists.txt now looks for SSE 4.2
- Purging of finished hypotheses during beam-search. A lot faster for large batches.

View File

@ -175,6 +175,7 @@ private:
std::vector<Ptr<Vocab>> srcVocabs_;
Ptr<Vocab> trgVocab_;
Ptr<const data::ShortlistGenerator> shortlistGenerator_;
size_t numDevices_;
@ -199,6 +200,11 @@ public:
trgVocab_ = New<Vocab>(options_, vocabPaths.size() - 1);
trgVocab_->load(vocabPaths.back());
// load lexical shortlist
if(options_->hasAndNotEmpty("shortlist"))
shortlistGenerator_ = New<data::LexicalShortlistGenerator>(
options_, srcVocabs_.front(), trgVocab_, 0, 1, vocabPaths.front() == vocabPaths.back());
// get device IDs
auto devices = Config::getDevices(options_);
numDevices_ = devices.size();
@ -218,8 +224,11 @@ public:
graphs_.push_back(graph);
auto scorers = createScorers(options_);
for(auto scorer : scorers)
for(auto scorer : scorers) {
scorer->init(graph);
if(shortlistGenerator_)
scorer->setShortlistGenerator(shortlistGenerator_);
}
scorers_.push_back(scorers);
}
}