Skip to content

Commit ad42e89

Browse files
Enable wasm aot microbenchmark run (#1902)
* copy back the helix job folder for diagnosis * copy back the helix job folder for diagnosis * hack:setting WasmNativeWorkload=false for wasm run. should be removed before PR * fixed merge confict * fix copyjob * move copy helix job-* folder code to benchmarks_ci.py * update benchmarkdotnet version * add more log info for diagnosis * suppress an unnecessory exception * fix copy back job-* folder * fix copy job * correct helixuploadroot * add error handling * fix copy path * enabled binlog * rethrow * add back copy job folder for diagnosis * dotnet workload install wasm-tools to work around missing workload error * run dotnet workload install wasm-tools from dotnet-wasm directory to use the same nuget.config * install wasm-tools workload from perf directory * install wasm-tools workload with a specific nuget.config with wasm feed * fix path * workdir of install wasm-tools * Get PR#1891 from main * update to new version of benchmarkdotnet for wasm aot fixes * add -d to print diagnostic info for wasm_tools workload installation failure * Allow to build with local BenchmarkDotNet sources Make it easier to use custom BenchmarkDotNet sources. Example use: dotnet build -bl -c Release -p:BenchmarkDotNetSources="\myPath\git\BenchmarkDotNet\" src\benchmarks\micro * Set _BenchmarkDotNetSourcesN conditionaly To avoid: src\harness\BenchmarkDotNet.Extensions\BenchmarkDotNet.Extensions.csproj(6,5): error MSB4184: The expression "[MSBuild]::NormalizeDirectory('')" cannot be evaluated. Parameter "path" cannot have zero length. * Use _BenchmarkDotNetSourcesN * Use BenchmarkDotNet sources in payload * update to newer benchmarkdotnet version * remove testing code * update bdn version * remove duplicated section * print out args.configuration for diagnosis * print args * print args * minor fix * looks up wasm in ExtraBenchmarkDotNetArguments * check wasmEngine for wasm runs * minor fix * minor fix * remove work around code for install wasm_tools workload, WasmNativeWorkload property. mark perf_file.WriteAllBytesAsync not run under wasm since async is not supported under wasm * add back Directory.Build.props to see if can work around an aot build error * disable FlushAsync test from wasm run since async is not supported. Co-authored-by: Radek Doulik <radekdoulik@gmail.com>
1 parent 28eceb0 commit ad42e89

File tree

9 files changed

+30
-8
lines changed

9 files changed

+30
-8
lines changed

docs/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<WasmNativeWorkload>false</WasmNativeWorkload>
5+
</PropertyGroup>
6+
</Project>

scripts/benchmarks_ci.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def __is_valid_datetime(dt: str) -> str:
157157
action='store_true',
158158
help='Attempts to run the benchmarks without building.',
159159
)
160-
161160
return parser
162161

163162

@@ -171,7 +170,6 @@ def __process_arguments(args: list):
171170
add_arguments(parser)
172171
return parser.parse_args(args)
173172

174-
175173
def __main(args: list) -> int:
176174
validate_supported_runtime()
177175
args = __process_arguments(args)
@@ -270,6 +268,5 @@ def __main(args: list) -> int:
270268
upload.upload(globpath, upload_container, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
271269
# TODO: Archive artifacts.
272270

273-
274271
if __name__ == "__main__":
275272
__main(sys.argv[1:])

scripts/micro_benchmarks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ def run(
313313
verbose,
314314
*run_args
315315
)
316-
317-
316+
318317
def __log_script_header(message: str):
319318
getLogger().info('-' * len(message))
320319
getLogger().info(message)
@@ -361,7 +360,6 @@ def __main(args: list) -> int:
361360
verbose,
362361
args
363362
)
364-
365363
return 0
366364
except CalledProcessError as ex:
367365
getLogger().error(

scripts/performance/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ def helixpayload():
8080
'''
8181
return environ.get('HELIX_CORRELATION_PAYLOAD')
8282

83+
def helixuploadroot():
84+
'''
85+
Returns the helix upload root. Will be None outside of helix.
86+
'''
87+
return environ.get('HELIX_WORKITEM_UPLOAD_ROOT')
88+
8389
def runninginlab():
8490
return environ.get('PERFLAB_INLAB') is not None
8591

src/benchmarks/micro/libraries/System.IO.FileSystem/Perf.File.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public void SetupWriteAllBytes()
8181
public void WriteAllBytes(int size) => File.WriteAllBytes(_testFilePath, _userBuffers[size]);
8282

8383
#if !NETFRAMEWORK
84+
[BenchmarkCategory(Categories.NoWASM)]
8485
[Benchmark]
8586
[Arguments(HalfKibibyte)]
8687
[Arguments(FourKibibytes)]

src/benchmarks/micro/libraries/System.IO.FileSystem/Perf.FileStream.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ public void Flush(long fileSize, FileOptions options)
322322
}
323323
}
324324

325+
[BenchmarkCategory(Categories.NoWASM)]
325326
[Benchmark]
326327
[Arguments(OneKibibyte, FileOptions.None)]
327328
[Arguments(OneKibibyte, FileOptions.Asynchronous)]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
6+
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
7+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
8+
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
9+
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
10+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
11+
<add key="benchmark-dotnet-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/benchmark-dotnet-prerelease/nuget/v3/index.json" />
12+
</packageSources>
13+
</configuration>

src/harness/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PropertyGroup Condition="'$(BenchmarkDotNetSources)' != ''">
88
<_BenchmarkDotNetSourcesN>$([MSBuild]::NormalizeDirectory('$(BenchmarkDotNetSources)'))</_BenchmarkDotNetSourcesN>
99
</PropertyGroup>
10-
<ItemGroup>
10+
<ItemGroup Condition="'$(BenchmarkDotNetSources)' == ''">
1111
<PackageReference Include="BenchmarkDotNet" Version="0.13.0.1579" />
1212
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.0.1579" />
1313
</ItemGroup>

src/harness/BenchmarkDotNet.Extensions/RecommendedConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static IConfig Create(
3737
.DontEnforcePowerPlan(); // make sure BDN does not try to enforce High Performance power plan on Windows
3838

3939
// See https://github.com/dotnet/roslyn/issues/42393
40-
job = job.WithArguments(new Argument[] { new MsBuildArgument("/p:DebugType=portable") });
40+
job = job.WithArguments(new Argument[] { new MsBuildArgument("/p:DebugType=portable"), new MsBuildArgument("-bl:benchmarkdotnet.binlog") });
4141
}
4242

4343
var config = ManualConfig.CreateEmpty()

0 commit comments

Comments
 (0)