runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Enable RyuJIT Backend for ARM32

Open YongseopKim opened this issue 9 years ago • 73 comments

We( @YongseopKim; @chunseoklee ; @hseok-oh ; @hqueue ) are going to work for enabling RyuJIT backend for arm32.

Any information that we should know? (like that somebodies are working some feature of RyuJIT on arm32)

YongseopKim avatar Dec 07 '16 05:12 YongseopKim

cc @dotnet/jit-contrib

jkotas avatar Dec 07 '16 08:12 jkotas

Awesome! It should be much easier to do it now that x86 paved the 32-bit path. I'm not aware of anyone else working on RyuJIT/ARM32. dotnet/jit-contrib have certainly talked about it a great deal, so expect feedback and feel free to ask questions.

RussKeldorph avatar Dec 08 '16 17:12 RussKeldorph

@hqueue I'm working on CodeGen::genSetRegToCond right now. And I've put my head into the !isRegPairType(tree->TypeGet()) issue already.

(BTW, broadly speaking, there are still quite a few overlapping areas in the bring up process, so at this stage we probably should not try too hard not to repeat each other's efforts).

mskvortsov avatar Dec 26 '16 17:12 mskvortsov

@mskvortsov Cool. For !isRegPairType(tree->TypeGet()) and assignedInterval != nullptr , I think they are all related to types which requires two registers , e.g. long and double type in all phases including LSRA. BTW I will look into other assertions.

hqueue avatar Dec 27 '16 04:12 hqueue

The description is deprecated by Jan. 18, 2017. You can find test result from dotnet/coreclr#8724.


Summarize current status with PR dotnet/coreclr#8710 and dotnet/coreclr#8724 (cited from dotnet/coreclr#8724)

Status

Test result from 139 tests from JIT/CodeGenBringUpTests with COMPlus_JitDisasm=BringUpTest:* COMPlus_AltJit=BringUpTest:*

with PR dotnet/coreclr#8710

=======================
Test Results
=======================
# CoreCLR Bin Dir :
# Tests Discovered : 139
# Passed : 61
# Failed : 78
# Skipped : 0
=======================

All 78 failures are Assert failure as follows.

  • 54 of 'NYI: float argument' (gone)
  • 7 of 'NYI: genSetRegToCond'
  • 6 of 'NYI: Lowering of long register argument'
  • 4 of 'NYI_ARM: TreeNodeInfoInit default case'
  • 2 of 'NYI_ARM: ARM IsContainableImmed for floating point type' (gone)
  • 2 of 'NYI_ARM: fgMorphMultiregStructArgs'
  • 1 of 'NYI: Cast'
  • 1 of 'NYI: ARM genCallFinally'
  • 1 of '!isRegPairType(tree->TypeGet())'

with PR dotnet/coreclr#8710 and this PR dotnet/coreclr#8724 (15 more tests are PASSED.)

=======================
Test Results
=======================
# CoreCLR Bin Dir : 
# Tests Discovered : 139
# Passed : 76
# Failed : 63
# Skipped : 0
=======================

All 63 failures are Assert failure as follows.

  • 29 of 'assignedInterval != nullptr' (NEW)
  • 7 of 'NYI: GT_DIV' (NEW)
  • 2 of '!"Unexpected instruction"' (NEW)
  • 2 of 'NYI_ARM: Lowering for cast from float' (NEW)
  • 1 of 'NYI_ARM: GT_LEA: index and cns are not nil' (NEW)
  • 7 of 'NYI: genSetRegToCond' (no change)
  • 6 of 'NYI: Lowering of long register argument' (no change)
  • 4 of 'NYI_ARM: TreeNodeInfoInit default case' (no change)
  • 2 of 'NYI_ARM: fgMorphMultiregStructArgs' (no change)
  • 1 of 'NYI: Cast' (no change)
  • 1 of 'NYI: ARM genCallFinally' (no change)
  • 1 of '!isRegPairType(tree->TypeGet())' (no change)

hqueue avatar Dec 27 '16 07:12 hqueue

@hqueue dotnet/coreclr#8731 (on top of your FP work) makes 6 more tests passed.

mskvortsov avatar Dec 27 '16 11:12 mskvortsov

@mskvortsov Cool! Now I'm not working on assertions right now, I think you can continue as you wish :) I will run tests tomorrow again.

hqueue avatar Dec 27 '16 12:12 hqueue

CoreCLR: 9a870919addaf32de0e6b89e4bf23a893cb42085 + https://github.com/dotnet/coreclr/pull/8724

Test result of JIT/CodeGenBringUpTests with COMPlus_JitDisasm=BringUpTest:* COMPlus_AltJit=BringUpTest:* is as follow.

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : 
# Tests Discovered : 139
# Passed           : 88
# Failed           : 51
# Skipped          : 0
=======================

YongseopKim avatar Jan 23 '17 03:01 YongseopKim

Environment:
  branch: master
  coreclr: 19e1cd299da301d1b2cb18ae8479595dbfc7224c
  corefx : 808c9de28abfc4af11b7f3144aab35c1bf48fb36

Device: RPI3
  Test: --testDir=JIT/CodeGenBringUpTests/
Options:
 COMPlus_AltJit=*
 COMPlus_AltJitAssertOnNYI=0
 COMPlus_JitFuncInfoLogFile=/mnt/albireo/mywork/device/rpi3/unittests/runtest/log.JIT.CodeGenBringUpTests.ryujit.methods

Run test with ryujit and legacyjit as a fallback.

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 139
# Passed           : 137
# Failed           : 2
# Skipped          : 0
=======================
8 minutes and 37 seconds taken to run CoreCLR tests.

NYI assertion hit frequencies

hqueue@rpi3:/mnt/albireo/mywork/device/rpi3/unittests/runtest/log.20170315$ grep NYI log.JIT.CodeGenBringUpTests.all.ryujit.methods |sed 's|^.* - NYI ||' |sed 's|^.*src/jit/\(.*\))|\1|' |sort |uniq -c |sort -nr
   6180 lsraarm.cpp:1346 - NYI: lowering struct var
    474 morph.cpp:4659 - NYI_ARM: fgMorphMultiregStructArgs
    382 lsraarm.cpp:1335 - NYI: Unimplemented node type lclHeap
    235 lsraarm.cpp:901 - NYI: lowering double
    187 lsraarm.cpp:900 - NYI: lowering struct
      1 lsraarm.cpp:996 - NYI_ARM: overflow checks
      1 codegenarm.cpp:1882 - NYI: genRegCopy

Number of methods falling back to legacy JIT

hqueue@rpi3:/mnt/albireo/mywork/device/rpi3/unittests/runtest/log.20170315$ grep NYI log.JIT.CodeGenBringUpTests.all.ryujit.methods |sed 's|- NYI.*$||' |sort -u |wc -l
158

Number of methods compiled with the RyuJIT backend

hqueue@rpi3:/mnt/albireo/mywork/device/rpi3/unittests/runtest/log.20170315$ grep -v NYI log.JIT.CodeGenBringUpTests.all.ryujit.methods |sort -u |wc -l
1108

hqueue avatar Mar 15 '17 09:03 hqueue

@YongseopKim @chunseoklee @hseok-oh @hqueue @mskvortsov @sjsinju

I have a general question: for RyuJIT/ARM32, how can I tell what is being worked on, and who is working on what?

A simple query of GitHub issues shows just a few RyuJIT/ARM32 issues.

There is a RyuJIT/ARM32 GitHub project, but it is little used: https://github.com/dotnet/coreclr/projects/4

All RyuJIT/ARM32 pull requests seem to tag this "meta-issue", as shown here. But that only shows work that is done or close to done, not work that is just starting, or assigned, for example, by assigning individual issues out to individuals when they start working on them.

Would it be reasonable to have the following process:

  1. Create GitHub issues for individual work items. This could be immediately when the issue starts being worked on. However, preferably, a whole set of issues would be created in advance for all the work that is known to be required, and we continuously add to that set as new required work is discovered.
  2. When someone starts work on a work item, assign that GitHub issue to themselves.
  3. The PR can be marked as Fixes dotnet/runtime#4367 (for example), so GitHub will automatically close the associated issue when the PR is merged.

Comments?

BruceForstall avatar Apr 01 '17 01:04 BruceForstall

Also, @alpencolt

BruceForstall avatar Apr 01 '17 01:04 BruceForstall

@BruceForstall I also agree with your suggestions and this is what I think should be :)

