summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-04-20 13:29:32 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-04-20 13:29:32 +0200
commit0ff76a5adc18c1161f607918f9fcaa0a60829119 (patch)
treed270c4240998fda5b55815d0d3570386dc411dc9
parentd0e6b9602d516e9d6310803e9c273cc74006fe39 (diff)
remove 'dfatool validate' support
-rwxr-xr-xbin/dfatool5
-rwxr-xr-xbin/merge.py107
-rw-r--r--lib/Kratos/DFADriver.pm48
3 files changed, 2 insertions, 158 deletions
diff --git a/bin/dfatool b/bin/dfatool
index 0c57b7c..6de30d9 100755
--- a/bin/dfatool
+++ b/bin/dfatool
@@ -178,9 +178,6 @@ my %action = (
$driver->update_model;
}
},
- validate => sub {
- $driver->validate_model(@data_files);
- },
crossvalidate => sub {
printf("./dfatool crossvalidate %s %s\n",
$xml_file,
@@ -340,7 +337,7 @@ test programs to assess a device's energy usage.
B<dfatool> [I<options>] enable|disable|maketest|rmtest|log|loop I<driver.xml>
-B<dfatool> [I<options>] analyze|validate|crossvalidate|ls|list|show
+B<dfatool> [I<options>] analyze|crossvalidate|ls|list|show
I<driver.xml> I<data.tar> [I<moredata.tar ...>]
=head1 VERSION
diff --git a/bin/merge.py b/bin/merge.py
index 8cf4dca..e5365b2 100755
--- a/bin/merge.py
+++ b/bin/merge.py
@@ -841,109 +841,6 @@ def crossvalidate(by_name, by_param, by_trace, model, parameters):
print('estimate function %s timeout by %s: MAE %.f µs, SMAPE %.2f%%' % (
name, param, np.mean(estimate_mae[name]), np.mean(estimate_smape[name])))
-def validate(by_name, by_param, parameters):
- aggdata = {
- 'state' : {},
- 'transition' : {},
- }
- for key, val in by_name.items():
- name = key
- isa = val['isa']
- model = data['model'][isa][name]
-
- if isa == 'state':
- aggdata[isa][name] = {
- 'power' : {
- 'goodness' : aggregate_measures(model['power']['static'], val['means']),
- 'median' : np.median(val['means']),
- 'mean' : np.mean(val['means']),
- 'std_inner' : np.std(val['means']),
- 'function' : {},
- },
- 'online_power' : {
- 'goodness' : regression_measures(np.array(val['online_means']), np.array(val['means'])),
- 'median' : np.median(val['online_means']),
- 'mean' : np.mean(val['online_means']),
- 'std_inner' : np.std(val['online_means']),
- 'function' : {},
- },
- 'online_duration' : {
- 'goodness' : regression_measures(np.array(val['online_durations']), np.array(val['durations'])),
- 'median' : np.median(val['online_durations']),
- 'mean' : np.mean(val['online_durations']),
- 'std_inner' : np.std(val['online_durations']),
- 'function' : {},
- },
- 'clip' : {
- 'mean' : np.mean(val['clip_rate']),
- 'max' : max(val['clip_rate']),
- },
- 'timeout' : {},
- }
- if 'function' in model['power']:
- aggdata[isa][name]['power']['function'] = {
- 'estimate' : {
- 'fit' : assess_function(model['power']['function']['estimate'],
- name, 'means', parameters, by_param),
- },
- 'user': {
- 'fit' : assess_function(model['power']['function']['user'],
- name, 'means', parameters, by_param),
- },
- }
- if isa == 'transition':
- aggdata[isa][name] = {
- 'duration' : {
- 'goodness' : aggregate_measures(model['duration']['static'], val['durations']),
- 'median' : np.median(val['durations']),
- 'mean' : np.mean(val['durations']),
- 'std_inner' : np.std(val['durations']),
- 'function' : {},
- },
- 'energy' : {
- 'goodness' : aggregate_measures(model['energy']['static'], val['energies']),
- 'median' : np.median(val['energies']),
- 'mean' : np.mean(val['energies']),
- 'std_inner' : np.std(val['energies']),
- 'function' : {},
- },
- 'rel_energy_prev' : {
- 'goodness' : aggregate_measures(model['rel_energy_prev']['static'], val['rel_energies_prev']),
- 'median' : np.median(val['rel_energies_prev']),
- 'mean' : np.mean(val['rel_energies_prev']),
- 'std_inner' : np.std(val['rel_energies_prev']),
- 'function' : {},
- },
- 'rel_energy_next' : {
- 'goodness' : aggregate_measures(model['rel_energy_next']['static'], val['rel_energies_next']),
- 'median' : np.median(val['rel_energies_next']),
- 'mean' : np.mean(val['rel_energies_next']),
- 'std_inner' : np.std(val['rel_energies_next']),
- 'function' : {},
- },
- 'clip' : {
- 'mean' : np.mean(val['clip_rate']),
- 'max' : max(val['clip_rate']),
- },
- 'timeout' : {},
- }
- if 'function' in model['timeout']:
- aggdata[isa][name]['timeout'] = {
- 'median' : np.median(val['timeouts']),
- 'mean' : np.mean(val['timeouts']),
- 'function': {
- 'estimate' : {
- 'fit' : assess_function(model['timeout']['function']['estimate'],
- name, 'timeouts', parameters, by_param),
- },
- 'user': {
- 'fit' : assess_function(model['timeout']['function']['user'],
- name, 'timeouts', parameters, by_param),
- },
- },
- }
- return aggdata
-
def analyze_by_param(aggval, by_param, allvalues, name, key1, key2, param, param_idx):
aggval[key1]['std_by_param'][param] = mean_std_by_param(
by_param, allvalues, name, key2, param_idx)
@@ -1129,9 +1026,7 @@ if 'substates' in opts:
else:
plotter.plot_substate_thresholds(data['model'], by_name)
-if 'validate' in opts:
- data['aggregate'] = validate(by_name, by_param, parameters)
-elif 'crossvalidate' in opts:
+if 'crossvalidate' in opts:
crossvalidate(by_name, by_param, by_trace, data['model'], parameters)
else:
data['aggregate'] = analyze(by_name, by_arg, by_param, by_trace, parameters)
diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm
index 432d0e5..481dc67 100644
--- a/lib/Kratos/DFADriver.pm
+++ b/lib/Kratos/DFADriver.pm
@@ -108,13 +108,6 @@ sub analyze {
$self->log->analyze( @{$json_files} );
}
-sub validate_model {
- my ( $self, @files ) = @_;
- my ( $logs, $json_files ) = $self->preprocess(@files);
- $self->log->validate( @{$json_files} );
- $self->assess_validation;
-}
-
sub crossvalidate_model {
my ( $self, @files ) = @_;
my ( $logs, $json_files ) = $self->preprocess(@files);
@@ -561,47 +554,6 @@ sub assess_model_tex {
say '\end{tabular}';
}
-sub assess_validation {
- my ($self) = @_;
-
- for my $name ( sort keys %{ $self->{log}{aggregate}{state} } ) {
- my $state = $self->{log}{aggregate}{state}{$name};
-
- printf( "Validating %s:\n", $name );
- $self->printf_clip($state);
- $self->printf_goodness( $self->model->get_state_power($name),
- $state, 'power', 'µW' );
- $self->printf_fit( $state, 'power', 'µW' );
- $self->printf_online_goodness(
- $state, 'online_power', 'µW' );
- $self->printf_online_goodness(
- $state, 'online_duration', 'µs' );
- }
- for my $name ( sort keys %{ $self->{log}{aggregate}{transition} } ) {
- my $transition = $self->{log}{aggregate}{transition}{$name};
-
- printf( "Validating %s:\n", $name );
- $self->printf_clip($transition);
- $self->printf_goodness(
- $self->model->get_transition_by_name($name)->{duration}{static},
- $transition, 'duration', 'µs' );
- $self->printf_goodness(
- $self->model->get_transition_by_name($name)->{energy}{static},
- $transition, 'energy', 'pJ' );
- $self->printf_goodness(
- $self->model->get_transition_by_name($name)->{rel_energy_prev}{static},
- $transition, 'rel_energy_prev', 'pJ' );
- if ( exists $transition->{rel_energy_next}{median} ) {
- $self->printf_goodness(
- $self->model->get_transition_by_name($name)->{rel_energy_next}{static},
- $transition, 'rel_energy_next', 'pJ' );
- }
- if ( exists $transition->{timeout}{median} ) {
- $self->printf_fit( $transition, 'timeout', 'µs' );
- }
- }
-}
-
sub update_model {
my ($self) = @_;