sonic icon indicating copy to clipboard operation
sonic copied to clipboard

Apple Silicon support

Open Liloupar opened this issue 3 years ago • 23 comments

build error on mac m1

Liloupar avatar Jan 15 '22 18:01 Liloupar

build error on mac m1

Me too, at 2020 MacBook Pro, It seems that sonic is only support on amd64platform

JOJO0527 avatar Jan 25 '22 15:01 JOJO0527

armv8 platform was not supported.

musakenshi avatar Mar 03 '22 07:03 musakenshi

plz

ilovejs avatar Mar 04 '22 02:03 ilovejs

This will be a major design change. It is very hard to support another processor under the current architecture, and may require a complete redesign. This will be addressed in the next major release, Sonic v2.

chenzhuoyu avatar Mar 07 '22 04:03 chenzhuoyu

Hello, is there currently a tentative date for the release of v2 ?

Secondly, I can help on this issue if you require it, since I have a M1 mac and its alongside my interests.

Thirdly, since generics was released with go stable 1.18 recently, any plans on using them to improve performance even more on v2 ?

alphadose avatar Mar 29 '22 07:03 alphadose

Could you add a skip mechanism (for AVX or other ASM code)to compile successfully. Because most people edit projects on macbook. After compile success,submit codes to git. Debug or running on Linux.

Larry-Z avatar Mar 29 '22 13:03 Larry-Z

Cool got it

alphadose avatar Mar 31 '22 15:03 alphadose

support mac m1

hwzp99 avatar Apr 02 '22 08:04 hwzp99

anxiously waiting for v2.

dmxbb avatar May 24 '22 03:05 dmxbb

+2000

shopee-jin avatar Jun 29 '22 03:06 shopee-jin

We have implemented a compatibility layer (#233) recently.

This is just a thin wrapper around encoding/json as a fallback, so don't expect high performance on Apple Silicon chips for now, but it can serve as a workaround to the compilation error and will unblock your development process.

The real native support will be included in the, well, Sonic v2, which we are still actively developing.

For those who want to use Sonic on Apple Silicon Macs, this might be a viable solution for now.

chenzhuoyu avatar Jul 01 '22 08:07 chenzhuoyu

works like a charm export GOARCH=amd64 go build

shopee-jin avatar Jul 05 '22 04:07 shopee-jin

What about amazon Graviton processors?

imraan-go avatar Aug 16 '22 05:08 imraan-go

at present, set GOARCH=amd64 and use Rosatta is enough (https://github.com/bytedance/sonic#compatibility). For better performance and really support ARM arch in future, we still have a lot of jobs to do:

  1. asm2asm tool supports converting ARM assembly into Plan9
  2. ARM version of SIMD algorithm for native function Skip()\Value()\u64toa()...
  3. alternative JIT assembler which supports ARM assembly All these need much time to develop and test. Maybe in our next major version we can finish it, in the most optimistic case

AsterDY avatar Aug 22 '22 11:08 AsterDY

at present, set GOARCH=amd64 and use Rosatta is enough (https://github.com/bytedance/sonic#compatibility). For better performance and really support ARM arch in future, we still have a lot of jobs to do:

  1. asm2asm tool supports converting ARM assembly into Plan9
  2. ARM version of SIMD algorithm for native function Skip()\Value()\u64toa()...
  3. alternative JIT assembler which supports ARM assembly All these need much time to develop and test. Maybe in our next major version we can finish it, in the most optimistic case

I already installed Rosatta2 and set GOARCH=amd64. But it still does not work when i build with goland. What should I do?

guanzhanyi avatar Oct 18 '22 12:10 guanzhanyi

at present, set GOARCH=amd64 and use Rosatta is enough (https://github.com/bytedance/sonic#compatibility). For better performance and really support ARM arch in future, we still have a lot of jobs to do:

  1. asm2asm tool supports converting ARM assembly into Plan9
  2. ARM version of SIMD algorithm for native function Skip()\Value()\u64toa()...
  3. alternative JIT assembler which supports ARM assembly All these need much time to develop and test. Maybe in our next major version we can finish it, in the most optimistic case

I already installed Rosatta2 and set GOARCH=amd64. But it still does not work when i build with goland. What should I do?

After i upgrade v1.3 to v.15, it success

guanzhanyi avatar Oct 18 '22 12:10 guanzhanyi

at present, set GOARCH=amd64 and use Rosatta is enough (https://github.com/bytedance/sonic#compatibility). For better performance and really support ARM arch in future, we still have a lot of jobs to do:

  1. asm2asm tool supports converting ARM assembly into Plan9
  2. ARM version of SIMD algorithm for native function Skip()\Value()\u64toa()...
  3. alternative JIT assembler which supports ARM assembly All these need much time to develop and test. Maybe in our next major version we can finish it, in the most optimistic case

I already installed Rosatta2 and set GOARCH=amd64. But it still does not work when i build with goland. What should I do?

After i upgrade v1.3 to v.15, it success

but I still cannot debug program, it would not stop at breakpoint.

BrianYi avatar Dec 09 '22 10:12 BrianYi

Is there an ETA on Sonic V2 with native aarch64/Arm64/M1/Graviton/etc. support?

jsrz avatar Feb 07 '23 19:02 jsrz

Hi @AsterDY and @chenzhuoyu, 

If arm64 support becomes available, it will be really beneficial. If you need any assistance, I am happy to help with testing or any other. 

odidev avatar Feb 09 '23 11:02 odidev