GPU多线程sequence inference出core
Created by: shateng
int format_input(paddle_arguments& _in_args, int* sentence_ids, uint64_t ids_count, uint64_t seq_idx) {
paddle_ivector sentence = paddle_ivector_create(
sentence_ids, ids_count, true, useGPU);
CHECK(paddle_arguments_set_ids(_in_args, seq_idx, sentence));
int seq_pos_array[] = {0, ids_count};
paddle_ivector seq_pos = paddle_ivector_create(
seq_pos_array, 2, true, useGPU);
CHECK(paddle_arguments_set_sequence_start_pos(_in_args, seq_idx, 0, seq_pos));
CHECK(paddle_ivector_destroy(seq_pos));
CHECK(paddle_ivector_destroy(sentence));
return 0;
}
format_input(_in_args, &(input_context[0]), input_context.size(), 0);
format_input(_in_args, &(input_sentence[0]), input_sentence.size(), 1);
CHECK(paddle_gradient_machine_forward(_local_machine, _in_args, _out_args, false));
CPU下没有问题,GPU下出core:
Thread [139953379993344] Forwarding decoder_group,
* Aborted at 1543296103 (unix time) try "date -d @1543296103" if you are using GNU date *
PC: @ 0x0 (unknown)* SIGSEGV (@0x29) received by PID 65955 (TID 0x7f496f7fe700) from PID 41; stack trace: *
@ 0x7f49ecd0b160 (unknown) @ 0x7f49eda392db paddle::CpuMatrix::selectRowsImp<>() @ 0x7f49eda36ff6 paddle::CpuMatrix::selectRows() @ 0x7f49ed82231e paddle::RecurrentGradientMachine::selectRowsOneTime() @ 0x7f49ed82bd51 paddle::RecurrentGradientMachine::reorganizeInput() @ 0x7f49ed82bfff paddle::RecurrentGradientMachine::forward() @ 0x7f49ed841903 paddle::RecurrentLayerGroup::forward() @ 0x7f49ed80d87d paddle::NeuralNetwork::forward() @ 0x7f49ed7b0556 paddle_gradient_machine_forward @ 0x45a36e BeamSearch::_forward_calulation() @ 0x45b5a0 BeamSearch::gen_sentences() @ 0x46358e feed_smart_compose::ServiceImpl::proc() @ 0x4576c5 feed_smart_compose::FSC_Service::CallMethod() @ 0x59404e baidu::rpc::policy::ProcessHttpRequest() @ 0x54a25a baidu::rpc::ProcessInputMessage() @ 0x54afab baidu::rpc::InputMessenger::OnNewMessages() @ 0x485cad baidu::rpc::Socket::ProcessEvent() @ 0x5faeda bthread::TaskGroup::task_runner() @ 0x5f2381 bthread_make_fcontext Segmentation fault