Skip to content

Commit

Permalink
Merge pull request #351 from NVIDIA/test_docker
Browse files Browse the repository at this point in the history
Switch CI to run tests in docker container
  • Loading branch information
yzhang123 authored Feb 11, 2020
2 parents 53c5da4 + 986626a commit ee4bf33
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
34 changes: 9 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
pipeline {
agent any
environment {
PATH="/home/mrjenkins/anaconda3/envs/py37p1.4.0/bin:$PATH"
agent {
docker {
image 'nvcr.io/nvidia/pytorch:20.01-py3'
args '--device=/dev/nvidia0 --gpus all --user 0:128 -v /home:/home --shm-size=8g'
}
}
options {
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
}
}
stages {

stage('PyTorch version') {
Expand All @@ -16,33 +18,17 @@ pipeline {
}
stage('Install test requirements') {
steps {
sh 'pip install -r requirements/requirements_test.txt'
sh 'apt-get update && apt-get install -y bc && pip install -r requirements/requirements_test.txt'
}
}
stage('Code formatting checks') {
steps {
sh 'python setup.py style'
}
}
stage('Unittests general') {
steps {
sh './reinstall.sh && python -m unittest tests/*.py'
}
}

stage('Unittests ASR') {
steps {
sh 'python -m unittest tests/asr/*.py'
}
}
stage('Unittests NLP') {
stage('Unittests ALL') {
steps {
sh 'python -m unittest tests/nlp/*.py'
}
}
stage('Unittests TTS') {
steps {
sh 'python -m unittest tests/tts/*.py'
sh './reinstall.sh && python -m unittest'
}
}

Expand Down Expand Up @@ -147,8 +133,6 @@ pipeline {
}
}



stage('NLP-ASR processing') {
failFast true
parallel {
Expand Down
7 changes: 4 additions & 3 deletions examples/asr/jasper_an4.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def main():
parser.add_argument("--eval_datasets", type=str, nargs=1, help="validation dataset path")

# Create new args
parser.add_argument("--lm", default="./an4-lm.3gram.binary", type=str)
# parser.add_argument("--lm", default="./an4-lm.3gram.binary", type=str)
parser.add_argument("--lm", default=None, type=str)
parser.add_argument("--test_after_training", action='store_true')
parser.add_argument("--momentum", type=float)
parser.add_argument("--beta1", default=0.95, type=float)
Expand Down Expand Up @@ -198,7 +199,7 @@ def main():
if args.test_after_training:
logging.info("Testing greedy and beam search with LM WER.")
# Create BeamSearch NM
if nf.world_size > 1:
if nf.world_size > 1 or args.lm is None:
logging.warning("Skipping beam search WER as it does not " "work if doing distributed training.")
else:
beam_search_with_lm = nemo_asr.BeamSearchDecoderWithLM(
Expand All @@ -218,7 +219,7 @@ def main():
raise ValueError(f"Final eval greedy WER {wer * 100:.2f}% > :" f"than {wer_thr * 100:.2f}%")
nf.sync_all_processes()

if nf.world_size == 1:
if nf.world_size == 1 and args.lm is not None:
beam_hypotheses = []
# Over mini-batch
for i in evaluated_tensors[-1]:
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pytest-runner
black
isort[requirements]
wrapt
wget

0 comments on commit ee4bf33

Please sign in to comment.