oneapi-src / oneDNN

oneAPI Deep Neural Network Library (oneDNN)
https://uxlfoundation.org
Apache License 2.0
3.63k stars 1.01k forks source link

[aarch64] Update xbyak_aarch64 #1518

Closed densamoilov closed 1 year ago

densamoilov commented 1 year ago

We found that there is an issue with identifying cache sizes on macOS with M chip. We implemented a fix in master and rls-v3.0. The fix is here: ba91a536cb59558b3f3880951def160fe24b2820.

I also found that the issue has been fixed in the xbyak_aarch64 repository: https://github.com/fujitsu/xbyak_aarch64/pull/71/commits/eef8e10d21632c71f6756c5a7f1ae5ecf6339e54.

@nSircombe, can you please update xbyak_aarch64 in master?

nSircombe commented 1 year ago

This is probably one for @kawakami-k I think.

kawakami-k commented 1 year ago

@densamoilov @nSircombe Thanks for letting me know about the bug. I will send a pull request to update Xbyak_aarch64 in oneDNN by the end of this month, after confirming Xbyak_aarch64 can obtain correct cache size for Graviton3. Thank you!

densamoilov commented 1 year ago

Thank you guys for a quick response. Sounds good to me.

anthony-linaro commented 1 year ago

Hi All,

Is there any movement on this?

I am working on Blender for Windows on Arm, and merging in the latyest xbyak would be of great help, as it contains support for MSVC (https://github.com/fujitsu/xbyak_aarch64/pull/72), which would help in my endeavour of enabling OIDN

kawakami-k commented 1 year ago

I hope to submit a pull request to update Xbyak_aarch64 to the latest version this weekend. Sorry, please wait a little longer.

anthony-linaro commented 1 year ago

Thanks, I will keep an eye out for your PR

kawakami-k commented 1 year ago

The fix for Xbyak_aarch64 is almost finished. I will pull it soon. https://github.com/fujitsu/xbyak_aarch64/tree/reimple_cache_info

kawakami-k commented 1 year ago

This PR updates Xbyak_aarch64 to the latest version. https://github.com/oneapi-src/oneDNN/pull/1557 This version of Xbyak_aarch64 can run on Windows Dev Kit 2023 (Qualcomm's Arm-based CPU), but I have not checked if oneDNN of this PR works well on Dev Kit 2023. I'd be glad to get feedback.

Thank you!

anthony-linaro commented 1 year ago

Thanks @kawakami-k - it unfortunately does not work OOB, but I have attached a diff to make it work with ARM64 MSVC.

A number of tests also appear to be failing when ctest is run, likely related to the hundreds of warnings produced (didn't dig in too far).

arm64-msvc-onednn.patch

kawakami-k commented 1 year ago

@anthony-linaro Thank you for the feedback. I'll try your patch.

anthony-linaro commented 1 year ago

No problem - let me know if you have any issues I can help with

anthony-linaro commented 1 year ago

Hi @kawakami-k - did you get chance to have a look?

kawakami-k commented 1 year ago

@anthony-linaro Yes, I tried your patch on Windows DevKit 2023 (Windows11 on Qualcom's Arm CPU). I also modified cpu_isa_traits.hpp. https://github.com/kawakami-k/oneDNN/commit/f989729ebe5315aca61bb820a48f74fbff08aa79

Build is ok, but tests are failed. For example, the first JIT-ed test pattern of tests/gtests/test_reorder generated JIT-ed code and used it. It may be working well up to this step, but the test was stopped wtih 0xC0000005 (memory access vaiolation?) before starting the second test pattern. I suspect that memory allocation of Xbyak_aarch64 may have gone wrong, but I have not been able to investigate the cause.

anthony-linaro commented 1 year ago

@kawakami-k Is this something you intend to investigate, or something you would like me to look into?

kawakami-k commented 1 year ago

@anthony-linaro I would be happy if you could do it. I may not have time this month...

vpirogov commented 1 year ago

The original issue is addressed by #1557.

@anthony-linaro, I'd suggest you open a PR with proposed changes against https://github.com/fujitsu/xbyak_aarch64 and continue iterating.