Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4e895d8
Set up CI with Azure Pipelines
NickNickGo Oct 20, 2020
675589a
Update azure-pipelines.yml
NickNickGo Oct 20, 2020
9e90413
Update azure-pipelines.yml
NickNickGo Oct 20, 2020
28fc099
Update azure-pipelines.yml
NickNickGo Oct 20, 2020
1f34332
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
e1f154b
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
62f6a29
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
33f9050
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
c2a5a9e
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
650fe2b
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
ff8fd8c
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
c91ba67
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
4b79eb1
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
ec43d27
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
7bd64a8
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
6d98718
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
57fb6d9
Update beam_search_optimizer_v1.py
NickNickGo Oct 21, 2020
ed3497d
Update beam_search_optimizer_v1.py
NickNickGo Oct 21, 2020
83943ba
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
489662f
Update azure-pipelines.yml
NickNickGo Oct 21, 2020
f5d524d
Set up CI with Azure Pipelines
NickNickGo Oct 22, 2020
29aa0cd
Update azure-pipelines.yml
NickNickGo Oct 22, 2020
6da9b08
Update azure-pipelines.yml
NickNickGo Oct 22, 2020
2d1b6d3
Update README.md
NickNickGo Oct 22, 2020
651da92
Update README.md
NickNickGo Oct 22, 2020
347f2b8
Update README.md
NickNickGo Oct 22, 2020
cce3d05
Update README.md
NickNickGo Oct 22, 2020
57f0801
Update README.md
NickNickGo Oct 22, 2020
c7db147
Update README.md
NickNickGo Oct 22, 2020
4226d31
Update README.md
NickNickGo Oct 22, 2020
9069c92
Update README.md
NickNickGo Oct 22, 2020
50e9ea6
Update README.md
NickNickGo Oct 22, 2020
f15428e
Update README.md
NickNickGo Oct 22, 2020
b8b60b4
Update README.md
NickNickGo Oct 22, 2020
719aef6
Update README.md
NickNickGo Oct 22, 2020
bcf6fb4
Set up CI with Azure Pipelines
NickNickGo Oct 22, 2020
d5ea017
Update azure-pipelines.yml
NickNickGo Oct 23, 2020
145f570
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
0b4be20
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
7f344df
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
8156d9d
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
37b5097
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
ef89794
Merge pull request #12 from NickNickGo/NickNickGo-patch-6
NickNickGo Oct 24, 2020
e6addd2
Merge pull request #9 from NickNickGo/NickNickGo-patch-3
NickNickGo Oct 24, 2020
2621bd2
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
d6dd11b
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
fddd0d2
Update beam_search_optimizer.py
NickNickGo Oct 24, 2020
d87f0d3
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
f215348
Update beam_search_optimizer.py
NickNickGo Oct 24, 2020
49277c8
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
0e78990
Update beam_search_optimizer.py
NickNickGo Oct 24, 2020
0d6f4d5
Update azure-pipelines.yml
NickNickGo Oct 24, 2020
9b68831
Update test_file_utils.py
NickNickGo Oct 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#
trigger:
paths:
exclude:
- docs
jobs:
- job: Fairseq_unittests
timeoutInMinutes: 360
#pool:
# vmImage: 'ubuntu-18.04'
pool:
name: default
demands:
- agent.name -equals gpu4
steps:
- script: |
#set up docker
sudo docker run --gpus all --privileged -v '/datadrive/:/datadrive' -it adsbrainwestus2.azurecr.io/fastseq:dev-py3 /bin/bash
#install fastseq
pip install --editable .

#show environment
which python
python --version
which nvcc
nvcc --version
which fastseq
python -c "import torch; print('torch:', torch.__version__, torch)"
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"

#files chnaged in current PR
files_changed=$(git diff HEAD HEAD~ --name-only)
echo "Files Edited in Current PR"
echo $files_changed

export CUDA_VISIBLE_DEVICES=2,3
#check whether this PR is specific to fairseq/transformers/both.
#run PR specific unittests.
is_fairseq=$(echo $files_changed|grep fairseq)
is_transformers=$(echo $files_changed|grep transformers)
is_py_change=$(echo $files_changed|grep .py)
is_cpp_change=$(echo $files_changed|grep -e .cu -e .cpp)

#purely fairseq change
if [ -n "$is_fairseq" -a -z "$is_transformers" ]
then
echo "Running Only fairseq unittests"
bash tests/run_fairseq_tests.sh
#purely transformers change
else if [ -z "$is_fairseq" -a -n "$is_transformers" ]
then
echo "Running Only transformers unittests"
bash tests/run_transformers_tests.sh
else if [ -n "$is_py_change" -o -n "$is_cpp_change" ]
then
echo "Running fairseq and transformers unittests"
bash tests/run_fairseq_tests.sh
bash tests/run_transformers_tests.sh
else
#bash tests/run_fairseq_tests.sh
#bash tests/run_transformers_tests.sh
echo " *** Skipping all unittests *** "
:
fi
fi
fi

#Linting checks for python files
if [ -n "$is_py_change" ]
then
#install pylint, wrapt update is essential.
conda update --name --yes base conda
conda update --yes wrapt
pip install pylint
echo $files_changed|grep .py|while read file; do
pylint --rcfile=.pylintrc $file
done
else
:
fi

#Linting checks for c++/cuda files
if [ -n "$is_cpp_change" ]
then
#install cpplint
pip install cpplint
echo $files_changed| grep .cpp|while read file; do
cpplint $file
done
echo $files_changed| grep .cu|while read file; do
cpplint $file
done
else
:
fi

#run benchmarks
#cd benchmarks/
#CUDA_VISIBLE_DEVICES=3 run_all_benchmarks.sh
displayName: 'setup environment and run fairseq unit tests'
2 changes: 1 addition & 1 deletion fastseq/optimizer/fairseq/beam_search_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

###
"""Import the optimization for beam search related parts in FairSeq."""

from packaging import version
Expand Down
1 change: 1 addition & 0 deletions tests/utils/test_file_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#

"""Test the file_util functions."""

Expand Down