However for the Ryuji/ARM32 project https://github.com/dotnet/coreclr/projects/4, I've already know the existence from Jan.(I think it was made around last December, maybe.), but I'don't have any permission to use it. Do you know who made this ? It would be convenient if we can use the project too, in addition to the link to this meta-issue which is used to track the status of ryujit/arm32 overall.

Basically I think exploiting the issue in github is a right way and we should make use of this. One minior problem is that we can't assign the issue to oneself without other's help.

hqueue avatar Apr 03 '17 05:04 hqueue

Current status of run as CodeGenBringUpTests

Environment:
  coreclr: 62849aabbad290a81349cc2a642f3bb240677c7f
  corefx : 42029ac4c6bda9df2f3d541e8088c837dc3a7b16

Device: RPI3
Test: --testDir=JIT/CodeGenBringUpTests/
Options:
 COMPlus_AltJit=*
 COMPlus_AltJitAssertOnNYI=0

Run test with ryujit and legacyjit

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : /home/sjsujinkim/works/dotnet/coreclr/bin/Product/Linux.arm.Debug
# Tests Discovered : 148
# Passed           : 148
# Failed           : 0
# Skipped          : 0
=======================
5 minutes and 22 seconds taken to run CoreCLR tests.

NYI assertion hit frequencies

