diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2018-01-09 01:06:21 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2018-01-09 01:06:21 +0300 |
commit | 2f807f7af17ee823127754b31db5f2e77276b83c (patch) | |
tree | 72e9220f754ad440609b4f0c7f2707488cbe70c6 | |
parent | f419454363e030bb34d4701e524068a049b4d914 (diff) |
tweak SentencesToGet()
-rw-r--r-- | src/amun/gpu/decoder/encoder_decoder.cu | 16 | ||||
-rw-r--r-- | src/amun/gpu/dl4mt/decoder.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/amun/gpu/decoder/encoder_decoder.cu b/src/amun/gpu/decoder/encoder_decoder.cu index 39ed4696..1fe77a35 100644 --- a/src/amun/gpu/decoder/encoder_decoder.cu +++ b/src/amun/gpu/decoder/encoder_decoder.cu @@ -215,7 +215,7 @@ void EncoderDecoder::DecodeAsyncInternal() histories.SetNewBeamSize(maxBeamSize); //HANDLE_ERROR( cudaStreamSynchronize(mblas::CudaStreamHandler::GetStream())); //cerr << "DecodeAsyncInternal4" << endl; - std::cerr << "histories4=" << histories.Debug(1) << std::endl; + //std::cerr << "histories4=" << histories.Debug(1) << std::endl; //std::cerr << "state2=" << state->Debug(0) << std::endl; //std::cerr << "nextState2=" << nextState->get<EDState>().GetStates().output->Debug(0) << std::endl; @@ -252,7 +252,7 @@ void EncoderDecoder::DecodeAsyncInternal() //cerr << "DecodeAsyncInternal8" << endl; //std::cerr << "histories8=" << histories.Debug(1) << std::endl; - //LOG(progress)->info(" Step {} took {} sentences {} hypos {}", step++, timerStep.format(5, "%w"), histories.NumActive(), histories.GetTotalBeamSize()); + LOG(progress)->info(" Step {} took {} sentences {} hypos {}", step++, timerStep.format(5, "%w"), histories.NumActive(), histories.GetTotalBeamSize()); } } @@ -609,14 +609,14 @@ void EncoderDecoder::AssembleBeamStateTopup(const Histories& histories, unsigned EncoderDecoder::SentencesToGet(const Histories& histories) { - ///* + /* unsigned ret = god_.Get<unsigned>("mini-batch") - histories.NumActive(); return ret; - //*/ - /* + */ + ///* BEGIN_TIMER("SentencesToGet"); - const unsigned MIN_ACTIVE = 80; + const unsigned MIN_ACTIVE = 119; unsigned beamSize = god_.Get<unsigned>("beam-size"); unsigned numHypos = histories.GetTotalBeamSize(); @@ -627,7 +627,7 @@ unsigned EncoderDecoder::SentencesToGet(const Histories& histories) unsigned currSize = start; for (; currSize < histories.size(); ++currSize) { unsigned numNewSent = currSize - histories.NumActive(); - unsigned numNewHypos = numNewSent * beamSize; + unsigned numNewHypos = numNewSent; if ((numHypos + numNewHypos) % 8 == 0) { if ((histories.NumActive() + numNewSent) % 8 == 0) { PAUSE_TIMER("SentencesToGet"); @@ -652,7 +652,7 @@ unsigned EncoderDecoder::SentencesToGet(const Histories& histories) PAUSE_TIMER("SentencesToGet"); return ret; - */ + //*/ } } diff --git a/src/amun/gpu/dl4mt/decoder.h b/src/amun/gpu/dl4mt/decoder.h index 05992cce..bea6e2a0 100644 --- a/src/amun/gpu/dl4mt/decoder.h +++ b/src/amun/gpu/dl4mt/decoder.h @@ -423,11 +423,11 @@ private: Probs.NewSize(T1_.dim(0), w4->dim(1)); //PAUSE_TIMER("GetProbs.NewSize"); - + /* std::cerr << "\t Probs=" << Probs.Debug(0) << " "; // << std::endl; std::cerr << "T1_=" << T1_.Debug(0) << " "; // << std::endl; std::cerr << "w4=" << w4->Debug(0) << std::endl; - + */ BEGIN_TIMER("GetProbs.Prod4"); Prod(Probs, T1_, *w4); PAUSE_TIMER("GetProbs.Prod4"); |