Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
274fe9f
Superpmi on Microbenchmarks
kunalspathak Feb 5, 2021
bbce7a1
Fix the mch file path name
kunalspathak Feb 5, 2021
1981398
distribute the benchmarks in 30 partitions
kunalspathak Feb 5, 2021
2d5e864
Set input directory for benchmarks
kunalspathak Feb 5, 2021
ebcb545
Some fixes to superpmi_benchmarks
kunalspathak Feb 5, 2021
492bc68
fix the name of partition_index and partition_count
kunalspathak Feb 5, 2021
911a76d
Point the core_root path to the superpmi script
kunalspathak Feb 5, 2021
78fd0a2
fix python to invoke for setup
kunalspathak Feb 6, 2021
94cafa2
Add verbosity and include all benchmarks
kunalspathak Feb 6, 2021
31f4d8a
Fix the benchmarks invocation
kunalspathak Feb 6, 2021
8a44aa6
use benchmarks_ci.py script
kunalspathak Feb 9, 2021
bb59d9f
run all benchmarks
kunalspathak Feb 9, 2021
ce26da6
fix the performance source code path
kunalspathak Feb 9, 2021
8a5b218
see why dotnet install fails
kunalspathak Feb 10, 2021
f1a2dc2
Comment all jobs except benchmarks
kunalspathak Feb 10, 2021
c04d9d1
update the right fork
kunalspathak Feb 10, 2021
15ef3f2
Switch back to doing installing dotnet on azure machine
kunalspathak Feb 10, 2021
d28093a
Put dotnet in script
kunalspathak Feb 10, 2021
8725b85
fix dumpMap, revert change in superpmi.py
kunalspathak Feb 10, 2021
04ec939
Produce artifacts in temp folder
kunalspathak Feb 11, 2021
8def38a
Experimental: Exit on failure
kunalspathak Feb 11, 2021
c5d47a4
Revert "Produce artifacts in temp folder"
kunalspathak Feb 11, 2021
2d8d1b2
Use JitName
kunalspathak Feb 11, 2021
df48a3b
Use workitem folder instead of correlation
kunalspathak Feb 11, 2021
29d6cdf
fix typo in WorkItemDirectory
kunalspathak Feb 11, 2021
114e039
Set the payload directory
kunalspathak Feb 11, 2021
eb40f58
print error message before exiting
kunalspathak Feb 11, 2021
6ffc43f
fix some linux issues
kunalspathak Feb 12, 2021
da184e1
Make dotnet executable
kunalspathak Feb 12, 2021
8d8c7b5
resolve merge conflicts
kunalspathak Feb 12, 2021
05bb56f
fix typo from merge conflict
kunalspathak Feb 12, 2021
de9594e
add logging around chmod
kunalspathak Feb 12, 2021
4ac45bd
fix the is_windows condition
kunalspathak Feb 12, 2021
58e1c8d
cleanup and disable linux arm/arm64
kunalspathak Feb 12, 2021
8d198fc
Merge branch 'master' into spmi-benchmark
kunalspathak Feb 12, 2021
8af3151
remove the unwanted parameter
kunalspathak Feb 13, 2021
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
32 changes: 27 additions & 5 deletions eng/pipelines/coreclr/superpmi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ jobs:
collectionType: crossgen
collectionName: libraries

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-job.yml
buildConfig: checked
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
- Linux_arm
- Linux_arm64
- Linux_x64
- windows_x64
- windows_x86
- windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
collectionType: pmi
collectionName: tests

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-job.yml
Expand Down Expand Up @@ -123,8 +145,9 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
- Linux_arm
- Linux_arm64
#TODO: Need special handling of running "benchmark build" from inside TMP folder on helix machine.
# - Linux_arm
# - Linux_arm64
- Linux_x64
- windows_x64
- windows_x86
Expand All @@ -135,6 +158,5 @@ jobs:
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
collectionType: pmi
collectionName: tests

