Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
1b09b76c
Commit
1b09b76c
authored
3 years ago
by
Hashim Sharif
Browse files
Options
Downloads
Patches
Plain Diff
removing more dead code from RT control - removing fake frequency routine deps
parent
51da749c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp
+7
-65
7 additions, 65 deletions
.../hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp
with
7 additions
and
65 deletions
hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp
+
7
−
65
View file @
1b09b76c
...
@@ -1286,56 +1286,6 @@ extern "C" void llvm_hpvm_invokeRtControl_BASE(void *result, const char *str,
...
@@ -1286,56 +1286,6 @@ extern "C" void llvm_hpvm_invokeRtControl_BASE(void *result, const char *str,
}
}
extern
"C"
void
llvm_hpvm_invokeRtControl_ADJUST
(
void
*
result
,
const
char
*
str
,
int
start
,
int
end
)
{
uint32_t
*
labels_cached
=
hpvm_rt_readLabelsBatch_cached
(
str
,
start
,
end
);
hpvm_rt_computeAccuracy3
(
labels_cached
,
result
);
// Read stats for iteration that was just completed
double
current_iteration_energy
=
RC
->
getCurrentIterationComputeEnergy
();
RC
->
readIterationFrequency
();
RC
->
resume_profiler
();
double
current_iteration_time
=
RC
->
getCurrentIterationComputeTime
();
double
target_speedup
;
if
(
RC
->
getLastFrequency
()
==
RC
->
getIterationFrequency
())
{
target_speedup
=
RC
->
getLastSpeedup
();
}
else
{
double
baseline_time
=
RC
->
getBaselineTime
();
// Relative to current configuration
target_speedup
=
current_iteration_time
/
baseline_time
;
// Adjust to baseline
target_speedup
*=
RC
->
getCurrentConfigurationSpeedup
();
RC
->
setLastFrequency
(
RC
->
getIterationFrequency
());
RC
->
setLastSpeedup
(
target_speedup
);
}
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
>
pinfo2
=
RC
->
get_time_energy
();
RC
->
reset_profiler
();
RC
->
addToCurrentIterationConfigTime
(
pinfo2
.
first
);
RC
->
addToCurrentIterationConfigEnergy
(
pinfo2
.
second
);
INFO
(
"current iteration time = %f, current iteration energy = %f
\n
"
,
current_iteration_time
,
current_iteration_energy
);
INFO
(
"target speedup = %lf
\n\n
"
,
target_speedup
);
// Note the end of iteration
RC
->
end_iteration
();
}
extern
"C"
void
llvm_hpvm_invokeRtControl_ADJUST_PR
(
void
*
result
,
extern
"C"
void
llvm_hpvm_invokeRtControl_ADJUST_PR
(
void
*
result
,
const
char
*
str
,
const
char
*
str
,
...
@@ -1347,22 +1297,17 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR(void *result,
...
@@ -1347,22 +1297,17 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR(void *result,
// Read stats for iteration that was just completed
// Read stats for iteration that was just completed
double
current_iteration_energy
=
RC
->
getCurrentIterationComputeEnergy
();
double
current_iteration_energy
=
RC
->
getCurrentIterationComputeEnergy
();
RC
->
readIterationFrequency
();
RC
->
resume_profiler
();
RC
->
resume_profiler
();
double
current_iteration_time
=
RC
->
getCurrentIterationComputeTime
();
double
current_iteration_time
=
RC
->
getCurrentIterationComputeTime
();
double
target_speedup
;
double
target_speedup
;
if
(
RC
->
getLastFrequency
()
==
RC
->
getIterationFrequency
())
{
target_speedup
=
RC
->
getLastSpeedup
();
double
baseline_time
=
RC
->
getBaselineTime
();
}
else
{
// Relative to current configuration
double
baseline_time
=
RC
->
getBaselineTime
();
target_speedup
=
current_iteration_time
/
baseline_time
;
// Relative to current configuration
// Adjust to baseline
target_speedup
=
current_iteration_time
/
baseline_time
;
target_speedup
*=
RC
->
getCurrentConfigurationSpeedup
();
// Adjust to baseline
target_speedup
*=
RC
->
getCurrentConfigurationSpeedup
();
RC
->
setLastFrequency
(
RC
->
getIterationFrequency
());
RC
->
setLastSpeedup
(
target_speedup
);
}
RC
->
findTargetConfiguration
(
target_speedup
,
SPEEDUP
);
RC
->
findTargetConfiguration
(
target_speedup
,
SPEEDUP
);
RC
->
adjustTargetConfiguration
(
target_speedup
);
RC
->
adjustTargetConfiguration
(
target_speedup
);
RC
->
pause_profiler
();
RC
->
pause_profiler
();
...
@@ -1372,10 +1317,7 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR(void *result,
...
@@ -1372,10 +1317,7 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR(void *result,
RC
->
addToCurrentIterationControlTime
(
pinfo
.
first
);
RC
->
addToCurrentIterationControlTime
(
pinfo
.
first
);
RC
->
addToCurrentIterationControlEnergy
(
pinfo
.
second
);
RC
->
addToCurrentIterationControlEnergy
(
pinfo
.
second
);
//* *
//*Needed for the frequency variation experiment - not part of the control *
RC
->
resume_profiler
();
RC
->
resume_profiler
();
RC
->
updateFrequency
();
RC
->
pause_profiler
();
RC
->
pause_profiler
();
std
::
pair
<
double
,
double
>
pinfo2
=
RC
->
get_time_energy
();
std
::
pair
<
double
,
double
>
pinfo2
=
RC
->
get_time_energy
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment