-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support for Apple Silicon(aarch64, M1) #161
Comments
Exact same issue happens with aarch64-unknown-linux-musl target and probably -gnu. |
Thank you for reaching out, sorry for the late reply there was a vacation in the way. So far arm support has been experimental at best as the rust neon intrinsitcs are a moving target I'll go and see if things have stabalized a bit to iron this out. |
Looking at it this requires finalzing the port to the new utf8 parsing to arm. @CJP10 any chance you can way in and hint me to where you ported the avx bits from I don't see it mapping to upstream simd_json but things change there quickly -.- |
I have extracted, much improved the UTF-8 validation in simdutf8 and just added aarch64 neon support (to be released). Once I have a proper streaming API implemented (see rusticstuff/simdutf8#25) I can add a pull request which replaces the UTF-8 validation in simd-json. This would serve as a good testcase for the streaming API as well. If this does not work without a performance penalty I will expose a specialized 64-byte update function directly. |
That would be absolutely lovely and hugely appreciated! |
Since merging the simdutf8 integration the only missing piece for making it compile on aarch64 is the missing |
I relased your and @mfelsche fixes in |
simd-json will work on aarch64 again real soon now, see #195. We are just waiting to get stdarch bumped in nightly. |
You are incredible @hkratz ! :D |
I think we can close this, M1 works, arm in general works too :D 🚀 it requires nightly but that's fine I think Thank you all! |
It looks like I am also facing the same issue. I am trying to use sidm-json with wasm-bindgen + deno that's the only difference. I checked if simd is enabled with webassembly with wasm-feature-detect and it looks like it's enabled as well. Code: #[wasm_bindgen]
pub fn to_string(_s: &str) -> String {
"test".to_string()
} deno: (ignore the function names, the error is at build time) import init, { greet } from "../pkg/denosimd.js";
await init(Deno.readFile("./pkg/denosimd_bg.wasm"));
greet("Hello from deno to rust"); Error: [INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Compiling value-trait v0.2.9
error[E0425]: cannot find function `write_str_simd` in this scope
--> C:\Users\Spark\.cargo\registry\src\github.com-1ecc6299db9ec823\value-trait-0.2.9\src\generator.rs:162:19
|
162 | stry!(write_str_simd(self.get_writer(), &mut string,));
| ^^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0425`.
error: could not compile `value-trait` due to previous error
Error: Compiling your crate to WebAssembly failed let me know if you need any more inputs from my side |
Hi, simd-json depends on the system running it exposes SIMD features, namely SSE4.2 or AVX2. AFAIK WASM is a runtime that doesn't expose CPU native instructions so SIMD isn't available there. |
Whilst WASM doesn't expose the native CPU instructions, it does have its own SIMD intrinsics (see https://doc.rust-lang.org/core/arch/wasm32/index.html#simd). I had a quick look at porting this crate to WASM this evening and it seems to be feasible. I've not had a chance to test it in the slightest, but it builds. (https://github.com/sam-kirby/simd-json/tree/wasm) I'll try including it in a yew project I'm working on tomorrow and see if it a) works and b) offers any performance improvements. |
Oh that's pretty neat! Lets put that in a new ticket so it's hot hidden somewhere ina closed issue about M1 support :) |
I ran into a problem while compiling.
I looked up the value-trait and added
The problem became
Since value-trait is not in active development, I post the issue here as well.
The text was updated successfully, but these errors were encountered: