Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Eject docker usages in NAS benchmarks #2645

Merged
merged 6 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/en_US/NAS/Benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ Here is a list of available operators used in NDS.
.. autoclass:: nni.nas.benchmarks.nds.NdsTrialStats

.. autoclass:: nni.nas.benchmarks.nds.NdsIntermediateStats
```
```
4 changes: 4 additions & 0 deletions examples/nas/benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nasbench_full.tfrecord
a.pth
data.zip
nds_data
4 changes: 4 additions & 0 deletions examples/nas/benchmarks/nasbench101.requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tensorflow==1.15.2
tqdm
peewee
git+https://github.com/google-research/nasbench
29 changes: 13 additions & 16 deletions examples/nas/benchmarks/nasbench101.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
#!/bin/bash
set -e
mkdir -p /outputs /tmp

echo "Installing dependencies..."
apt update && apt install -y wget git
pip install --no-cache-dir tqdm peewee

echo "Installing NNI..."
cd /nni && echo "y" | source install.sh

cd /tmp

echo "Installing NASBench..."
git clone https://github.com/google-research/nasbench
cd nasbench && pip install -e . && cd ..
if [ -z "${NASBENCHMARK_DIR}" ]; then
NASBENCHMARK_DIR=~/.nni/nasbenchmark
fi

echo "Downloading NAS-Bench-101..."
wget https://storage.googleapis.com/nasbench/nasbench_full.tfrecord
if [ -f "nasbench_full.tfrecord" ]; then
echo "nasbench_full.tfrecord found. Skip download."
else
wget https://storage.googleapis.com/nasbench/nasbench_full.tfrecord
fi

echo "Generating database..."
rm -f /outputs/nasbench101.db /outputs/nasbench101.db-journal
NASBENCHMARK_DIR=/outputs python -m nni.nas.benchmarks.nasbench101.db_gen nasbench_full.tfrecord
rm -f ${NASBENCHMARK_DIR}/nasbench101.db ${NASBENCHMARK_DIR}/nasbench101.db-journal
mkdir -p ${NASBENCHMARK_DIR}
python -m nni.nas.benchmarks.nasbench101.db_gen nasbench_full.tfrecord
rm -f nasbench_full.tfrecord
3 changes: 3 additions & 0 deletions examples/nas/benchmarks/nasbench201.requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gdown
tqdm
peewee
26 changes: 13 additions & 13 deletions examples/nas/benchmarks/nasbench201.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash
set -e
mkdir -p /outputs /tmp

echo "Installing dependencies..."
apt update && apt install -y wget
pip uninstall -y enum34 # https://github.com/iterative/dvc/issues/1995
pip install --no-cache-dir gdown tqdm peewee

echo "Installing NNI..."
cd /nni && echo "y" | source install.sh

cd /tmp
if [ -z "${NASBENCHMARK_DIR}" ]; then
NASBENCHMARK_DIR=~/.nni/nasbenchmark
fi

echo "Downloading NAS-Bench-201..."
gdown https://drive.google.com/uc\?id\=1OOfVPpt-lA4u2HJrXbgrRd42IbfvJMyE -O a.pth
if [ -f "a.pth" ]; then
echo "a.pth found. Skip download."
else
gdown https://drive.google.com/uc\?id\=1OOfVPpt-lA4u2HJrXbgrRd42IbfvJMyE -O a.pth
fi

echo "Generating database..."
rm -f /outputs/nasbench201.db /outputs/nasbench201.db-journal
NASBENCHMARK_DIR=/outputs python -m nni.nas.benchmarks.nasbench201.db_gen a.pth
rm -f ${NASBENCHMARK_DIR}/nasbench201.db ${NASBENCHMARK_DIR}/nasbench201.db-journal
mkdir -p ${NASBENCHMARK_DIR}
python -m nni.nas.benchmarks.nasbench201.db_gen a.pth
rm -f a.pth
2 changes: 2 additions & 0 deletions examples/nas/benchmarks/nds.requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tqdm
peewee
25 changes: 13 additions & 12 deletions examples/nas/benchmarks/nds.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash
set -e
mkdir -p /outputs /tmp

echo "Installing dependencies..."
apt update && apt install -y wget zip
pip install --no-cache-dir tqdm peewee

echo "Installing NNI..."
cd /nni && echo "y" | source install.sh

cd /tmp
if [ -z "${NASBENCHMARK_DIR}" ]; then
NASBENCHMARK_DIR=~/.nni/nasbenchmark
fi

echo "Downloading NDS..."
wget https://dl.fbaipublicfiles.com/nds/data.zip -O data.zip
if [ -f "data.zip" ]; then
echo "data.zip found. Skip download."
else
wget https://dl.fbaipublicfiles.com/nds/data.zip -O data.zip
fi
unzip data.zip

echo "Generating database..."
rm -f /outputs/nds.db /outputs/nds.db-journal
NASBENCHMARK_DIR=/outputs python -m nni.nas.benchmarks.nds.db_gen nds_data
rm -f ${NASBENCHMARK_DIR}/nds.db ${NASBENCHMARK_DIR}/nds.db-journal
mkdir -p ${NASBENCHMARK_DIR}
python -m nni.nas.benchmarks.nds.db_gen nds_data
rm -rf data.zip nds_data