Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/benchmarkdotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ BenchmarkDotNet is the benchmarking tool that allows to run benchmarks for .NET,
- [Running In Process](#running-in-process)
- [CoreRun](#corerun)
- [dotnet cli](#dotnet-cli)
- [Private CLR Build](#private-clr-build)
- [Private CoreRT Build](#private-corert-build)
Comment thread
lewing marked this conversation as resolved.

## Main Concepts
Expand Down
30 changes: 30 additions & 0 deletions docs/benchmarking-workflow-dotnet-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Install v8 engine](#install-v8-engine)
- [Run the benchmarks with the interpreter](#run-the-benchmarks-with-the-interpreter)
- [Run the benchmarks with AOT](#run-the-benchmarks-with-aot)
- [Run CoreCLR WASM ReadyToRun with a nightly or VMR SDK](#run-coreclr-wasm-readytorun-with-a-nightly-or-vmr-sdk)
- [Note about "file ... being used by another process" error](#note-about-file--being-used-by-another-process-error)
- [dotnet runtime testing for MonoAOT](#dotnet-runtime-testing-for-monoaot)
- [Prerequisites (Files either built locally (with build.(sh/cmd) or downloaded from payload above (if same system setup) (in this order))](#prerequisites-files-either-built-locally-with-buildshcmd-or-downloaded-from-payload-above-if-same-system-setup-in-this-order)
Expand Down Expand Up @@ -204,6 +205,35 @@ Essentially, add `--aotcompilermode wasm` to the `--bdn-arguments=".."`:
--bdn-arguments="--category-exclusion-filter NoInterpreter NoWASM NoMono --aotcompilermode wasm --logBuildOutput --buildTimeout 3600 --filter <filter>"
```

#### Run CoreCLR WASM ReadyToRun with a nightly or VMR SDK

Use an exact SDK version together with a NuGet source containing the matching
browser runtime/ref, WebAssembly SDK, host-specific Crossgen2, and ILLink
packages, plus the complete `wasm-tools` pack closure. The source can be a
downloaded VMR package directory or a coherent feed. Workload manifest updates
are disabled and only exact versions recorded by the selected SDK are restored
from that source, so packages cannot float to another build cohort.

```cmd
/path/to/dotnet/performance$ python3 ./scripts/benchmarks_ci.py \
--csproj src/benchmarks/micro/MicroBenchmarks.csproj \
-f net11.0 \
--dotnet-versions <vmr-sdk-version> \
--wasm \
--wasm-runtime-flavor CoreCLR \
--wasm-ready-to-run \
--wasm-workload-source /path/to/vmr/packages \
--run-isolated \
--bdn-artifacts artifacts/BenchmarkDotNet.Artifacts \
--bdn-arguments="--category-exclusion-filter NoWASM --logBuildOutput --buildTimeout 3600 --filter <filter>"
```

Omit `--dotnet-versions` to use the existing `main` daily-channel SDK
selection. In that case the package source must contain the product version
recorded in that SDK's `Microsoft.NETCoreSdk.BundledVersions.props`.
`PERFLAB_WASM_PACKAGE_VERSION` should remain unset; that override is reserved
for non-official runtime payloads.

#### Note about "file ... being used by another process" error

If you are seeing warnings like:
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/run-performance-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ parameters:
iOSStripSymbols: true # optional -- Whether to strip symbols from the iOS build
machinePool: '' # optional -- Machine pool name (e.g. Pixel8, GalaxyA16, iPhone17)
additionalSetupParameters: '' # optional -- Additional arguments to pass to the script
wasmWorkloadSource: '' # optional -- Exclusive coherent package source for SDK CoreCLR browser-WASM
liveLibrariesBuildConfig: '' # optional -- Build configuration when generating Core_Root for libraries
crossBuild: false # optional -- Whether the Core_Root is being cross-compiled

Expand Down Expand Up @@ -241,6 +242,8 @@ jobs:
- '--cross-build'
- ${{ if ne(parameters.additionalSetupParameters, '') }}:
- '${{ parameters.additionalSetupParameters }}'
- ${{ if and(ne(parameters.wasmWorkloadSource, ''), eq(parameters.runtimeType, 'wasm_coreclr'), eq(parameters.r2rRunType, 'r2r')) }}:
- '--wasm-workload-source "${{ parameters.wasmWorkloadSource }}"'
- template: /eng/pipelines/templates/send-to-helix-step.yml
parameters:
osGroup: ${{ parameters.osGroup }}
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/runtime-perf-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
isScenario: false
downloadSpecificBuild: null # buildId, pipeline, branchName, project
crossBuild: false
wasmWorkloadSource: ''
runtimeRepoAlias: runtime
performanceRepoAlias: self
selfIsRuntime: true
Expand Down
25 changes: 25 additions & 0 deletions scripts/benchmarks_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ def __is_valid_dotnet_path(dp: str) -> str:
type=__is_valid_dotnet_path,
help='Path to a custom dotnet'
)
parser.add_argument(
'--wasm-workload-source',
dest='wasm_workload_source',
required=False,
help=(
'Exclusive NuGet source containing the coherent browser-WASM workload '
'packages for the selected SDK. Requires CoreCLR WASM ReadyToRun.')
)

parser.add_argument('--upload-to-perflab-container',
dest="upload_to_perflab_container",
Expand Down Expand Up @@ -220,6 +228,14 @@ def main(argv: list[str]):
raise Exception("Framework version (-f) must be specified.")

target_framework_monikers = dotnet.get_target_framework_monikers(args.frameworks)
if args.wasm_workload_source and not (
args.wasm
and args.wasm_runtime_flavor == 'CoreCLR'
and args.wasm_ready_to_run):
raise ValueError(
'--wasm-workload-source requires --wasm '
'--wasm-runtime-flavor CoreCLR --wasm-ready-to-run')

# Acquire necessary tools (dotnet)
if not args.dotnet_path:
init_tools(
Expand All @@ -233,6 +249,15 @@ def main(argv: list[str]):
else:
dotnet.setup_dotnet(args.dotnet_path)

if args.wasm_workload_source:
os.environ.pop('PERFLAB_WASM_PACKAGE_VERSION', None)
dotnet.install_wasm_workload(
architecture=args.architecture,
target_framework_monikers=target_framework_monikers,
package_source=args.wasm_workload_source,
sdk_versions=args.dotnet_versions,
verbose=verbose)

# WORKAROUND
# The MicroBenchmarks.csproj targets .NET Core 2.1, 3.0, 3.1 and 5.0
# to avoid a build failure when using older frameworks (error NETSDK1045:
Expand Down
Loading