Skip to content

Commit

Permalink
Commented out gpu usage, added runner, added runner to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lapplislazuli committed Nov 25, 2022
1 parent 9137d7b commit 39d7b61
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 39 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,25 @@ pamac install nvidia-container-toolkit
```
(switch pamac for a package manager that your distribution uses). If your Nvidia card still doesn't work, some troubleshooting can be found [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) and [here](https://medium.com/@mmnshkmr/manjaro-setup-tensorflow-docker-container-w-nvidia-gpu-cacd0714f9b).

- To run the experiments, please first run (as root) ```prepare.sh``` or ```prepare_minimal.sh```. This will download and prepare the full and minimal datasets, respectively:
- To run the experiments, please first run (maybe as root) ```prepare.sh``` or ```prepare_minimal.sh```. This will download and prepare the full and minimal datasets, respectively:

```
sudo bash prepare.sh
bash prepare.sh
```
```
sudo bash prepare_minimal.sh
bash prepare_minimal.sh
```

- Then ```cd``` into the experiments folder. Here you will find 5 different experiments, each with a different setup. You can change the training hyperparameters in ```config.py```. Run the experiment by running:

```
docker-compose up --build
docker-compose up
```

You can run all experiments 'in the background' by doing:

```
nohup bash runner.sh > code2seq-vanilla.log &
```

**Warning!** If you hit the rate limits on Nvidia Docker image downloads, you might start getting an ```401 Unauthorized``` error when trying to download the Docker image. If that happens, please follow [this guide](https://stackoverflow.com/a/70970425/13988119) to register and login through your Nvidia account.
14 changes: 7 additions & 7 deletions experiments/1-no-comments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
# There has to be an existing model for the following to work
continueTrainingFromCheckpoint: "false"

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
14 changes: 7 additions & 7 deletions experiments/2-comments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
# There has to be an existing model for the following to work
continueTrainingFromCheckpoint: "false"

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
14 changes: 7 additions & 7 deletions experiments/3-comments-no-stopwords/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
# There has to be an existing model for the following to work
continueTrainingFromCheckpoint: "false"

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
14 changes: 7 additions & 7 deletions experiments/4-comments-tfidf/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
# There has to be an existing model for the following to work
continueTrainingFromCheckpoint: "false"

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
14 changes: 7 additions & 7 deletions experiments/5-comments-no-stopwords-tfidf/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
# There has to be an existing model for the following to work
continueTrainingFromCheckpoint: "false"

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
10 changes: 10 additions & 0 deletions runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# This script runs all (known) docker-composes in this directory.
# In the folders in this directory all the experiments are specified with there respective docker composes and configuration files.

echo "Running all experiments sequentially"

find . -name "docker-compose.yml" -print0 | xargs -I {} -0 sh -c 'docker-compose -f {} up; docker-compose -f {} down'

echo "Finished running all experiments"

0 comments on commit 39d7b61

Please sign in to comment.