CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

problem in training LM by LSTM using multiple gpus

Open summerqing opened this issue 10 years ago • 3 comments

hi,I have run successfully the CNTK/Examples/Other/Simple2d on multiple gpus. However,when I was using cntk to train a lstm-structured **Langauge Model,**a bug would occur such as followings which terminated the training process:

Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented. LMSequenceReader: Reading epoch data...LMSequenceReader: Reading epoch data... 5276 sequences read. Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented. 5276 sequences read. Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

EXCEPTION occurred: Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

[CALL STACK] [0x7fa8238e35cc] Microsoft::MSR::CNTK::Matrix:: AssignRowSliceValuesOf (Microsoft::MSR::CNTK::Matrix const&, unsigned long, unsigned long) + 0x17c [0x798b6f] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatch (Microsoft::MSR::CNTK::StreamMinibatchInputs const&, Microsoft::MSR::CNTK::StreamMinibatchInputs&, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout&, unsigned long, unsigned long) + 0x29f [0x799022] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatchInPlace (Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long, unsigned long, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout) + 0x122 [0x799787] bool Microsoft::MSR::CNTK::DataReaderHelpers:: GetMinibatchIntoNetwork (Microsoft::MSR::CNTK::IDataReader&, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, bool, bool, Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0x2a7 [0x79b237] Microsoft::MSR::CNTK::SimpleEvaluator:: Evaluate (Microsoft::MSR::CNTK::IDataReader_, std::vectorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>,std::allocatorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>>> const&, unsigned long, unsigned long) + 0x7e7 [0x7a342f] Microsoft::MSR::CNTK::SGD:: TrainOrAdaptModel (int, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, bool, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_) + 0x171f [0x7a5aa0] Microsoft::MSR::CNTK::SGD:: Train (std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_, bool) + 0x200 [0x7adf50] void DoTrain Microsoft::MSR::CNTK::ConfigParameters,float(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x2a0 [0x5e88b8] void DoCommands (Microsoft::MSR::CNTK::ConfigParameters const&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0xb08 [0x58658d] wmainOldCNTKConfig (int, wchar_t__) + 0xe4d [0x586df7] wmain1 (int, wchar_t_*) + 0x87 [0x57a3e8] main + 0xd8 [0x7fa821c01b15] __libc_start_main + 0xf5 [0x57e1d5]

EXCEPTION occurred: Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

[CALL STACK] [0x7fa7643705cc] Microsoft::MSR::CNTK::Matrix:: AssignRowSliceValuesOf (Microsoft::MSR::CNTK::Matrix const&, unsigned long, unsigned long) + 0x17c [0x798b6f] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatch (Microsoft::MSR::CNTK::StreamMinibatchInputs const&, Microsoft::MSR::CNTK::StreamMinibatchInputs&, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout&, unsigned long, unsigned long) + 0x29f [0x799022] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatchInPlace (Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long, unsigned long, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout) + 0x122 [0x799787] bool Microsoft::MSR::CNTK::DataReaderHelpers:: GetMinibatchIntoNetwork (Microsoft::MSR::CNTK::IDataReader&, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, bool, bool, Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0x2a7 [0x79b237] Microsoft::MSR::CNTK::SimpleEvaluator:: Evaluate (Microsoft::MSR::CNTK::IDataReader_, std::vectorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>,std::allocatorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>>> const&, unsigned long, unsigned long) + 0x7e7 [0x7a342f] Microsoft::MSR::CNTK::SGD:: TrainOrAdaptModel (int, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, bool, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_) + 0x171f [0x7a5aa0] Microsoft::MSR::CNTK::SGD:: Train (std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_, bool) + 0x200 [0x7adf50] void DoTrain Microsoft::MSR::CNTK::ConfigParameters,float(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x2a0 [0x5e88b8] void DoCommands (Microsoft::MSR::CNTK::ConfigParameters const&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0xb08 [0x58658d] wmainOldCNTKConfig (int, wchar_t__) + 0xe4d [0x586df7] wmain1 (int, wchar_t_*) + 0x87 [0x57a3e8] main + 0xd8 [0x7fa76268eb15] __libc_start_main + 0xf5 [0x57e1d5]

EXCEPTION occurred: Inside File: Source/Math/Matrix.cpp Line: 1752 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

[CALL STACK] [0x7fc1d80225cc] Microsoft::MSR::CNTK::Matrix:: AssignRowSliceValuesOf (Microsoft::MSR::CNTK::Matrix const&, unsigned long, unsigned long) + 0x17c [0x798b6f] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatch (Microsoft::MSR::CNTK::StreamMinibatchInputs const&, Microsoft::MSR::CNTK::StreamMinibatchInputs&, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout&, unsigned long, unsigned long) + 0x29f [0x799022] std::pair<unsigned long,unsigned long> Microsoft::MSR::CNTK::DataReaderHelpers:: DecimateMinibatchInPlace (Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long, unsigned long, std::shared_ptrMicrosoft::MSR::CNTK::MBLayout) + 0x122 [0x799787] bool Microsoft::MSR::CNTK::DataReaderHelpers:: GetMinibatchIntoNetwork (Microsoft::MSR::CNTK::IDataReader&, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, bool, bool, Microsoft::MSR::CNTK::StreamMinibatchInputs&, unsigned long&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0x2a7 [0x79b237] Microsoft::MSR::CNTK::SimpleEvaluator:: Evaluate (Microsoft::MSR::CNTK::IDataReader_, std::vectorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>,std::allocatorstd::basic_string<wchar_t,std::char_traits<wchar_t,std::allocator<wchar_t>>>> const&, unsigned long, unsigned long) + 0x7e7 [0x7a342f] Microsoft::MSR::CNTK::SGD:: TrainOrAdaptModel (int, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, bool, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_) + 0x171f [0x7a5aa0] Microsoft::MSR::CNTK::SGD:: Train (std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_, bool) + 0x200 [0x7adf50] void DoTrain Microsoft::MSR::CNTK::ConfigParameters,float(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x2a0 [0x5e88b8] void DoCommands (Microsoft::MSR::CNTK::ConfigParameters const&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0xb08 [0x58658d] wmainOldCNTKConfig (int, wchar_t__) + 0xe4d [0x586df7] wmain1 (int, wchar_t_*) + 0x87 [0x57a3e8] main + 0xd8 [0x7fc1d6340b15] __libc_start_main + 0xf5 [0x57e1d5]

Meanwhile,I set the parallel block as: ParallelTrain=[ parallelizationMethod = "DataParallelSGD" parallelizationStartEpoch = 2

                dataParallelSGD = [ 
                    gradientBits = 1 
                 ]
        ]

**

Could you give me a hint for what is going wrong?**

summerqing avatar May 03 '16 09:05 summerqing

when you do the dataParallelSGD, would you please turn on the distributedMBReading ? The current decimation operation is broken.

See document at

https://github.com/Microsoft/CNTK/wiki/Multiple-GPUs-and-machines

yqwangustc avatar May 04 '16 18:05 yqwangustc

Actually, currently even with distributedMBReading turned on, the code breaks as distributed reading in LMSequenceReader is not yet supported in the master.

Thanks, Abhik

From: Yongqiang Wang [mailto:[email protected]] Sent: Wednesday, May 4, 2016 11:24 AM To: Microsoft/CNTK [email protected] Subject: Re: [Microsoft/CNTK] problem in training LM by LSTM using multiple gpus (#429)

when you do the dataParallelSGD, would you please turn on the distributedMBReading ? The current decimation operation is broken.

See document at

https://github.com/Microsoft/CNTK/wiki/Multiple-GPUs-and-machines

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/429#issuecomment-216955831

alahiri-quora avatar May 04 '16 18:05 alahiri-quora

The issue has been dormant for a long while. Please open a new issue if you still experience problems in the latest release.

wolfma61 avatar Jun 29 '17 12:06 wolfma61