Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 632dbaf

Browse files
committed
.
0 parents  commit 632dbaf

File tree

9 files changed

+412045
-0
lines changed

9 files changed

+412045
-0
lines changed

build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Preliminary commands to build the EC2 box and install drivers
2+
# Assumes Ubuntu 16.04
3+
sudo apt-get install python-pip
4+
sudo pip install plotly
5+
wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
6+
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
7+
sudo apt-get update
8+
sudo apt-get install cuda
9+
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
10+
sudo apt-get update
11+
sudo apt-get install docker-engine nvidia-modprobe
12+
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker_1.0.0.rc.3-1_amd64.deb
13+
sudo dpkg -i /tmp/nvidia-docker*.deb
14+
sudo nvidia-docker run -it harvardnlp/opennmt:8.0 .

check.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#aws ec2 start-instances --instance-ids i-73ad3de6 --region us-west-2
2+
HOSTNAME=$(aws ec2 describe-instances --instance-ids i-73ad3de6 --region us-west-2 | grep PublicIpAddress | awk -F ":" '{print $2}' | sed 's/[", ]//g')
3+
echo $HOSTNAME;
4+
echo ubuntu@$HOSTNAME
5+
ssh -o "StrictHostKeyChecking no" -i viz.pem ubuntu@$HOSTNAME 'export DATE=$(date "+%Y-%m-%d-%H-%M");cd OpenNMT-Regression;bash setup.sh;sudo nvidia-docker exec -i opennmt bash -c "$(cat run.sh)" | tee "call_log_$DATE.txt";cat "call_log_$DATE.txt" | python graph.py; git add "call_log_$DATE.txt"; git commit -a -m .; git push origin master;exit'
6+
aws ec2 stop-instances --instance-ids i-73ad3de6 --region us-west-2

data/de-train-clean.200K.txt

Lines changed: 200000 additions & 0 deletions
Large diffs are not rendered by default.

data/de-val-clean.10K.txt

Lines changed: 6003 additions & 0 deletions
Large diffs are not rendered by default.

data/en-train-clean.200K.txt

Lines changed: 200000 additions & 0 deletions
Large diffs are not rendered by default.

data/en-val-clean.10K.txt

Lines changed: 6003 additions & 0 deletions
Large diffs are not rendered by default.

launch.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Command to login to ec2 and start job.
2+
BOX=i-73ad3de6
3+
KEY=viz.pem
4+
aws ec2 start-instances --instance-ids $BOX --region us-west-2
5+
HOSTNAME=$(aws ec2 describe-instances --instance-ids $BOX --region us-west-2 | grep PublicIpAddress | awk -F ":" '{print $2}' | sed 's/[", ]//g')
6+
echo $HOSTNAME;
7+
echo ubuntu@$HOSTNAME
8+
ssh -o "StrictHostKeyChecking no" -i $KEY ubuntu@$HOSTNAME 'export DATE=$(date "+%Y-%m-%d-%H-%M");cd OpenNMT-Regression;bash setup.sh;sudo nvidia-docker exec -i opennmt bash -c "$(cat run.sh)" | tee "call_log_$DATE.txt";cat "call_log_$DATE.txt" | python graph.py; git add "call_log_$DATE.txt"; git commit -a -m .; git push origin master;exit'
9+
aws ec2 stop-instances --instance-ids $BOX --region us-west-2

run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Commands run in the raw docker container.
2+
git clone "http://github.com/opennmt/opennmt" && cd opennmt && th preprocess.lua -train_src_file ../../de-train-clean.200K.txt -train_targ_file ../../en-train-clean.200K.txt -valid_src_file ../../de-val-clean.10K.txt -valid_targ_file ../../en-val-clean.10K.txt -output_file data/demo && th train.lua -data data/demo-train.t7 -save_file demo-model -gpuid 1 -print_every 50 -epochs 8

setup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Commands to setup docker container and push data
2+
sudo docker kill opennmt
3+
sudo docker rm opennmt
4+
sudo nvidia-docker run --name opennmt -d harvardnlp/opennmt:8.0 tail -f /dev/null
5+
sudo docker cp data/de-val-clean.10K.txt opennmt:/root/de-val-clean.10K.txt
6+
sudo docker cp data/en-val-clean.10K.txt opennmt:/root/en-val-clean.10K.txt
7+
sudo docker cp data/de-train-clean.200K.txt opennmt:/root/de-train-clean.200K.txt
8+
sudo docker cp data/en-train-clean.200K.txt opennmt:/root/en-train-clean.200K.txt

0 commit comments

Comments
 (0)