When I test rnn.cntk, I get some ‘CUDA failure 11: invalid argument’ and ‘cannot open word class file’
I change ptb.small.train.txt,ptb.small.valid.txt,ptb.small.test.txt,and modified confVocabSize,then cntk configFile=rnn.cntk,I face two different error in two different times
first time:
EXCEPTION occurred: cannot open word class file
second time:
CUDA failure 11: invalid argument ; GPU=0 ; hostname=DESKTOP-HP8MUOF ; expr=cudaMemcpy(ColLocation(), h_CSCCol, ColSize(), kind) EXCEPTION occurred: CUDA failure 11: invalid argument ; GPU=0 ; hostname=DESKTOP-HP8MUOF ; expr=cudaMemcpy(ColLocation(), h_CSCCol, ColSize(), kind)
Are you able to run the sample successfully in its original unmodified form?
I'm having a similar issue, with the PennTreebank example unmodified. I'm running Ubuntu 14.04 on a 4GB GTX 960. I thought maybe my card had insufficient memory, so I scaled down the train model to 1024 lines, layerSizes = "$confVocabSize$:25:35:4000" In that case I still get a similar crash at the start of epoch 6 instead of 4 as with the former case. The models run fine on the CPU.
DetermineSequencesToProcess: 1 sequences of len 39, 39 tokens
DetermineSequencesToProcess: 1 sequences of len 26, 26 tokens
DetermineSequencesToProcess: 1 sequences of len 25, 25 tokens
DetermineSequencesToProcess: 1 sequences of len 15, 15 tokens
DetermineSequencesToProcess: 1 sequences of len 13, 13 tokens
DetermineSequencesToProcess: 1 sequences of len 10, 10 tokens
DetermineSequencesToProcess: 0 sequences of len 0, 0 tokens
LMSequenceReader: Reading epoch data... 0 sequences read.
Final Results: Minibatch[1-3370]: Samples Seen = 73760 TrainNodeClassBasedCrossEntropy: ClassBasedCrossEntropyWithSoftmax/Sample = 5.212208 Perplexity = 183.49877
Finished Epoch[ 3 of 16]: [Validation Set] TrainLossPerSample = 5.212208
Loading previous model with best training-criterion value: ../Output/Models/rnn.dnn.2.
learnRatePerSample reduced to 0.050000001
SGD: Saving checkpoint model '../Output/Models/rnn.dnn.3'
Starting Epoch 4: learning rate per sample = 0.050000 effective momentum = 0.000000 momentum as time constant = 0.0 samples
Starting minibatch loop. LMSequenceReader: Reading epoch data... 2157 sequences read. DetermineSequencesToProcess: 10 sequences of len 11, 110 tokens
[CALL STACK]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::CollectCallStack(std::function<void (std::string)> const&, std::function<void ()> const&) + 0x101 ) [0x7fb67014c401]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::PrintCallStack() + 0x88 ) [0x7fb67014c898]
cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::runtime_error(char const_, ...) + 0xe2 ) [0x541902]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( + 0x29d317) [0x7fb6700ff317]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::GPUSparseMatrix
error with smaller model size:
DetermineSequencesToProcess: 1 sequences of len 30, 30 tokens
DetermineSequencesToProcess: 1 sequences of len 18, 18 tokens
DetermineSequencesToProcess: 1 sequences of len 15, 15 tokens
DetermineSequencesToProcess: 1 sequences of len 16, 16 tokens
DetermineSequencesToProcess: 1 sequences of len 12, 12 tokens
DetermineSequencesToProcess: 1 sequences of len 14, 14 tokens
DetermineSequencesToProcess: 0 sequences of len 0, 0 tokens
LMSequenceReader: Reading epoch data... 0 sequences read.
Final Results: Minibatch[1-32]: Samples Seen = 722 TrainNodeClassBasedCrossEntropy: ClassBasedCrossEntropyWithSoftmax/Sample = 5.3909358 Perplexity = 219.40862
Finished Epoch[ 5 of 16]: [Validation Set] TrainLossPerSample = 5.3909358
Loading previous model with best training-criterion value: ../Output/Models/rnn.dnn.4.
learnRatePerSample reduced to 0.050000001
SGD: Saving checkpoint model '../Output/Models/rnn.dnn.5'
Starting Epoch 6: learning rate per sample = 0.050000 effective momentum = 0.000000 momentum as time constant = 0.0 samples
Starting minibatch loop. LMSequenceReader: Reading epoch data... 1024 sequences read. DetermineSequencesToProcess: 10 sequences of len 10, 100 tokens
[CALL STACK]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::CollectCallStack(std::function<void (std::string)> const&, std::function<void ()> const&) + 0x101 ) [0x7fd304b4a401]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::PrintCallStack() + 0x88 ) [0x7fd304b4a898]
cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::runtime_error(char const_, ...) + 0xe2 ) [0x541902]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( + 0x29d317) [0x7fd304afd317]
/usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::GPUSparseMatrix
Interestingly enough, even at 5 epochs the 8-core AMD or hyperthread i7 CPU is several times faster than the GPU. Why would this be? (with a minibatch size of 256 on the CPU)
This may be Issue #177 (numeric overflow in gcc build due to different value of RAND_MAX on VS vs. gcc). In some cases, this led to shuffling data from out of bounds.
In SequenceReader.cpp: BatchSequenceReader
#ifdef _MSC_VER // make some old configurations reproducable (m_cacheBlockSize used to be a constant) --TODO: remove in a few months if (m_cacheBlockSize == 50000) { std::random_shuffle(m_parser.mSentenceIndex2SentenceInfo.begin(), m_parser.mSentenceIndex2SentenceInfo.end()); // Note: random_shuffle is deprecated since C++14. } else // new configs use a wider randomization #endif { std::random_device rd; std::mt19937 g(rd()); std::shuffle(m_parser.mSentenceIndex2SentenceInfo.begin(), m_parser.mSentenceIndex2SentenceInfo.end(), g); }
From: ianupright [mailto:[email protected]] Sent: Tuesday, March 1, 2016 15:18 To: Microsoft/CNTK [email protected] Subject: Re: [CNTK] When I test rnn.cntk, I get some ‘CUDA failure 11: invalid argument’ and ‘cannot open word class file’ (#124)
I'm having a similar issue, with the PennTreebank example unmodified. I'm running Ubuntu 14.04 on a 4GB GTX 960. I thought maybe my card had insufficient memory, so I scaled down the train model to 1024 lines, layerSizes = "$confVocabSize$:25:35:4000" In that case I still get a similar crash at epoch 5 instead of 3 as with the former case.
DetermineSequencesToProcess: 1 sequences of len 39, 39 tokens DetermineSequencesToProcess: 1 sequences of len 26, 26 tokens DetermineSequencesToProcess: 1 sequences of len 25, 25 tokens DetermineSequencesToProcess: 1 sequences of len 15, 15 tokens DetermineSequencesToProcess: 1 sequences of len 13, 13 tokens DetermineSequencesToProcess: 1 sequences of len 10, 10 tokens DetermineSequencesToProcess: 0 sequences of len 0, 0 tokens LMSequenceReader: Reading epoch data... 0 sequences read. Final Results: Minibatch[1-3370]: Samples Seen = 73760 TrainNodeClassBasedCrossEntropy: ClassBasedCrossEntropyWithSoftmax/Sample = 5.212208 Perplexity = 183.49877
Finished Epoch[ 3 of 16]: [Validation Set] TrainLossPerSample = 5.212208 Loading previous model with best training-criterion value: ../Output/Models/rnn.dnn.2. learnRatePerSample reduced to 0.050000001 SGD: Saving checkpoint model '../Output/Models/rnn.dnn.3' Starting Epoch 4: learning rate per sample = 0.050000 effective momentum = 0.000000 momentum as time constant = 0.0 samples
Starting minibatch loop. LMSequenceReader: Reading epoch data... 2157 sequences read. DetermineSequencesToProcess: 10 sequences of len 11, 110 tokens
[CALL STACK] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::CollectCallStack(std::function const&, std::function const&) + 0x101 ) [0x7fb67014c401] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::PrintCallStack() + 0x88 ) [0x7fb67014c898] cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::runtime_error(char const, ...) + 0xe2 ) [0x541902] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( + 0x29d317) [0x7fb6700ff317] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::GPUSparseMatrix::SetValue(Microsoft::MSR::CNTK::CPUSparseMatrix const&) + 0x88 ) [0x7fb670116e58] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::Matrix::_transferFromDeviceToDevice(int, int, bool, bool) const + 0x4c1 ) [0x7fb67003d3a1] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::Matrix::TransferFromDeviceToDevice(int, int, bool, bool, bool) const + 0x18 ) [0x7fb67003d8c8] /usr/local/cntk/build/release/bin/../lib/LMSequenceReader.so ( Microsoft::MSR::CNTK::BatchSequenceReader::GetMinibatch(std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&) + 0x4f7 ) [0x7fb65d55e1b7] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::DataReader::GetMinibatch(std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&) + 0x61 ) [0x7fb670145661] cntk ( bool Microsoft::MSR::CNTK::DataReaderHelpers::GetMinibatchIntoNetwork(Microsoft::MSR::CNTK::IDataReader&, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, bool, bool, std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&, unsigned long&) + 0x57 ) [0x722787] cntk ( Microsoft::MSR::CNTK::SGD::TrainOneEpoch(std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase const&, int, unsigned long, Microsoft::MSR::CNTK::IDataReader, double, unsigned long, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::Computatio nNodeBas e > > const&, std::map::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) + 0x1218) [0x72b338] cntk ( Microsoft::MSR::CNTK::SGD::Train(std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader, Microsoft::MSR::CNTK::IDataReader, bool) + 0x424 ) [0x72d184] cntk ( void DoTrain(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x22c ) [0x74df4c] cntk ( void DoCommands(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x804 ) [0x598814] cntk ( wmainOldCNTKConfig(int, wchar_t) + 0xad1 ) [0x53b421] cntk ( wmain1(int, wchar_t) + 0x70 ) [0x53b8b0] cntk ( main + 0xd8 ) [0x530598] /lib/x86_64-linux-gnu/libc.so.6 ( __libc_start_main + 0xf5 ) [0x7fb66ed9bec5] cntk ( ) [0x534364] CUDA failure 11: invalid argument ; GPU=0 ; hostname=s02 ; expr=cudaMemcpy(ColLocation(), h_CSCCol, ColSize(), kind) EXCEPTION occurred: CUDA failure 11: invalid argument ; GPU=0 ; hostname=strong02.cluster.semanticideas.com ; expr=cudaMemcpy(ColLocation(), h_CSCCol, ColSize(), kind)
error with smaller model size:
DetermineSequencesToProcess: 1 sequences of len 30, 30 tokens DetermineSequencesToProcess: 1 sequences of len 18, 18 tokens DetermineSequencesToProcess: 1 sequences of len 15, 15 tokens DetermineSequencesToProcess: 1 sequences of len 16, 16 tokens DetermineSequencesToProcess: 1 sequences of len 12, 12 tokens DetermineSequencesToProcess: 1 sequences of len 14, 14 tokens DetermineSequencesToProcess: 0 sequences of len 0, 0 tokens LMSequenceReader: Reading epoch data... 0 sequences read. Final Results: Minibatch[1-32]: Samples Seen = 722 TrainNodeClassBasedCrossEntropy: ClassBasedCrossEntropyWithSoftmax/Sample = 5.3909358 Perplexity = 219.40862
Finished Epoch[ 5 of 16]: [Validation Set] TrainLossPerSample = 5.3909358 Loading previous model with best training-criterion value: ../Output/Models/rnn.dnn.4. learnRatePerSample reduced to 0.050000001 SGD: Saving checkpoint model '../Output/Models/rnn.dnn.5' Starting Epoch 6: learning rate per sample = 0.050000 effective momentum = 0.000000 momentum as time constant = 0.0 samples
Starting minibatch loop. LMSequenceReader: Reading epoch data... 1024 sequences read. DetermineSequencesToProcess: 10 sequences of len 10, 100 tokens
[CALL STACK] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::CollectCallStack(std::function const&, std::function const&) + 0x101 ) [0x7fd304b4a401] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error::PrintCallStack() + 0x88 ) [0x7fd304b4a898] cntk ( void Microsoft::MSR::CNTK::ThrowFormattedstd::runtime_error(char const, ...) + 0xe2 ) [0x541902] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( + 0x29d317) [0x7fd304afd317] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::GPUSparseMatrix::SetValue(Microsoft::MSR::CNTK::CPUSparseMatrix const&) + 0x88 ) [0x7fd304b14e58] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::Matrix::_transferFromDeviceToDevice(int, int, bool, bool) const + 0x4c1 ) [0x7fd304a3b3a1] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::Matrix::TransferFromDeviceToDevice(int, int, bool, bool, bool) const + 0x18 ) [0x7fd304a3b8c8] /usr/local/cntk/build/release/bin/../lib/LMSequenceReader.so ( Microsoft::MSR::CNTK::BatchSequenceReader::GetMinibatch(std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&) + 0x4f7 ) [0x7fd2f1f1a1b7] /usr/local/cntk/build/release/bin/../lib/libcntkmath.so ( Microsoft::MSR::CNTK::DataReader::GetMinibatch(std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&) + 0x61 ) [0x7fd304b43661] cntk ( bool Microsoft::MSR::CNTK::DataReaderHelpers::GetMinibatchIntoNetwork(Microsoft::MSR::CNTK::IDataReader&, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase, bool, bool, std::map, std::allocator >, Microsoft::MSR::CNTK::Matrix, std::less, std::allocator > >, std::allocator, std::allocator > const, Microsoft::MSR::CNTK::Matrix> > >&, unsigned long&) + 0x57 ) [0x722787] cntk ( Microsoft::MSR::CNTK::SGD::TrainOneEpoch(std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNetwork, std::shared_ptrMicrosoft::MSR::CNTK::ComputationNodeBase const&, int, unsigned long, Microsoft::MSR::CNTK::IDataReader, double, unsigned long, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase > > const&, std::vectorstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNodeBase, std::allocatorstd::shared_ptr<Microsoft::MSR::CNTK::Computatio nNodeBas e > > const&, std::map::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) + 0x1218) [0x72b338] cntk ( Microsoft::MSR::CNTK::SGD::Train(std::functionstd::shared_ptr<Microsoft::MSR::CNTK::ComputationNetwork (int)>, int, Microsoft::MSR::CNTK::IDataReader, Microsoft::MSR::CNTK::IDataReader, bool) + 0x424 ) [0x72d184] cntk ( void DoTrain(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x22c ) [0x74df4c] cntk ( void DoCommands(Microsoft::MSR::CNTK::ConfigParameters const&) + 0x804 ) [0x598814] cntk ( wmainOldCNTKConfig(int, wchar_t) + 0xad1 ) [0x53b421] cntk ( wmain1(int, wchar_t) + 0x70 ) [0x53b8b0] cntk ( main + 0xd8 ) [0x530598] /lib/x86_64-linux-gnu/libc.so.6 ( __libc_start_main + 0xf5 ) [0x7fd303789ec5] cntk ( ) [0x534364]
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/124#issuecomment-190956933.
I think you mean #176. Unfortunately that didn't seem help. Since it is at the very beginning of initializing a new epoch it wouldn't seem to be a random problem with the SequenceReader
I pulled the very latest code, released just in the last few days. After rebuilding this problem has gone away. (I believe I was using Feb 26th)
Yes, it just got committed. If the problem is solved, would you mind closing the Issue?
Thanks!
Frank
From: ianupright [mailto:[email protected]] Sent: Tuesday, March 1, 2016 17:53 To: Microsoft/CNTK [email protected] Cc: Frank Seide [email protected] Subject: Re: [CNTK] When I test rnn.cntk, I get some ‘CUDA failure 11: invalid argument’ and ‘cannot open word class file’ (#124)
I pulled the very latest code, released just in the last few days. After rebuilding this problem has gone away.
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/124#issuecomment-191015337.
Fixed. Thanks for the report and for helping to track it down!