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

JIT: add PGO random stress testing support #58294

Merged
merged 3 commits into from
Aug 29, 2021

Conversation

AndyAyersMS
Copy link
Member

Enable the previously added RandomGDV for various PGO CI pipelines.

Add a new JitRandomEdgeCount mode to provide random but plausible
PGO data for edge counters. Because of the way sparse edge counting works
this data will most ofen end up providing a consistent set of block counts.

Enable this mode in PGO pipelines, and also a mode that randomzies both
counts and GDV selections.

Enable the previously added RandomGDV for various PGO CI pipelines.

Add a new `JitRandomEdgeCount` mode to provide random but plausible
PGO data for edge counters. Because of the way sparse edge counting works
this data will most ofen end up providing a consistent set of block counts.

Enable this mode in PGO pipelines, and also a mode that randomzies both
counts and GDV selections.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 27, 2021
@ghost
Copy link

ghost commented Aug 27, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Enable the previously added RandomGDV for various PGO CI pipelines.

Add a new JitRandomEdgeCount mode to provide random but plausible
PGO data for edge counters. Because of the way sparse edge counting works
this data will most ofen end up providing a consistent set of block counts.

Enable this mode in PGO pipelines, and also a mode that randomzies both
counts and GDV selections.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

Sample of counts (from 8queen's TryMe:

;; default

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd                 weight        IBC  lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                            4024k  4023618    [000..007)-> BB09 (always)                     IBC 
BB02 [0001]  1                           31192k 31192074    [007..014)-> BB09 ( cond )                     bwd bwd-target IBC 
BB03 [0002]  1                           11964k 11964078    [014..01C)-> BB09 ( cond )                     bwd IBC 
BB04 [0003]  1                            8546k  8545772    [01C..02A)-> BB09 ( cond )                     bwd IBC 
BB05 [0004]  1                            4024k  4023618    [02A..04C)-> BB08 ( cond )                     bwd IBC 
BB06 [0005]  1                            3988k  3988011    [04C..05B)-> BB09 ( cond )                     bwd IBC 
BB07 [0006]  1                            3739k  3738778    [05B..073)-> BB09 (always)                     bwd IBC 
BB08 [0007]  1                           35607.    35607    [073..076)                                     bwd IBC 
BB09 [0008]  7                           35216k 35215692    [076..07A)-> BB11 ( cond )                     bwd IBC 
BB10 [0009]  1                           34931k 34930852    [07A..07E)-> BB02 ( cond )                     bwd IBC 
BB11 [0010]  2                            4024k  4023618    [07E..07F)        (return)                     IBC 
-----------------------------------------------------------------------------------------------------------------------------------------

;; random=1

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd                 weight   IBC  lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                            61     61    [000..007)-> BB09 (always)                     IBC 
BB02 [0001]  1                           216    216    [007..014)-> BB09 ( cond )                     bwd bwd-target IBC 
BB03 [0002]  1                           216    216    [014..01C)-> BB09 ( cond )                     bwd IBC 
BB04 [0003]  1                           216    216    [01C..02A)-> BB09 ( cond )                     bwd IBC 
BB05 [0004]  1                           141    141    [02A..04C)-> BB08 ( cond )                     bwd IBC 
BB06 [0005]  1                            56     56    [04C..05B)-> BB09 ( cond )                     bwd IBC 
BB07 [0006]  1                            56     56    [05B..073)-> BB09 (always)                     bwd IBC 
BB08 [0007]  1                            85     85    [073..076)                                     bwd IBC 
BB09 [0008]  7                           277    277    [076..07A)-> BB11 ( cond )                     bwd IBC 
BB10 [0009]  1                           216    216    [07A..07E)-> BB02 ( cond )                     bwd IBC 
BB11 [0010]  2                            61     61    [07E..07F)        (return)                     IBC 
-----------------------------------------------------------------------------------------------------------------------------------------

;; random=0x100

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd                 weight   IBC  lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                            57     57    [000..007)-> BB09 (always)                     IBC 
BB02 [0001]  1                            82     82    [007..014)-> BB09 ( cond )                     bwd bwd-target IBC 
BB03 [0002]  1                            82     82    [014..01C)-> BB09 ( cond )                     bwd IBC 
BB04 [0003]  1                            82     82    [01C..02A)-> BB09 ( cond )                     bwd IBC 
BB05 [0004]  1                            82     82    [02A..04C)-> BB08 ( cond )                     bwd IBC 
BB06 [0005]  1                             0      0    [04C..05B)-> BB09 ( cond )                     rare bwd IBC 
BB07 [0006]  1                             0      0    [05B..073)-> BB09 (always)                     rare bwd IBC 
BB08 [0007]  1                            82     82    [073..076)                                     bwd IBC 
BB09 [0008]  7                           139    139    [076..07A)-> BB11 ( cond )                     bwd IBC 
BB10 [0009]  1                           122    122    [07A..07E)-> BB02 ( cond )                     bwd IBC 
BB11 [0010]  2                            57     57    [07E..07F)        (return)                     IBC 
-----------------------------------------------------------------------------------------------------------------------------------------

@AndyAyersMS
Copy link
Member Author

AndyAyersMS commented Aug 27, 2021

Here's the empirical count distribution CDF I gathered from the StandardOptimization.mibc counts (note log scale x axis). The code that generates random counts has a crude piecewise model for this distribution.

image

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr pgo

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr pgo
/azp run runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr pgo

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

Looks like a couple of asserts in libraries tests so far.

The runtime tests don't seem to be using the new modes, there are only the existing 4 modes per isa/os. Not sure what's up there.

@AndyAyersMS
Copy link
Member Author

Non-pgo failures look like known issues. I will open issues for the new pgo mode failures.

@AndyAyersMS AndyAyersMS merged commit ba2d581 into dotnet:main Aug 29, 2021
@AndyAyersMS AndyAyersMS deleted the RandomPgoCounts branch August 29, 2021 16:02
@ghost ghost locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants