wasm32 simd128 backend doesn't define CurrentCpuF16/CurrentCpuBF16, breaking any build with target-feature=+simd128
Issue
Building any crate that depends on candle-core for wasm32-wasip2 (or wasm32-unknown-unknown) with -C target-feature=+simd128 fails to compile, even though the crate only ever uses DType::F32 weights and never touches f16/bf16.
Cause
src/cpu/mod.rs gates vec_dot_f16/vec_dot_bf16's SIMD-accelerated path behind #[cfg(any(target_feature = "neon", target_feature = "avx2", target_feature = "simd128"))], which requires CurrentCpuF16/CurrentCpuBF16 to exist for whichever backend is active. src/cpu/avx.rs and src/cpu/neon.rs both define all three (CurrentCpu, CurrentCpuF16, CurrentCpuBF16); src/cpu/simd128.rs only defines CurrentCpu. mod.rs's own pub use simd128::CurrentCpu; (no F16/BF16) confirms this wasn't a re-export oversight — the types were simply never written for this backend, likely because WASM SIMD128 has no native f16/bf16 conversion instructions the way AVX has F16C or NEON has native fp16 support.
My fix
Same pattern avx.rs already uses for its own no-hardware-conversion case (#[cfg(not(target_feature = "f16c"))]) and unconditionally for bf16 without avx512bf16: convert scalar-at-a-time on load/store via half::f16/half::bf16's own to_f32/from_f32, and do the real accumulation math as real v128 f32x4 SIMD, reusing the same reduction shape simd128.rs's own CurrentCpu::vec_reduce already has.
Context
Found while enabling WASM SIMD for a Whisper-inference plugin (candle-core/candle-nn/candle-transformers 0.11.0) targeting wasm32-wasip2. Reproduced directly: the exact error[E0433]: cannot find type 'CurrentCpuBF16' at src/cpu/mod.rs:382 when building with the flag, confirmed by reading simd128.rs vs avx.rs/neon.rs side by side. Patched locally with the fix described above and confirmed it resolves the compile error.
Source: huggingface/candle