From cb89d89d28f72a053b6a2adbb8c2f25d252b6b39 Mon Sep 17 00:00:00 2001 From: hashimsharif <hashim.sharif91@gmail.com> Date: Sat, 16 May 2020 19:26:09 -0500 Subject: [PATCH] Added frequency update time to hpcm controller - config timer --- .../tensor_runtime/src/hpvm-rt-controller.cpp | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp index 89968f2b09..813d77c46a 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp @@ -41,6 +41,7 @@ void updateJetsonGPUFreq(int freq_level) { unsigned long int readJetsonGPUFreq() { FILE* cur_freq_file = fopen("/sys/devices/17000000.gp10b/devfreq/17000000.gp10b/cur_freq", "r"); +// fopen("/sys/devices/17000000.gp10b/devfreq/17000000.gp10b/min_freq", "r"); if (cur_freq_file == NULL) { printf("Could not open cur_freq file \n"); } @@ -1370,15 +1371,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST( RC->findTargetConfiguration(target_speedup, SPEEDUP); RC->pause_profiler(); + std::pair<double, double> pinfo = RC->get_time_energy(); + RC->reset_profiler(); + RC->addToCurrentIterationControlTime(pinfo.first); + RC->addToCurrentIterationControlEnergy(pinfo.second); + //* * //*Needed for the frequency variation experiment - not part of the control * + RC->resume_profiler(); RC->updateFrequency(); - //* */ + RC->pause_profiler(); - std::pair<double, double> pinfo = RC->get_time_energy(); + std::pair<double, double> pinfo2 = RC->get_time_energy(); RC->reset_profiler(); - RC->addToCurrentIterationControlTime(pinfo.first); - RC->addToCurrentIterationControlEnergy(pinfo.second); + RC->addToCurrentIterationConfigTime(pinfo2.first); + RC->addToCurrentIterationConfigEnergy(pinfo2.second); + //* */ INFO( "current iteration time = %f, current iteration energy = %f\n", @@ -1407,15 +1415,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR( RC->adjustTargetConfiguration(target_speedup); RC->pause_profiler(); + std::pair<double, double> pinfo = RC->get_time_energy(); + RC->reset_profiler(); + RC->addToCurrentIterationControlTime(pinfo.first); + RC->addToCurrentIterationControlEnergy(pinfo.second); + //* * //*Needed for the frequency variation experiment - not part of the control * + RC->resume_profiler(); RC->updateFrequency(); - //* */ + RC->pause_profiler(); - std::pair<double, double> pinfo = RC->get_time_energy(); + std::pair<double, double> pinfo2 = RC->get_time_energy(); RC->reset_profiler(); - RC->addToCurrentIterationControlTime(pinfo.first); - RC->addToCurrentIterationControlEnergy(pinfo.second); + RC->addToCurrentIterationConfigTime(pinfo2.first); + RC->addToCurrentIterationConfigEnergy(pinfo2.second); + //* */ INFO( "current iteration time = %f, current iteration energy = %f\n", -- GitLab