Skip to content

Commit

Permalink
Fixed benchmark test.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgsharp committed May 13, 2021
1 parent 86e02fa commit a4a7350
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/Microsoft.ML.PerformanceTests/Harness/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ namespace Microsoft.ML.PerformanceTests
{
public class RecommendedConfig : ManualConfig
{
protected static readonly IReadOnlyList<MsBuildArgument> msbuildArguments = new List<MsBuildArgument>() { new MsBuildArgument($"/p:Configuration={GetBuildConfigurationName()}") };

public RecommendedConfig()
{
Add(DefaultConfig.Instance); // this config contains all of the basic settings (exporters, columns etc)

Add(GetJobDefinition() // job defines how many times given benchmark should be executed
.With(msbuildArguments)
.WithCustomBuildConfiguration(GetBuildConfigurationName())
.With(CreateToolchain())); // toolchain is responsible for generating, building and running dedicated executable per benchmark

Add(new ExtraMetricColumn()); // an extra column that can display additional metric reported by the benchmarks
Expand Down Expand Up @@ -60,7 +58,7 @@ private IToolchain CreateToolchain()
csProj.Executor);
}

private static string GetBuildConfigurationName()
protected static string GetBuildConfigurationName()
{
#if NETCOREAPP3_1
return "Release-netcoreapp3_1";
Expand All @@ -76,7 +74,7 @@ public class TrainConfig : RecommendedConfig
{
protected override Job GetJobDefinition()
=> Job.Dry // the "Dry" job runs the benchmark exactly once, without any warmup to mimic real-world scenario
.With(msbuildArguments)
.WithCustomBuildConfiguration(GetBuildConfigurationName())
.WithLaunchCount(3); // BDN will run 3 dedicated processes, sequentially
}
}

0 comments on commit a4a7350

Please sign in to comment.