Skip to content

Commit

Permalink
Make max_duration configurable in task configuration (#807)
Browse files Browse the repository at this point in the history
Make max_duration configurable in mlperf_task.proto
  • Loading branch information
anhappdev authored Nov 14, 2023
1 parent 2cdc849 commit e02bdc8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/result-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ If you enable Submission mode, both `performance_run` and `accuracy_run` values
May be null if accuracy was not tested in this benchmark.
* `min_duration`: floating point number
Value from `task.min_duration` for this benchmark from selected tasks.pbtxt file.
* `max_duration`: floating point number
Value from `task.max_duration` for this benchmark from selected tasks.pbtxt file.
* `min_samples`: integer number
Value from `task.min_query_count` for this benchmark from selected tasks.pbtxt file.
* `backend_info`: map
Expand Down
6 changes: 6 additions & 0 deletions flutter/assets/tasks.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ task {
name: "Image Classification"
min_query_count: 1024
min_duration: 60
max_duration: 600
max_throughput: 1000
max_accuracy: 1.0
scenario: "SingleStream"
Expand Down Expand Up @@ -42,6 +43,7 @@ task {
name: "Object Detection"
min_query_count: 1024
min_duration: 60
max_duration: 600
max_throughput: 2000
max_accuracy: 1.0
scenario: "SingleStream"
Expand Down Expand Up @@ -78,6 +80,7 @@ task {
name: "v2.0 Image Segmentation"
min_query_count: 1024
min_duration: 60
max_duration: 600
max_throughput: 2000
max_accuracy: 1.0
scenario: "SingleStream"
Expand Down Expand Up @@ -113,6 +116,7 @@ task {
name: "Language Understanding"
min_query_count: 1024
min_duration: 60
max_duration: 600
max_throughput: 2000
max_accuracy: 1.0
scenario: "SingleStream"
Expand Down Expand Up @@ -145,6 +149,7 @@ task {
name: "Super Resolution "
min_query_count: 1024
min_duration: 60
max_duration: 600
max_throughput: 2000
max_accuracy: 1.0
scenario: "SingleStream"
Expand Down Expand Up @@ -179,6 +184,7 @@ task {
name: "Image Classification (Offline)"
min_query_count: 24576
min_duration: 0
max_duration: 0
max_throughput: 2000
max_accuracy: 1.0
scenario: "Offline"
Expand Down
6 changes: 4 additions & 2 deletions flutter/cpp/proto/mlperf_task.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ message MLPerfConfig {
// Config of the mlperf tasks.
// A task is basically a combination of models and a dataset.
//
// Next ID: 10
// Next ID: 11
message TaskConfig {
// Must be unique in one task file. Ex: image_classification
// used to match backend settings
Expand All @@ -41,7 +41,9 @@ message TaskConfig {
// Minimum number of samples the test should run in the performance mode.
required int32 min_query_count = 3;
// Minimum duration the test should run in the performance mode, in seconds.
required double min_duration = 4;
required double min_duration = 4 [default = 60];
// Maximum duration the test should run in the performance mode, in seconds.
required double max_duration = 10 [default = 600];
// Max expected throughput score
required float max_throughput = 5;
// Max expected accuracy
Expand Down
4 changes: 0 additions & 4 deletions flutter/lib/app_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,3 @@ class BackendId {
apple,
];
}

class BenchmarkSettings {
static const double maxDuration = 10 * 60; // 10 minutes
}
2 changes: 1 addition & 1 deletion flutter/lib/benchmark/benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class Benchmark {
final dataset = runMode.chooseDataset(taskConfig);

int minQueryCount;
double maxDuration = BenchmarkSettings.maxDuration;
double minDuration;
if (testMinDuration != 0) {
minQueryCount = testMinQueryCount;
Expand All @@ -85,6 +84,7 @@ class Benchmark {
minQueryCount = taskConfig.minQueryCount;
minDuration = taskConfig.minDuration;
}
double maxDuration = taskConfig.maxDuration;

final settings = pb.SettingList(
setting: commonSettings,
Expand Down

0 comments on commit e02bdc8

Please sign in to comment.