mbutrovich commented on PR #12419:
URL: https://github.com/apache/arrow-rs/pull/12419#issuecomment-7388028533

   > Setup: Rust 1.100.0, default `x86-64` target (so `Decimal32` takes the 
quarter null threshold)
   
   Thanks for the Zen 4 run. The default target allows only SSE2, so this build 
doesn't use the 7950X3D's AVX2 or AVX-512. DataFusion recommends building with 
at least `avx2`, preferably `target-cpu=native` 
([crate-configuration.md](https://github.com/apache/datafusion/blob/904afffc731637c4c927c8e095ed07fb195a6c79/docs/source/user-guide/crate-configuration.md?plain=1#L69-L75)),
 and Comet builds its amd64 library at `x86-64-v3` 
([Makefile](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/Makefile#L80-L81)).
 AVX2 has shipped since Haswell in 2013, so I'd rather tune this PR for those 
builds than for SSE2.
   
   That applies to the threshold I added for `Decimal32` without AVX2 in 
0b45c07346, and your run shows it doesn't fix SSE2 builds reliably. At half 
null it reads 0.86x to 0.95x here against 1.09x to 1.36x on the Xeon. The head 
removes it, so `Decimal32` switches at half null on every target, as the narrow 
`Decimal128` and `Decimal256` paths do. At that threshold the Xeon's SSE2 build 
had `Decimal32` at 0.82x to 1.01x at half null 
([default](https://github.com/apache/arrow-rs/pull/12419#issuecomment-7110466496),
 
[aligned](https://github.com/apache/arrow-rs/pull/12419#issuecomment-7110474566)).
 The `x86-64-v3` build is 2.69x to 2.97x 
([default](https://github.com/apache/arrow-rs/pull/12419#issuecomment-7359802079),
 
[aligned](https://github.com/apache/arrow-rs/pull/12419#issuecomment-7359807371)).
   
   > Would it be worth bounding only the valid values on that path, or keeping 
the existing kernel above some higher share of nulls?
   
   In the bot's `x86-64-v3` runs above, the only cases still below the baseline 
are `rem_rescaled` at nine tenths null, 0.93x for `Decimal128` and 0.85x to 
0.88x for `Decimal256`, and one value, 0.90x to 0.96x. Your bb79f07f4 numbers 
show what the bounding pass costs at nine tenths null: `Decimal64` is 1.16x for 
`rem_18_digits`, which skips it, and 0.78x to 0.82x for the cases that run it. 
Bounding each valid value means a check per value inside the `try_unary` 
closure. 51067797b0 did that and lost on the Xeon at three quarters null 
because the closure stopped inlining ([earlier 
comparison](https://github.com/apache/arrow-rs/pull/12419#issuecomment-7111707756)).
 For two cases at nine tenths null, I'd keep the single pass.
   
   Could you rerun on the 7950X3D with `RUSTFLAGS="-C target-cpu=native"`? None 
of the bot runs cover AVX-512.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to