sjsujinkim@sjsujinkim-rpi3:~/works/dotnet/coreclr/tests$ grep NYI /home/sjsujinkim/works/logs/test/log_ryujit_func |sed 's|^.* - NYI ||' |sed 's|^.*src/jit/\(.*\))|\1|' |sort |uniq -c |sort -nr
    424 lsraarm.cpp:1352 - NYI: Unimplemented node type lclHeap
    268 morph.cpp:4610 - NYI_ARM: fgMorphMultiregStructArgs
    192 lsraarm.cpp:900 - NYI: lowering double
    106 lowerarm.cpp:149 - NYI_ARM: Lowering for GT_STORE_OBJ isn't implemented
      1 lsraarm.cpp:1352 - NYI: Unimplemented node type obj
      1 codegenarm.cpp:1235 - NYI: Unimplemented node type storeObj

Number of methods falling back to legacy JIT

sjsujinkim@sjsujinkim-rpi3:~/works/dotnet/coreclr/tests$ grep NYI /home/sjsujinkim/works/logs/test/log_ryujit_func |sed 's|- NYI.*$||' |sort -u |wc -l
91

Number of methods compiled with the RyuJIT backend

sjsujinkim@sjsujinkim-rpi3:~/works/dotnet/coreclr/tests$ grep -v NYI /home/sjsujinkim/works/logs/test/log_ryujit_func |sort -u |wc -l
1210

sjsinju avatar Apr 03 '17 07:04 sjsinju

I created a new GitHub "Team" for ARM32 work: @dotnet/arm32-contrib . If you are working on RyuJIT/ARM32, please go to https://github.com/orgs/dotnet/teams/arm32-contrib and request to be added to this team.

This should make it easier to know who is currently working on this project, or who is interested in this project, so a single tag of @dotnet/arm32-contrib will reach all such people.

BruceForstall avatar Apr 03 '17 18:04 BruceForstall

@BruceForstall wrote:

please go to https://github.com/orgs/dotnet/teams/arm32-contrib and request to be added to this team.

It shows 404 error, is it OK?

alpencolt avatar Apr 05 '17 08:04 alpencolt

@alpencolt Not sure why you got that. Try again sometime?

BruceForstall avatar Apr 05 '17 16:04 BruceForstall

Tried many times, @mskvortsov also don't have access. It looks only Members have access.

alpencolt avatar Apr 05 '17 16:04 alpencolt

@alpencolt @mskvortsov I think you'd better ask @Dmitri-Botcharnikov and join .NET foundation organization, to see above link. It seems taht @Dmitri-Botcharnikov is already involved :)

/cc: @lemmaa

hqueue avatar Apr 06 '17 07:04 hqueue

@hqueue : it seems that I have no rights to invite them to join the .NET Foundation.

Dmitri-Botcharnikov avatar Apr 06 '17 07:04 Dmitri-Botcharnikov

@BruceForstall, Would you please add @alpencolt, @mskvortsov, @ruben-ayrapetyan, and @sergign60 to @dotnet/samsung team? cc: @richlander

lemmaa avatar Apr 06 '17 15:04 lemmaa