-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Updating Vector*.IsHardwareAccelerated to be recursive #69578
Updating Vector*.IsHardwareAccelerated to be recursive #69578
Conversation
…areAccelerated return the same value
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsThis resolves #69576 This updates the various
|
src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector256Tests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector64Tests.cs
Outdated
Show resolved
Hide resolved
@davidwrighton, looks like Is that expected? We don't appear to do the same for That is, I see the following where the first column is a direct call (e.g.
|
Co-authored-by: Stephen Toub <[email protected]>
src/libraries/System.Numerics.Vectors/tests/GenericVectorTests.cs
Outdated
Show resolved
Hide resolved
CC. @dotnet/crossgen-contrib for help with the unexpected failure above. |
How odd. Well, I'll look into this. Will take a bit for me to clear my schedule. |
@davidwrighton Do you think there's something lurking in these unexpected failures that we need to make sure to address in 7.0? |
I think I reported this originally - we're trying to make writing vectorized code more accessible in .NET 7, and this is likely to confuse initially as it did me, so it would be nice to get it in .NET 7. |
@davidwrighton, are you still able to look at this? |
Sorry, this fell off my radar. I'm looking at it today. |
…nsics in CoreLib - The functions which detect if an intrinsic is actually available are allowed to have behavior which differs based on which intrinsics are available at runtime
@fanyang-mono, could you assist with the changes needed for Mono here? I went and looked at |
@tannergooding I will see if I have time to get to it today or tmr. Otherwise, I will forward this to another person on mono team to handle. Because I will be on vacation starting from this Friday for two weeks. |
Thanks much! |
@fanyang-mono did you manage to identify someone who could help with the mono side? |
@vargaz Could you help out with this while I am on vacation? |
ping @fanyang-mono, @vargaz on this. I imagine its too late for .NET 7 at this point, but it would still be nice to get fixed |
@tannergooding is the CoreCLR change mergeable on its own? |
Also, I wouldn't rule out .NET 7 if the risk is low, as it's a goal of the release to make it easy to use vectorization in your own code. This trips you up right away. |
Technically, yes. But there's no real point, IMO, if we aren't going to ship Corelib with the support since users will never trigger the code.
I'm not sure I'd say this is a right away scenario. Calling this via reflection or indirectly such as via a delegate is expected to be an extremely rare/niche scenario and not the normal usage pattern. I expect the debugger case is more likely, but we really need the Mono support as well. |
Ah. Agreed, I think the debugger case is the only one that is significant. |
cc @SamMonoRT since it's potentially 7.0 |
This will fix the mono interpreter failures: |
relevant failures eg
and mono failures eg JIT.HardwareIntrinsics.X86.Bmi1 |
Its actually not clear to me why CI is asserting. It doesn't assert locally at all (and shouldn't since the only recursive API is However, I've added an extra safety path to see if that resolves the issue. |
Actually, realized the potential issue right as I typed that up. The path that could convert |
@vargaz, looks like still some Mono Linux failures where its unexpectedly getting There is also a failure for RyuJIT
@davidwrighton, this appears to be because these tests disable SSE2 and so the intrinsic returned is |
The mono failures are also present in HEAD, so they are unrelated: |
@danmoseley, are you still wanting this backported to .NET 7? For There have been only a couple user reports on this, so I'm not sure if it meets the bar or not. |
Yeah now we branched, I don't think it does. Thanks for driving it though. |
This resolves #38162
This updates the various
IsHardwareAccelerated
APIs to be recursive, just as they are for theIsSupported
APIs. This ensures that they return the same result whether invoked directly or indirectly (such as via reflection). This ensures that the debugger and other scenarios report a consistent worldview.