From 79caffec1a82c7cc419bcf9b0e74a05ad2e9b184 Mon Sep 17 00:00:00 2001
From: Yifan Zhao <yifanz16@illinois.edu>
Date: Sun, 31 Jan 2021 00:21:41 -0600
Subject: [PATCH] Removed weight downloading mechanism and fixed model_weight
 prefix

---
 hpvm/scripts/download_weights.sh        | 10 ----------
 hpvm/scripts/llvm_installer.sh          | 22 ----------------------
 hpvm/test/dnn_benchmarks/CMakeLists.txt |  2 +-
 3 files changed, 1 insertion(+), 33 deletions(-)
 delete mode 100755 hpvm/scripts/download_weights.sh

diff --git a/hpvm/scripts/download_weights.sh b/hpvm/scripts/download_weights.sh
deleted file mode 100755
index 757abbf3b6..0000000000
--- a/hpvm/scripts/download_weights.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# First get hands on gdown -- google drive downloader
-wget https://raw.githubusercontent.com/circulosmeos/gdown.pl/master/gdown.pl -O gdown.pl
-chmod +x ./gdown.pl
-# Download the zip file from google drive
-./gdown.pl 'https://drive.google.com/file/d/1V_yd9sKcZQ7zhnO5YhRpOsaBPLEEvM9u' model_params.zip
-unzip model_params.zip # should give a "model_params" folder
-# All our benchmarks also know to look for parameters in <build_dir>/model_params.
-# Cleanup:
-rm gdown.pl model_params.zip
\ No newline at end of file
diff --git a/hpvm/scripts/llvm_installer.sh b/hpvm/scripts/llvm_installer.sh
index 0cbaea8e49..f9600b8fc3 100755
--- a/hpvm/scripts/llvm_installer.sh
+++ b/hpvm/scripts/llvm_installer.sh
@@ -32,7 +32,6 @@ HPVM_RT=hpvm-rt/hpvm-rt.bc
 TARGET=all
 TARGET_INPUT=all
 FLAGGED=false
-DOWNLOAD_WEIGHTS=false
 
 # Get flags
 while getopts 'hmj:t:' opt; do
@@ -84,7 +83,6 @@ if $FLAGGED; then
   echo Automated: $AUTOMATE
   echo Threads: $NUM_THREADS
   echo Targets: $TARGET
-  echo Download Weights: $DOWNLOAD_WEIGHTS
   echo
 else
   echo "No Flags found. Using command line prompts."
@@ -124,22 +122,11 @@ else
     TARGET=$TARGET_INPUT
   fi
   echo
-  
-  read_yn "Download weights necessary to run DNN benchmarks?" LOAD_WEIGHTS
-  if [[ $LOAD_WEIGHTS == "" ]]; then
-    echo "No input given. Weights will not be downloaded."
-  elif [[ $LOAD_WEIGHTS == "n" ]]; then
-    echo "Weights will not be downloaded."
-  else
-    DOWNLOAD_WEIGHTS=$LOAD_WEIGHTS
-  fi
-  echo
 
   echo "Running with the following options:"
   echo Automated: $AUTOMATE
   echo Threads: $NUM_THREADS
   echo Targets: $TARGET
-  echo Download Weights: $DOWNLOAD_WEIGHTS
   echo
 fi
 
@@ -252,15 +239,6 @@ echo make -j$NUM_THREADS
 make -j$NUM_THREADS
 #make install
 
-if [ $DOWNLOAD_WEIGHTS == "y" ]; then
-  echo
-  echo "Downloading weights for DNN benchmarks..."
-  echo
-  ../scripts/download_weights.sh
-else
-  echo "Skipping weight download"
-fi
-
 if [ -f $BUILD_DIR/tools/hpvm/projects/$HPVM_RT ]; then
     true
 else
diff --git a/hpvm/test/dnn_benchmarks/CMakeLists.txt b/hpvm/test/dnn_benchmarks/CMakeLists.txt
index 3b78ad26df..cdae0e1823 100644
--- a/hpvm/test/dnn_benchmarks/CMakeLists.txt
+++ b/hpvm/test/dnn_benchmarks/CMakeLists.txt
@@ -11,7 +11,7 @@ set(CMAKE_CXX_COMPILER "${LLVM_BIN_DIR}/clang++")
 # Configure config.h which tells the benchmarks where's the build directory.
 # We can also use the one in tensor_runtime, but we're avoiding that trying to 
 # decouple things.
-set(MODEL_PARAMS_DIR "${CMAKE_BINARY_DIR}/model_params/")
+set(MODEL_PARAMS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/model_params/")
 configure_file(
   "include/config.h.in"
   "${CMAKE_CURRENT_BINARY_DIR}/include/config.h"
-- 
GitLab