Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run crossgen in parallel in crossgen_comparison.py #33175

Merged
merged 15 commits into from
Mar 26, 2020

Conversation

jashook
Copy link
Contributor

@jashook jashook commented Mar 4, 2020

This will hopefully reduce the runtime of crossgen_compairision.py and address #33172

@jashook jashook requested a review from echesakov March 25, 2020 21:24
@jashook
Copy link
Contributor Author

jashook commented Mar 25, 2020

I believe this is finally ready for review @echesakovMSFT @dotnet/runtime-infrastructure ptal

@jashook
Copy link
Contributor Author

jashook commented Mar 25, 2020

Will post runtime improvements once the run finishes

Copy link
Contributor

@echesakov echesakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. I wonder what speedup we will get
Thank you @jashook !

@@ -38,7 +38,7 @@ jobs:
archType: arm
platform: Linux_arm
container:
image: ubuntu-16.04-cross-14.04-23cacb0-20200121150126
image: ubuntu-18.04-cross-arm-16.04-09ec757-20200324125113
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need to upgrade the image here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script needs python3.6+

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its also generally not needed for us to target 14.04 anymore as 14.04 is eol


# Create baseline output on the host (x64) machine
- task: PythonScript@0
displayName: Create cross-platform crossgen baseline
inputs:
scriptSource: 'filePath'
scriptPath: $(coreClrRepoRoot)/tests/scripts/crossgen_comparison.py
pythonInterpreter: /usr/bin/python3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add python3 to our linux requirements markdown file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be one python3, seeing that python2 is eol. We have not exactly mandated it yet.

@jashook
Copy link
Contributor Author

jashook commented Mar 25, 2020

Time in seconds

Branch x64-arm crossgen (build machine) arm crossgen (on device)
master 189.140369 448.044597
change 87.963722 133.222282

@jashook
Copy link
Contributor Author

jashook commented Mar 25, 2020

This will leave our cross-crossgen job with ~3 minutes of helix setup time (download, zip and docker) and ~2 minutes of execution time. Total time is reduced ~40% with this change.

@trylek
Copy link
Member

trylek commented Mar 25, 2020

Very nice. That matches the ratio between Crossgen / Crossgen2 framework compilation times in "build-test generatelayoutonly" (where there's a straight linear loop over the assemblies) and SuperIlc (which uses parallelization much like you do, just written in C#), something like 3:1, almost reaching the 4:1 ideal speedup on my 4-core box.

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for pulling off such a dramatic perf improvement!

@jashook jashook linked an issue Mar 25, 2020 that may be closed by this pull request
@jashook jashook merged commit 9656059 into dotnet:master Mar 26, 2020
@jashook jashook deleted the cross-crossgen-parallel branch March 26, 2020 00:29
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve cross-crossgen run time
6 participants