diff --git a/llvm/projects/hpvm-tensor-rt/autotuner/opentuner/autotuner/devtuner.py b/llvm/projects/hpvm-tensor-rt/autotuner/opentuner/autotuner/devtuner.py index cd2af2e93d7ffec4a413f5ddef3385c818860c47..3d95a19da89dad53c74ad65221f576b727fdd2e6 100644 --- a/llvm/projects/hpvm-tensor-rt/autotuner/opentuner/autotuner/devtuner.py +++ b/llvm/projects/hpvm-tensor-rt/autotuner/opentuner/autotuner/devtuner.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -# Algorithmic Approximation Tuning -# Purpose: Tunes for Perforation, Sampling, Numerical Precision (FP16) +# Development-time Tuner with Algorithmic Approximations: +# Approximations: Perforation, Sampling with varying knobs for rate, skip offset import adddeps @@ -282,6 +282,8 @@ if __name__ == '__main__': argparser.add_argument('--cost-file', help='layer description') argparser.add_argument('--knobs-config', help='knob settings and ID mapping') argparser.add_argument('--layer-knobs', help='per-layer Knobs') + # NOTE: needed to have unique file-names across runs + argparser.add_argument('--start-id', type=int, help='start id for naming output files') args = argparser.parse_args() @@ -298,6 +300,8 @@ if __name__ == '__main__': tunerData.knobs_list = readLayerKnobs(args.layer_knobs) tunerData.knobs_speedup = readKnobConfig(args.knobs_config) + tunerData.test_id = args.start_id + result_dir = args.result_dir if result_dir == "": diff --git a/llvm/projects/hpvm-tensor-rt/autotuner/tuner_driver_src/run_devtime_tuner.py b/llvm/projects/hpvm-tensor-rt/autotuner/tuner_driver_src/run_devtime_tuner.py index 1cbb1eceeaf4a844463369b0413ca0f7ca01c4f9..1f6592d85dad3f6f4baeed332c3e268b8d2bd7a8 100644 --- a/llvm/projects/hpvm-tensor-rt/autotuner/tuner_driver_src/run_devtime_tuner.py +++ b/llvm/projects/hpvm-tensor-rt/autotuner/tuner_driver_src/run_devtime_tuner.py @@ -17,6 +17,8 @@ class DevTimeTuner: self.cost_file = tensorRT_dir + "/" + Bench.cost_file self.layer_knobs = tensorRT_dir + "/" + Bench.layer_knobs self.result_dir = tensorRT_dir + "/" + Bench.base_dir + "/loss_123/" + batch_id + "/dev_tuner/" + # NOTE: maintains overall autotuning iterations completed - across multiple devtuner invocations + self.iterations_completed = 0 @@ -41,20 +43,25 @@ class DevTimeTuner: tuner_cmd += "../autotuner/data/global_knobs.txt" tuner_cmd += " --layer-knobs " tuner_cmd += self.layer_knobs + tuner_cmd += " --start-id " + tuner_cmd += str(self.iterations_completed) print (tuner_cmd) p = subprocess.Popen(tuner_cmd, shell=True) p.wait() - + + + # Update iterations completed after each completed devtuner.py invocation with N iterations + self.iterations_completed += self.autotuner_runs def runDevTuner(self): self.invokeDevTunerScript(0.85, self.autotuner_runs) - #self.invokeDevTunerScript(1.7, self.autotuner_runs) - #self.invokeDevTunerScript(2.5, self.autotuner_runs) + self.invokeDevTunerScript(1.7, self.autotuner_runs) + self.invokeDevTunerScript(2.5, self.autotuner_runs)