Skip to content

Commit

Permalink
Adding more tests and fixing bugs in the randomizer/packer
Browse files Browse the repository at this point in the history
  • Loading branch information
eldakms authored and mahilleb-msft committed Jan 16, 2017
1 parent b7c7857 commit 66f4d8d
Show file tree
Hide file tree
Showing 5 changed files with 667 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Source/Readers/ReaderLib/SequencePacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void SequencePacker::SetConfiguration(const ReaderConfiguration& config, const s
if (m_useLocalTimeline)
{
// Set global minibatch size to max and local minibatch per worker.
bool shouldAddOneSample = m_localMinibatchSizeInSamples % m_config.m_numberOfWorkers > m_config.m_workerRank;
bool shouldAddOneSample = (int)m_config.m_minibatchSizeInSamples % m_config.m_numberOfWorkers > m_config.m_workerRank;
m_localMinibatchSizeInSamples = (int)m_config.m_minibatchSizeInSamples / (int)m_config.m_numberOfWorkers + (shouldAddOneSample ? 1 : 0);
m_globalMinibatchSizeInSamples = SIZE_MAX;

Expand Down
3 changes: 2 additions & 1 deletion Source/Readers/ReaderLib/SequenceRandomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ namespace Microsoft { namespace MSR { namespace CNTK {
sequences.clear();

size_t totalSamplesRead = 0;
while (m_currentChunkCursor < m_randomizedChunks.size())
while (m_currentChunkCursor < m_randomizedChunks.size() &&
globalSamplesLeft > 0 && localSamplesLeft > 0)
{
size_t sequenceOffsetInsideChunk = m_currentSequenceCursor - m_randomizedChunks[m_currentChunkCursor].m_sequencePositionStart;
const RandomizedSequenceDescription* sequence = &m_sequenceWindow[m_currentChunkCursor - m_chunkWindowBegin][sequenceOffsetInsideChunk];
Expand Down
46 changes: 37 additions & 9 deletions Tests/EndToEndTests/UnitTests/ReaderTests/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Current working directory is now: d:/TestPreparation/Speech/AN4Corpus/v0
reading script file ./glob_0000.scp ... 948 entries
total 132 state names in state list ./state.list
htkmlfreader: reading MLF file ./glob_0000.mlf ... total 948 entries
biggrowablevectorarray: creating disk backup store at 'F:\cygwin64\tmp\CNT7688.tmp'
biggrowablevectorarray: creating disk backup store at 'F:\cygwin64\tmp\CNT2EF2.tmp'
minibatchframesourcemulti: reading 1 feature sets and 1 label sets..................................................................................................
minibatchframesourcemulti: read label set 0: 129 classes

Expand All @@ -313,7 +313,7 @@ biggrowablevectorarray: disk backup store created, 252734 frames, 37748736 bytes
minibatchiterator: epoch 0: frames [0..500] (first utterance at frame 0), data subset 0 of 1, with 1 datapasses
recoverblock: recovering feature block 0 [0..65535)
minibatchiterator: epoch 1: frames [500..1000] (first utterance at frame 500), data subset 0 of 1, with 1 datapasses
biggrowablevectorarray: deleted disk backup store at 'F:\cygwin64\tmp\CNT7688.tmp'
biggrowablevectorarray: deleted disk backup store at 'F:\cygwin64\tmp\CNT2EF2.tmp'
Set current path to: C:/repo/cntk_github6/CNTK/Tests/EndToEndTests/UnitTests/ReaderTests
Current working directory: C:/repo/cntk_github6/CNTK/Tests/EndToEndTests/UnitTests/ReaderTests
Executable path: C:/repo/cntk_github6/CNTK/x64/release
Expand Down Expand Up @@ -462,7 +462,7 @@ Current working directory is now: d:/TestPreparation/Speech/AN4Corpus/v0
reading script file ./glob_0000.scp ... 948 entries
total 132 state names in state list ./state.list
htkmlfreader: reading MLF file ./glob_0000.mlf ... total 948 entries
biggrowablevectorarray: creating disk backup store at 'F:\cygwin64\tmp\CNTEEF5.tmp'
biggrowablevectorarray: creating disk backup store at 'F:\cygwin64\tmp\CNT6FE4.tmp'
minibatchframesourcemulti: reading 1 feature sets and 1 label sets..................................................................................................
minibatchframesourcemulti: read label set 0: 129 classes

Expand All @@ -471,7 +471,7 @@ biggrowablevectorarray: disk backup store created, 252734 frames, 37748736 bytes
minibatchiterator: epoch 0: frames [0..500] (first utterance at frame 0), data subset 0 of 1, with 1 datapasses
recoverblock: recovering feature block 0 [0..65535)
minibatchiterator: epoch 1: frames [500..1000] (first utterance at frame 500), data subset 0 of 1, with 1 datapasses
biggrowablevectorarray: deleted disk backup store at 'F:\cygwin64\tmp\CNTEEF5.tmp'
biggrowablevectorarray: deleted disk backup store at 'F:\cygwin64\tmp\CNT6FE4.tmp'
Set current path to: C:/repo/cntk_github6/CNTK/Tests/EndToEndTests/UnitTests/ReaderTests
Current working directory: C:/repo/cntk_github6/CNTK/Tests/EndToEndTests/UnitTests/ReaderTests
Executable path: C:/repo/cntk_github6/CNTK/x64/release
Expand Down Expand Up @@ -1247,7 +1247,7 @@ htkmlfreader: reading MLF file ./labels.smlf ... total 4974 entries
....................................................................................................feature set 0: 1669414 frames in 4963 out of 4963 utterances
label set 0: 9000 classes
minibatchutterancesource: 4963 utterances grouped into 19 chunks, av. chunk size: 261.2 utterances, 87863.9 frames
....................................................................................................Running 114 test cases...
....................................................................................................Running 122 test cases...
feature set 1: 1669414 frames in 4963 out of 4963 utterances
minibatchutterancesource: 4963 utterances grouped into 19 chunks, av. chunk size: 261.2 utterances, 87863.9 frames
minibatchiterator: epoch 0: frames [0..400] (first utterance at frame 0), data subset 0 of 1, with 1 datapasses
Expand All @@ -1266,8 +1266,8 @@ Legacy configuration is used for truncated BPTT mode, please adapt the config to
Set current path to: C:/repo/cntk_github6/CNTK/Tests/EndToEndTests/UnitTests/ReaderTests

Test module "ReaderTests" has passed with:
114 test cases out of 114 passed
16973520 assertions out of 16973520 passed
122 test cases out of 122 passed
22235579 assertions out of 22235579 passed

Test suite "ReaderTestSuite" has passed with:
92 test cases out of 92 passed
Expand Down Expand Up @@ -1567,7 +1567,7 @@ Test module "ReaderTests" has passed with:

Test suite "ReaderLibTests" has passed with:
18 test cases out of 18 passed
2177 assertions out of 2177 passed
2265 assertions out of 2265 passed

Test case "ReaderLibTests/CheckGetCurrentCursorForRandomizers" has passed with:
16 assertions out of 16 passed
Expand Down Expand Up @@ -1599,7 +1599,7 @@ Test module "ReaderTests" has passed with:
128 assertions out of 128 passed

Test case "ReaderLibTests/BlockRandomizerChaosMonkey" has passed with:
1748 assertions out of 1748 passed
1836 assertions out of 1836 passed

Test case "ReaderLibTests/BlockRandomizerOneEpochLegacyRandomization" has passed with:
68 assertions out of 68 passed
Expand All @@ -1622,3 +1622,31 @@ Test module "ReaderTests" has passed with:
Test case "ReaderLibTests/CheckEpochBoundarySingleWorker" has passed with:
4 assertions out of 4 passed

Test suite "PackerTests" has passed with:
8 test cases out of 8 passed
5261971 assertions out of 5261971 passed

Test case "PackerTests/SequencePackerBigChunksWithFrames1Sweep" has passed with:
1637325 assertions out of 1637325 passed

Test case "PackerTests/SequencePackerSmallChunksWithFrames1Sweep" has passed with:
102756 assertions out of 102756 passed

Test case "PackerTests/SequencePackerBigChunksWithSequences1Sweep" has passed with:
13496 assertions out of 13496 passed

Test case "PackerTests/SequencePackerSmallChunksWithSequences1Sweep" has passed with:
1396 assertions out of 1396 passed

Test case "PackerTests/SequencePackerBigChunksWithFrames" has passed with:
3274012 assertions out of 3274012 passed

Test case "PackerTests/SequencePackerSmallChunksWithFrames" has passed with:
204609 assertions out of 204609 passed

Test case "PackerTests/SequencePackerBigChunksWithSequences" has passed with:
26481 assertions out of 26481 passed

Test case "PackerTests/SequencePackerSmallChunksWithSequences" has passed with:
1896 assertions out of 1896 passed

Loading

0 comments on commit 66f4d8d

Please sign in to comment.