collectionType: run
collectionName: benchmarks
5 changes: 4 additions & 1 deletion eng/pipelines/coreclr/templates/run-superpmi-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ jobs:
- ${{ if eq(parameters.collectionName, 'libraries') }}:
- name: InputDirectory
value: '$(Core_Root_Dir)'
- ${{ if eq(parameters.collectionName, 'benchmarks') }}:
- name: InputDirectory
value: '$(Core_Root_Dir)'
- ${{ if eq(parameters.collectionName, 'tests') }}:
- name: InputDirectory
value: '$(managedTestArtifactRootFolderPath)'
Expand All @@ -103,7 +106,7 @@ jobs:
steps:
- ${{ parameters.steps }}

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB
displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }}

# Run superpmi collection in helix
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//

constexpr GUID JITEEVersionIdentifier = { /* 6ca59d19-13a4-44f7-a184-e9cd1e8f57f8 */
0x6ca59d19,
0x13a4,
0x44f7,
{ 0xa1, 0x84, 0xe9, 0xcd, 0x1e, 0x8f, 0x57, 0xf8 }
constexpr GUID JITEEVersionIdentifier = { /* af37688b-d4e5-4a41-a7ee-701728a470aa */
0xaf37688b,
0xd4e5,
0x4a41,
{0xa7, 0xee, 0x70, 0x17, 0x28, 0xa4, 0x70, 0xaa}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
110 changes: 84 additions & 26 deletions src/coreclr/scripts/superpmi.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">

<!--
This is useful for local testing to print the produced helix items
To use this when you are changing how items are produced, uncomment the target
and replace the Project item at the top of the file with this:
<Project DefaultTargets="printItems">

Once you've done that you can run this to see the results:
dotnet msbuild .\superpmi.proj /v:n
-->

<!-- <PropertyGroup>
<HelixTargetQueues>Some_Queue</HelixTargetQueues>
<InputArtifacts>D:\git\runtime\workitem\pmiAssembliesDirectory\libraries</InputArtifacts>
<MchFileTag>x64.checked</MchFileTag>
<CollectionName>benchmarks</CollectionName>
<CollectionType>pmi</CollectionType>
</PropertyGroup>
<Target Name="printItems">
<Message Text="@(HelixWorkItem -> 'name: %(HelixWorkItem.Identity)
dir: %(HelixWorkItem.PayloadDirectory)
pre: %(HelixWorkItem.PreCommands)
command: %(HelixWorkItem.Command)
post: %(HelixWorkItem.PostCommands)
timeout: %(HelixWorkItem.Timeout) '"/>
</Target> -->

<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<FileSeparatorChar>\</FileSeparatorChar>
</PropertyGroup>
Expand All @@ -21,6 +47,10 @@
<PmiAssembliesPayload>$(WorkItemDirectory)\pmiAssembliesDirectory</PmiAssembliesPayload>
<PmiAssembliesDirectory>%HELIX_WORKITEM_PAYLOAD%\binaries</PmiAssembliesDirectory>
<SuperPMIDirectory>%HELIX_CORRELATION_PAYLOAD%\superpmi</SuperPMIDirectory>

<!-- Related to Benchmarks -->
<PerformanceDirectory>%HELIX_WORKITEM_PAYLOAD%\performance</PerformanceDirectory>

<OutputMchPath>%HELIX_WORKITEM_UPLOAD_ROOT%</OutputMchPath>
<!-- Workaround until https://github.com/dotnet/arcade/pull/6179 is not available -->
<HelixResultsDestinationDir>$(BUILD_SOURCESDIRECTORY)\artifacts\helixresults</HelixResultsDestinationDir>
Expand All @@ -31,6 +61,10 @@
<PmiAssembliesPayload>$(WorkItemDirectory)/pmiAssembliesDirectory</PmiAssembliesPayload>
<PmiAssembliesDirectory>$HELIX_WORKITEM_PAYLOAD/binaries</PmiAssembliesDirectory>
<SuperPMIDirectory>$HELIX_CORRELATION_PAYLOAD/superpmi</SuperPMIDirectory>

<!-- Related to Benchmarks -->
<PerformanceDirectory>$HELIX_WORKITEM_PAYLOAD/performance</PerformanceDirectory>

<OutputMchPath>$HELIX_WORKITEM_UPLOAD_ROOT</OutputMchPath>
<!-- Workaround until https://github.com/dotnet/arcade/pull/6179 is not available -->
<HelixResultsDestinationDir>$(BUILD_SOURCESDIRECTORY)/artifacts/helixresults</HelixResultsDestinationDir>
Expand All @@ -41,6 +75,10 @@
<WorkItemCommand>$(Python) $(WorkItemCommand) -assemblies $(PmiAssembliesDirectory) -arch $(Architecture) -build_type $(BuildConfig) -core_root $(SuperPMIDirectory)</WorkItemCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(CollectionName)' == 'benchmarks'">
<WorkItemCommand>$(Python) $(SuperPMIDirectory)/superpmi_benchmarks.py -performance_directory $(PerformanceDirectory) -superpmi_directory $(SuperPMIDirectory) -core_root $(SuperPMIDirectory) -arch $(Architecture)</WorkItemCommand>
</PropertyGroup>

<PropertyGroup>
<EnableAzurePipelinesReporter>false</EnableAzurePipelinesReporter>
<EnableXUnitReporter>false</EnableXUnitReporter>
Expand Down Expand Up @@ -68,12 +106,48 @@
</HelixCorrelationPayload>
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(CollectionName)' != 'benchmarks'">
<PartitionDirectories Include="$([System.IO.Directory]::GetDirectories($(InputArtifacts)))"/>
<Partition Include="@(PartitionDirectories -> '%(Filename)')" PmiAssemblies="%(Filename)" PartitionId="%(Filename)" />
</ItemGroup>

<PropertyGroup>
<PartitionCount>30</PartitionCount>
</PropertyGroup>
<ItemGroup>
<BDN_Partition Include="Partition0" Index="0" />
<BDN_Partition Include="Partition1" Index="1" />
<BDN_Partition Include="Partition2" Index="2" />
<BDN_Partition Include="Partition3" Index="3" />
<BDN_Partition Include="Partition4" Index="4" />
<BDN_Partition Include="Partition5" Index="5" />
<BDN_Partition Include="Partition6" Index="6" />
<BDN_Partition Include="Partition7" Index="7" />
<BDN_Partition Include="Partition8" Index="8" />
<BDN_Partition Include="Partition9" Index="9" />
<BDN_Partition Include="Partition10" Index="10" />
<BDN_Partition Include="Partition11" Index="11" />
<BDN_Partition Include="Partition12" Index="12" />
<BDN_Partition Include="Partition13" Index="13" />
<BDN_Partition Include="Partition14" Index="14" />
<BDN_Partition Include="Partition15" Index="15" />
<BDN_Partition Include="Partition16" Index="16" />
<BDN_Partition Include="Partition17" Index="17" />
<BDN_Partition Include="Partition18" Index="18" />
<BDN_Partition Include="Partition19" Index="19" />
<BDN_Partition Include="Partition20" Index="20" />
<BDN_Partition Include="Partition21" Index="21" />
<BDN_Partition Include="Partition22" Index="22" />
<BDN_Partition Include="Partition23" Index="23" />
<BDN_Partition Include="Partition24" Index="24" />
<BDN_Partition Include="Partition25" Index="25" />
<BDN_Partition Include="Partition26" Index="26" />
<BDN_Partition Include="Partition27" Index="27" />
<BDN_Partition Include="Partition28" Index="28" />
<BDN_Partition Include="Partition29" Index="29" />
</ItemGroup>

<ItemGroup Condition="'$(CollectionName)' != 'benchmarks'">
<HelixWorkItem Include="@(Partition)">
<OutputFileName>$(CollectionName).$(CollectionType).%(HelixWorkItem.PartitionId).$(MchFileTag)</OutputFileName>
<PayloadDirectory>$(PmiAssembliesPayload)$(FileSeparatorChar)$(CollectionName)$(FileSeparatorChar)%(HelixWorkItem.PmiAssemblies)</PayloadDirectory>
Expand All @@ -82,30 +156,14 @@
<DownloadFilesFromResults>%(OutputFileName).mch;%(OutputFileName).mch.mct;%(OutputFileName).log</DownloadFilesFromResults>
</HelixWorkItem>
</ItemGroup>
<!--
This is useful for local testing to print the produced helix items
To use this when you are changing how items are produced, uncomment the target
and replace the Project item at the top of the file with this:
<Project DefaultTargets="printItems">

Once you've done that you can run this to see the results:
dotnet msbuild .\superpmi.proj /v:n
-->
<!--
<PropertyGroup>
<HelixTargetQueues>Some_Queue</HelixTargetQueues>
<InputArtifacts>D:\git\runtime\workitem\pmiAssembliesDirectory\libraries</InputArtifacts>
<MchFileTag>x64.checked</MchFileTag>
<CollectionName>libraries</CollectionName>
</PropertyGroup>
<Target Name="printItems">
<Message Text="@(HelixWorkItem -> 'name: %(HelixWorkItem.Identity)
dir: %(HelixWorkItem.PayloadDirectory)
pre: %(HelixWorkItem.PreCommands)
command: %(HelixWorkItem.Command)
post: %(HelixWorkItem.PostCommands)
timeout: %(HelixWorkItem.Timeout) '"/>
</Target> -->


<ItemGroup Condition="'$(CollectionName)' == 'benchmarks'">
<HelixWorkItem Include="@(BDN_Partition)">
<OutputFileName>$(CollectionName).$(CollectionType).%(HelixWorkItem.Index).$(MchFileTag)</OutputFileName>
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand) -partition_count $(PartitionCount) -partition_index %(HelixWorkItem.Index) -output_mch_path $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).mch -log_file $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).log</Command>
<Timeout>$(WorkItemTimeout)</Timeout>
<DownloadFilesFromResults>%(OutputFileName).mch;%(OutputFileName).mch.mct;%(OutputFileName).log</DownloadFilesFromResults>
</HelixWorkItem>
</ItemGroup>
</Project>
14 changes: 6 additions & 8 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,13 @@ class TempDir:

Use with: "with TempDir() as temp_dir" to change to that directory and then automatically
change back to the original working directory afterwards and remove the temporary
directory and its contents (if args.skip_cleanup is False).
directory and its contents (if skip_cleanup is False).
"""

def __init__(self, path=None):
def __init__(self, path=None, skip_cleanup=False):
self.mydir = tempfile.mkdtemp() if path is None else path
self.cwd = None
self._skip_cleanup = skip_cleanup

def __enter__(self):
self.cwd = os.getcwd()
Expand All @@ -557,10 +558,7 @@ def __enter__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
os.chdir(self.cwd)
# Note: we are using the global `args`, not coreclr_args. This works because
# the `skip_cleanup` argument is not processed by CoreclrArguments, but is
# just copied there.
if not args.skip_cleanup:
if not self._skip_cleanup:
shutil.rmtree(self.mydir)


Expand Down Expand Up @@ -758,7 +756,7 @@ def collect(self):
passed = False

try:
with TempDir(self.coreclr_args.temp_dir) as temp_location:
with TempDir(self.coreclr_args.temp_dir, self.coreclr_args.skip_cleanup) as temp_location:
# Setup all of the temp locations
self.base_fail_mcl_file = os.path.join(temp_location, "basefail.mcl")
self.base_mch_file = os.path.join(temp_location, "base.mch")
Expand Down Expand Up @@ -1573,7 +1571,7 @@ def replay_with_asm_diffs(self):
files_with_asm_diffs = []
files_with_replay_failures = []

with TempDir(self.coreclr_args.temp_dir) as temp_location:
with TempDir(self.coreclr_args.temp_dir, self.coreclr_args.skip_cleanup) as temp_location:
logging.debug("")
logging.debug("Temp Location: %s", temp_location)
logging.debug("")
Expand Down
Loading