Skip to content

Commit 390f130

Browse files
authored
feat: show run mode in the UI (#947)
* Change quick mode parameters * Add BenchmarkRunModeEnum to ResultMetaInfo * Show BenchmarkRunModeEnum in the result screen * Show BenchmarkRunModeEnum in the history screen * Print error * Format Dart files * Remove obsolete sample generator and linter * Use dart run instead of flutter pub run * Show BenchmarkRunModeEnum in running screen * Fix UI issue with overflowing widgets * Update expected_throughput
1 parent 751e965 commit 390f130

File tree

14 files changed

+91
-163
lines changed

14 files changed

+91
-163
lines changed

.github/workflows/format-and-lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ jobs:
9090
run: make format/dart/pub-get
9191
- name: lint/dart
9292
run: make lint/dart
93-
- name: result-schema
94-
run: make lint/result-schema
9593

9694
swift:
9795
needs: build-image

flutter/assets/tasks.pbtxt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ task {
1515
}
1616
quick {
1717
min_query_count: 128
18-
min_duration: 6
18+
min_duration: 10
1919
max_duration: 60
2020
}
2121
rapid {
@@ -72,7 +72,7 @@ task {
7272
}
7373
quick {
7474
min_query_count: 128
75-
min_duration: 6
75+
min_duration: 10
7676
max_duration: 60
7777
}
7878
rapid {
@@ -129,7 +129,7 @@ task {
129129
}
130130
quick {
131131
min_query_count: 128
132-
min_duration: 6
132+
min_duration: 10
133133
max_duration: 60
134134
}
135135
rapid {
@@ -185,7 +185,7 @@ task {
185185
}
186186
quick {
187187
min_query_count: 128
188-
min_duration: 6
188+
min_duration: 10
189189
max_duration: 60
190190
}
191191
rapid {
@@ -238,7 +238,7 @@ task {
238238
}
239239
quick {
240240
min_query_count: 128
241-
min_duration: 6
241+
min_duration: 10
242242
max_duration: 60
243243
}
244244
rapid {
@@ -298,8 +298,8 @@ task {
298298
}
299299
rapid {
300300
min_query_count: 64
301-
min_duration: 6
302-
max_duration: 60
301+
min_duration: 0
302+
max_duration: 0
303303
}
304304
}
305305
datasets {
@@ -350,8 +350,8 @@ task {
350350
}
351351
quick {
352352
min_query_count: 128
353-
min_duration: 6
354-
max_duration: 30
353+
min_duration: 10
354+
max_duration: 40
355355
}
356356
rapid {
357357
min_query_count: 64

flutter/flutter.mk

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ endif
2929
endif
3030

3131
flutter: flutter/prepare flutter/platform
32-
flutter/result: flutter/result/json flutter/result/gen-schema
32+
flutter/result: flutter/result/json
3333
flutter/prepare: flutter/pub flutter/result/json flutter/backend-list flutter/protobuf flutter/l10n flutter/build-info flutter/firebase-config flutter/set-windows-build-number
3434
flutter/check-release-env: flutter/check/official-build flutter/check/build-number
3535
flutter/test: flutter/test/unit flutter/test/integration
@@ -73,32 +73,11 @@ flutter/backend-list:
7373
> flutter/lib/backend/list.gen.dart
7474
dart format flutter/lib/backend/list.gen.dart
7575

76-
RESULT_JSON_SAMPLE_PATH?=output/extended_result_example.json
77-
.PHONY: flutter/result/gen-extended-sample
78-
flutter/result/gen-extended-sample:
79-
cd flutter && \
80-
${_start_args} dart run \
81-
--define=jsonFileName=../${RESULT_JSON_SAMPLE_PATH} \
82-
lib/data/generation_helpers/write_json_sample.main.dart
83-
84-
default_result_json_schema_path=tools/extended_result_schema.json
85-
RESULT_JSON_SCHEMA_PATH?=${default_result_json_schema_path}
86-
.PHONY: flutter/result/gen-schema
87-
flutter/result/gen-schema: flutter/result/gen-extended-sample
88-
quicktype ${RESULT_JSON_SAMPLE_PATH} \
89-
--lang schema \
90-
--out ${RESULT_JSON_SCHEMA_PATH}
91-
cd flutter && \
92-
${_start_args} dart run \
93-
--define=schemaPath=../${RESULT_JSON_SCHEMA_PATH} \
94-
lib/data/generation_helpers/edit_json_schema.main.dart
95-
9676
.PHONY: flutter/result/json
9777
flutter/result/json:
9878
@echo "Generate .g.dart files for the @JsonSerializable annotation"
99-
@# https://github.com/dart-lang/build/issues/2835#issuecomment-1047849076
100-
cd flutter && ${_start_args} flutter packages pub get
101-
cd flutter && ${_start_args} flutter --no-version-check pub run \
79+
cd flutter && ${_start_args} dart pub get
80+
cd flutter && ${_start_args} dart run \
10281
build_runner build --delete-conflicting-outputs
10382

10483
.PHONY: flutter/build-info

flutter/integration_test/expected_throughput.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const Map<String, Map<String, Interval>> _imageClassificationV2 = {
6060
_kS24Ultra: Interval(min: 800, max: 1500),
6161
},
6262
_kMediatekBackend: {
63-
_kDN2103: Interval(min: 5, max: 90),
63+
_kDN2103: Interval(min: 4.5, max: 90),
6464
_kS10Plus: Interval(min: 400, max: 800)
6565
},
6666
_kSamsungBackend: {
@@ -88,11 +88,11 @@ const Map<String, Map<String, Interval>> _objectDetection = {
8888
},
8989
_kQtiBackend: {
9090
_kS22Ultra: Interval(min: 700, max: 1400),
91-
_kS24Ultra: Interval(min: 1800, max: 2500),
91+
_kS24Ultra: Interval(min: 1800, max: 2700),
9292
},
9393
_kMediatekBackend: {
9494
_kDN2103: Interval(min: 120, max: 210),
95-
_kS10Plus: Interval(min: 1200, max: 1800)
95+
_kS10Plus: Interval(min: 1200, max: 2000)
9696
},
9797
_kSamsungBackend: {
9898
_kS24: Interval(min: 1400, max: 2400),
@@ -123,7 +123,7 @@ const Map<String, Map<String, Interval>> _imageSegmentationV2 = {
123123
},
124124
_kMediatekBackend: {
125125
_kDN2103: Interval(min: 45, max: 70),
126-
_kS10Plus: Interval(min: 800, max: 1400)
126+
_kS10Plus: Interval(min: 800, max: 1500)
127127
},
128128
_kSamsungBackend: {
129129
_kS24: Interval(min: 800, max: 1500),
@@ -150,7 +150,7 @@ const Map<String, Map<String, Interval>> _naturalLanguageProcessing = {
150150
},
151151
_kQtiBackend: {
152152
_kS22Ultra: Interval(min: 100, max: 200),
153-
_kS24Ultra: Interval(min: 250, max: 450),
153+
_kS24Ultra: Interval(min: 250, max: 460),
154154
},
155155
_kMediatekBackend: {
156156
_kDN2103: Interval(min: 1, max: 6),
@@ -185,7 +185,7 @@ const Map<String, Map<String, Interval>> _superResolution = {
185185
},
186186
_kMediatekBackend: {
187187
_kDN2103: Interval(min: 5, max: 15),
188-
_kS10Plus: Interval(min: 150, max: 280)
188+
_kS10Plus: Interval(min: 150, max: 300)
189189
},
190190
_kSamsungBackend: {
191191
_kS24: Interval(min: 90, max: 180),
@@ -244,10 +244,10 @@ const Map<String, Map<String, Interval>> _imageClassificationOfflineV2 = {
244244
},
245245
_kQtiBackend: {
246246
_kS22Ultra: Interval(min: 250, max: 450),
247-
_kS24Ultra: Interval(min: 900, max: 1600),
247+
_kS24Ultra: Interval(min: 900, max: 1700),
248248
},
249249
_kMediatekBackend: {
250-
_kDN2103: Interval(min: 5, max: 90),
250+
_kDN2103: Interval(min: 4.5, max: 90),
251251
_kS10Plus: Interval(min: 700, max: 1200)
252252
},
253253
_kSamsungBackend: {

flutter/lib/benchmark/state.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BenchmarkState extends ChangeNotifier {
106106
await setTaskConfig(name: _store.chosenConfigurationName);
107107
deferredLoadResources();
108108
} catch (e, trace) {
109-
print("can't load resources: $e");
109+
print("Can't load resources: $e");
110110
print(trace);
111111
error = e;
112112
stackTrace = trace;
@@ -122,7 +122,7 @@ class BenchmarkState extends ChangeNotifier {
122122
try {
123123
await loadResources(downloadMissing: false);
124124
} catch (e, trace) {
125-
print("can't load resources: $e");
125+
print("Can't load resources: $e");
126126
print(trace);
127127
error = e;
128128
stackTrace = trace;
@@ -164,7 +164,7 @@ class BenchmarkState extends ChangeNotifier {
164164
await state.setTaskConfig(name: store.chosenConfigurationName);
165165
state.deferredLoadResources();
166166
} catch (e, trace) {
167-
print("can't load resources: $e");
167+
print("Can't load resources: $e");
168168
print(trace);
169169
state.error = e;
170170
state.stackTrace = trace;
@@ -199,7 +199,7 @@ class BenchmarkState extends ChangeNotifier {
199199
taskSelection[kv.key] = kv.value as bool;
200200
}
201201
} catch (e, t) {
202-
print('task selection parse fail: $e');
202+
print('Task selection parse fail: $e');
203203
print(t);
204204
}
205205
}
@@ -255,7 +255,7 @@ class BenchmarkState extends ChangeNotifier {
255255
await taskRunner.runBenchmarks(_benchmarkStore, currentLogDir);
256256

257257
if (lastResult == null) {
258-
print('benchmark aborted');
258+
print('Benchmark aborted');
259259
} else {
260260
print('Benchmarks finished');
261261

@@ -267,6 +267,7 @@ class BenchmarkState extends ChangeNotifier {
267267
_doneRunning = taskRunner.aborting ? null : true;
268268
} catch (e) {
269269
_doneRunning = null;
270+
print('Error: $e');
270271
rethrow;
271272
} finally {
272273
if (currentLogDir.isNotEmpty && !_store.keepLogs) {

flutter/lib/data/generation_helpers/edit_json_schema.main.dart

Lines changed: 0 additions & 56 deletions
This file was deleted.

flutter/lib/data/generation_helpers/sample_generator.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:uuid/uuid.dart';
22

33
import 'package:mlperfbench/backend/loadgen_info.dart';
4+
import 'package:mlperfbench/benchmark/run_mode.dart';
45
import 'package:mlperfbench/data/build_info/build_info.dart';
56
import 'package:mlperfbench/data/environment/env_android.dart';
67
import 'package:mlperfbench/data/environment/env_ios.dart';
@@ -132,6 +133,7 @@ class SampleGenerator {
132133
creationDate: DateTime.now(),
133134
uploadDate: DateTime.now(),
134135
uuid: const Uuid().v4(),
136+
runMode: BenchmarkRunModeEnum.submissionRun,
135137
),
136138
buildInfo: buildInfo,
137139
environmentInfo: envInfo,

flutter/lib/data/generation_helpers/write_json_sample.main.dart

Lines changed: 0 additions & 33 deletions
This file was deleted.

flutter/lib/data/meta_info.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import 'package:json_annotation/json_annotation.dart';
22

3+
import 'package:mlperfbench/benchmark/run_mode.dart';
4+
35
part 'meta_info.g.dart';
46

57
@JsonSerializable(fieldRename: FieldRename.snake)
68
class ResultMetaInfo {
79
final String uuid;
810
final DateTime creationDate;
911
final DateTime? uploadDate;
12+
final BenchmarkRunModeEnum? runMode;
1013

1114
ResultMetaInfo({
1215
required this.uuid,
1316
required this.creationDate,
17+
required this.runMode,
1418
DateTime? uploadDate,
1519
}) : uploadDate = uploadDate?.toUtc();
1620

flutter/lib/state/task_runner.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ class TaskRunner {
151151
}
152152

153153
final creationDate = DateTime.now();
154+
final meta = ResultMetaInfo(
155+
creationDate: creationDate,
156+
uuid: const Uuid().v4(),
157+
runMode: store.selectedBenchmarkRunMode,
158+
);
154159
return ExtendedResult(
155-
meta: ResultMetaInfo(creationDate: creationDate, uuid: const Uuid().v4()),
160+
meta: meta,
156161
environmentInfo: DeviceInfo.instance.envInfo,
157162
results: exportResults,
158163
buildInfo: BuildInfoHelper.info,

0 commit comments

Comments
 (0)