CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

problem in running multiple gpu on the newest cntk

Open summerQing307 opened this issue 10 years ago • 6 comments

Hi,I have updated the newest cntk version today. I was trying to use the cntk to train LM by multiple gpus.

I have set the config like this: ParallelTrain=[ parallelizationMethod = "DataParallelSGD" parallelizationStartEpoch = 2

                Additional optional parameters are: useZeroThresholdFor1BitQuantization
                dataParallelSGD = [ 
                    gradientBits = 1 
                 ]
        ]

But,when i was running,i got a bug like the following: EXCEPTION occurred: Inside File: Source/Math/Matrix.cpp Line: 1735 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

[CALL STACK] [0x7f1d21fb9edc] Microsoft::MSR::CNTK::Matrix:: AssignRowSliceValuesOf (Microsoft::MSR::CNTK::Matrix const&, unsigned long, unsigned long) + 0x17c [0x73629c] 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) + 0x22c [0x736cf5] 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) + 0xc5 [0x7373a8] 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&) + 0x458 [0x737cb2] 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) + 0x7a2 [0x73ef99] 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_) + 0x1759 [0x7409c0] Microsoft::MSR::CNTK::SGD:: Train (std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader_, Microsoft::MSR::CNTK::IDataReader_, bool) + 0x310
[0x748828] void DoTrain Microsoft::MSR::CNTK::ConfigParameters,float(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x3c8 [0x5c45a7] void DoCommands (Microsoft::MSR::CNTK::ConfigParameters const&, std::shared_ptrMicrosoft::MSR::CNTK::MPIWrapper const&) + 0x907 [0x564dfa] wmainOldCNTKConfig (int, wchar_t__) + 0x90a [0x565438] wmain1 (int, wchar_t_*) + 0x68 [0x559128] main + 0xd8 [0x7f1d20343b15] __libc_start_main + 0xf5 [0x55ce75] LMSequenceReader: Reading epoch data... 0 sequences read. Finished Epoch[ 1 of 16]: [Training Set] TrainLossPerSample = 5.8850384; TotalSamplesSeen = 228950; AvgLearningRatePerSample = 0.1; EpochTime=34.074 LMSequenceReader: Reading epoch data... 5276 sequences read. Inside File: Source/Math/Matrix.cpp Line: 1735 Function: AssignRowSliceValuesOf -> Feature Not Implemented.

I guess the problem lies in the sparse matrix. Could you help me find the real problem and tell me what may i do to solve the problem to achieve training LM on multiple gpus?

summerQing307 avatar Mar 25 '16 08:03 summerQing307

Are you building from source, using binary? If you are using binary, use gradientBits=1 for 1-bit SGD, else, gradientBits=32. I remember seeing the same error - it was when I was using the non-1bit-SGD binary. Please refer to this issue.

saonim avatar Mar 28 '16 20:03 saonim

@saonim I tested by my config and it seemed not the problem. Thank you so much and could you remember when did you see the same error?

summerQing307 avatar Mar 29 '16 06:03 summerQing307

@frankseide Sorry to ask whether this exception bug is releated to sparse matrix?

summerQing307 avatar Mar 29 '16 07:03 summerQing307

I have the same question, have you fixed it? @summerQing307 Thanks !!

staplesinLA avatar May 20 '16 02:05 staplesinLA

@staplesinLA Hi, this problem is caused by the fact that cntk has not supported the distributedreading for multiple gpus for CLSTM training. You are able to fix this bug by compiling https://github.com/Microsoft/CNTK/tree/alahiri/distrib-reading-LMSequenceReader. However,this is still a confused problem in unix system by running this branch version cntk to train LM model in my case. Welcome to share your results.

summerqing avatar May 20 '16 06:05 summerqing

@summerqing OK, thank you very much!!

staplesinLA avatar May 25 '16 14:05 staplesinLA