You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "yongster (via GitHub)" <gi...@apache.org> on 2026/09/28 09:04:58 UTC
[PR] bench(arrow): add Float16 embedding cast benchmarks [arrow-rs]
yongster opened a new pull request, #11244:
URL: https://github.com/apache/arrow-rs/pull/11244
# Which issue does this PR close?
- Related to #11243. Does not close it. The kernel change is separate so this benchmark can land on `main` first.
# Rationale for this change
`cast_kernels` covers `float64 -> float32`, not `Float16` ↔ `Float32`. Without these cases on `main`, the bulk half-float conversion in #11243 has no baseline for the benchmark bot.
# What changes are included in this PR?
Four `cast_kernels` cases, 1024 × 768 values (an embedding-sized child array):
- `cast float16 to float32 1024x768`
- `cast float32 to float16 1024x768`
- `cast float16 to float32 1024x768 10pct null`
- `cast float32 to float16 1024x768 10pct null`
No kernel changes.
# Are these changes tested?
Benchmark-only. `cargo check -p arrow --bench cast_kernels --features test_utils` succeeds. Behavior is unchanged, so there are no new tests.
# Are there any user-facing changes?
No.
AI assistance: the benchmark cases were drafted with AI and then checked against the existing `cast_kernels` style.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bench(arrow): add Float16 cast benchmarks [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #11244:
URL: https://github.com/apache/arrow-rs/pull/11244#issuecomment-6006132588
do we still need this PR given https://github.com/apache/arrow-rs/pull/11245#issuecomment-6001837415?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bench(arrow): add Float16 cast benchmarks [arrow-rs]
Posted by "yongster (via GitHub)" <gi...@apache.org>.
yongster commented on code in PR #11244:
URL: https://github.com/apache/arrow-rs/pull/11244#discussion_r4188125931
##########
arrow/benches/cast_kernels.rs:
##########
@@ -257,6 +258,31 @@ fn cast_array(array: &ArrayRef, to_type: DataType) {
hint::black_box(cast(hint::black_box(array), hint::black_box(&to_type)).unwrap());
}
+fn build_half_embedding(
Review Comment:
Dropped `build_half_embedding`. These are plain Float16 and Float32 arrays; 1024×768 is only the length.
##########
arrow/benches/cast_kernels.rs:
##########
@@ -257,6 +258,31 @@ fn cast_array(array: &ArrayRef, to_type: DataType) {
hint::black_box(cast(hint::black_box(array), hint::black_box(&to_type)).unwrap());
}
+fn build_half_embedding(
+ rows: usize,
+ dims: usize,
+ null_every: Option<usize>,
+) -> (ArrayRef, ArrayRef) {
+ let len = rows * dims;
+ let f32_values = (0..len)
+ .map(|index| ((index.wrapping_mul(2_654_435_761) % 20_001) as f32 - 10_000.0) / 127.0)
Review Comment:
Removed the custom generator and `null_every`. The cases now use `create_nullable_f16_array` and `create_primitive_array`, which go through `seedable_rng` and take a `null_density` (`0.0` and `0.1`).
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bench(arrow): add Float16 cast benchmarks [arrow-rs]
Posted by "yongster (via GitHub)" <gi...@apache.org>.
yongster closed pull request #11244: bench(arrow): add Float16 cast benchmarks
URL: https://github.com/apache/arrow-rs/pull/11244
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bench(arrow): add Float16 embedding cast benchmarks [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #11244:
URL: https://github.com/apache/arrow-rs/pull/11244#discussion_r4176845984
##########
arrow/benches/cast_kernels.rs:
##########
@@ -257,6 +258,31 @@ fn cast_array(array: &ArrayRef, to_type: DataType) {
hint::black_box(cast(hint::black_box(array), hint::black_box(&to_type)).unwrap());
}
+fn build_half_embedding(
+ rows: usize,
+ dims: usize,
+ null_every: Option<usize>,
+) -> (ArrayRef, ArrayRef) {
+ let len = rows * dims;
+ let f32_values = (0..len)
+ .map(|index| ((index.wrapping_mul(2_654_435_761) % 20_001) as f32 - 10_000.0) / 127.0)
Review Comment:
why do we have this custom logic for generating numbers, rather than relying on rand? especially where it specifies `null_every` instead of using a float for null density
##########
arrow/benches/cast_kernels.rs:
##########
@@ -257,6 +258,31 @@ fn cast_array(array: &ArrayRef, to_type: DataType) {
hint::black_box(cast(hint::black_box(array), hint::black_box(&to_type)).unwrap());
}
+fn build_half_embedding(
Review Comment:
id suggest dropping "embedding" as it doesnt really have meaning in this context; all we care about is float16 regardless of what it represents
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] bench(arrow): add Float16 cast benchmarks [arrow-rs]
Posted by "yongster (via GitHub)" <gi...@apache.org>.
yongster commented on PR #11244:
URL: https://github.com/apache/arrow-rs/pull/11244#issuecomment-6053354128
@Jefffrey No. These cases were only there so the benchmark runner would have a baseline before the Float16 kernel change. That change is closed in #11245, and 1024×768 is much larger than the other `cast_kernels` cases, which use 512 rows. Closing this as well.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org