Conversation
Merging this PR will degrade performance by 14.52%
Performance Changes
Comparing Footnotes
|
Benchmarks: FineWeb NVMeSummary
datafusion / vortex-file-compressed (1.047x ➖, 0↑ 3↓)
datafusion / vortex-compact (1.098x ➖, 0↑ 5↓)
datafusion / parquet (1.018x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.220x ❌, 0↑ 8↓)
duckdb / vortex-compact (1.171x ❌, 0↑ 8↓)
duckdb / parquet (1.138x ❌, 0↑ 8↓)
|
|
The codspeed regression is real imo. I think we need to avoid validation in almost all cases tbh.... |
gatesn
left a comment
There was a problem hiding this comment.
Let's discuss when we should run validation. Scalars are already slow, so it makes sense. Arrays it's less obvious...
Polar Signals Profiling ResultsLatest Run
Previous Runs (2)
Powered by Polar Signals Cloud |
Benchmarks: PolarSignals ProfilingSummary
datafusion / vortex-file-compressed (1.034x ➖, 0↑ 2↓)
|
Benchmarks: TPC-H SF=1 on NVMESummary
datafusion / vortex-file-compressed (0.824x ✅, 22↑ 0↓)
datafusion / vortex-compact (0.822x ✅, 20↑ 0↓)
datafusion / parquet (0.899x ✅, 10↑ 0↓)
datafusion / arrow (0.783x ✅, 21↑ 0↓)
duckdb / vortex-file-compressed (0.835x ✅, 21↑ 0↓)
duckdb / vortex-compact (0.879x ✅, 16↑ 0↓)
duckdb / parquet (0.909x ➖, 8↑ 1↓)
duckdb / duckdb (0.877x ✅, 17↑ 0↓)
|
Benchmarks: TPC-DS SF=1 on NVMESummary
datafusion / vortex-file-compressed (0.994x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.941x ➖, 30↑ 0↓)
datafusion / parquet (0.992x ➖, 1↑ 1↓)
duckdb / vortex-file-compressed (0.759x ✅, 93↑ 0↓)
duckdb / vortex-compact (0.951x ➖, 10↑ 0↓)
duckdb / parquet (0.879x ✅, 67↑ 0↓)
duckdb / duckdb (0.957x ➖, 9↑ 1↓)
|
Benchmarks: TPC-H SF=10 on NVMESummary
datafusion / vortex-file-compressed (0.994x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.999x ➖, 0↑ 0↓)
datafusion / parquet (1.005x ➖, 0↑ 0↓)
datafusion / arrow (1.009x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.004x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.006x ➖, 0↑ 0↓)
duckdb / parquet (1.005x ➖, 0↑ 0↓)
duckdb / duckdb (0.997x ➖, 0↑ 0↓)
|
Benchmarks: TPC-H SF=10 on S3Summary
datafusion / vortex-file-compressed (1.055x ➖, 0↑ 3↓)
datafusion / vortex-compact (0.907x ➖, 1↑ 0↓)
datafusion / parquet (0.928x ➖, 1↑ 1↓)
duckdb / vortex-file-compressed (0.966x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.944x ➖, 0↑ 1↓)
duckdb / parquet (1.018x ➖, 0↑ 0↓)
|
Benchmarks: FineWeb S3Summary
datafusion / vortex-file-compressed (0.851x ➖, 2↑ 1↓)
datafusion / vortex-compact (0.945x ➖, 1↑ 0↓)
datafusion / parquet (0.948x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.979x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.039x ➖, 0↑ 0↓)
duckdb / parquet (0.992x ➖, 0↑ 0↓)
|
Benchmarks: TPC-H SF=1 on S3Summary
datafusion / vortex-file-compressed (1.059x ➖, 2↑ 5↓)
datafusion / vortex-compact (0.988x ➖, 3↑ 3↓)
datafusion / parquet (0.896x ➖, 1↑ 0↓)
duckdb / vortex-file-compressed (1.020x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.026x ➖, 0↑ 0↓)
duckdb / parquet (0.990x ➖, 0↑ 0↓)
|
Benchmarks: Random AccessSummary
unknown / unknown (1.003x ➖, 6↑ 5↓)
|
Benchmarks: Statistical and Population GeneticsSummary
duckdb / vortex-file-compressed (1.015x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.991x ➖, 1↑ 0↓)
duckdb / parquet (1.022x ➖, 0↑ 0↓)
|
Benchmarks: Clickbench on NVMESummary
datafusion / vortex-file-compressed (1.005x ➖, 0↑ 0↓)
datafusion / vortex-compact (1.000x ➖, 1↑ 0↓)
datafusion / parquet (1.005x ➖, 0↑ 1↓)
duckdb / vortex-file-compressed (1.012x ➖, 2↑ 7↓)
duckdb / vortex-compact (1.038x ➖, 1↑ 8↓)
duckdb / parquet (1.000x ➖, 0↑ 0↓)
duckdb / duckdb (0.999x ➖, 1↑ 0↓)
|
Benchmarks: CompressionSummary
Detailed Results Table
|
|
there are also failures on cuda due to @gatesn Note that we do have a |
5fc6c09 to
6bdb086
Compare
gatesn
left a comment
There was a problem hiding this comment.
I think you need to go through all call sites of ExtensionArray::new and decide which should be unchecked, e.g. the compressor should be new_unchecked
22579ae to
a6653d9
Compare
36aa73a to
be8ffcf
Compare
|
so I'm running into cuda test failures where |
|
|
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
be8ffcf to
6f8fea2
Compare
|
@robert3005 so the error is triggered during stats collection (of min max), is there a way to tell stats to copy the buffer to host? Is that even something that makes sense? |
|
BufferHandle has |
|
So for me to do this, I have to figure out how to make this code: let stats = storage_array.statistics();
if let Some(min) = stats.compute_min::<i64>() {copy into a host buffer in order to compute the min stat. Do we need to fix that for the rest of the statistics, or is this just a bug? Shouldn't this compute function handle this internally? |
|
@onursatici @0ax1 @joseph-isaacs whats the solution to Connor’s problem? I think we have some api to validate if whole array is on the host or not. We can use that to skip but not sure how to do optional validation. Long term we want to have compute function deal with it but exact behaviour of it is still undecided |
|
I think we just document that validate will only be called for all-host arrays? Or you say that validation implementations should allow for non-host buffers and skip validation |
|
In theory, constructing an array from disk should be new_unchecked because we shouldnt perform validation while reading a file. Similarly, any transformation / scalar function should assume correct behavior and not revalidate the array. So this is only really on the write path, which is all in-memory anyway. |
|
I think what you suggest is fine, ie only validate all host arrays. We were adding debug assertions so you can run a slow gpu mode that still validate all the arrays for debugging |
|
Note that this issue is not limited to reading arrays from disk, for example if we decide to run an expression on an extension array (where really we run it on the storage array), that change might have invalidated the storage array. So I feel like this issue is inherent to stats computation on GPU buffers, not when and where we validate arrays. |
|
I don't really understand this? I'm saying validation shouldn't be run on read And stats are all considered to be optional at the moment |
|
so basically this is a stats bug, not a validation issue (stats computation should not panic). Just so we can move forward since this is blocking some other things, should I just disable those specific tests? Also, something that I just learned is that if stats computation ERRORs, it flattens and gives back |
|
You have I think computation error being None is consistent... Not sure what the caller would do if you gave them something else. |
Summary
Tracking Issue: #6872
Adds a
validate_arrayandarray_validatemethod toExtVTableandExtDTypeRef, respectively.This addition required adding implementations for all of the existing extension types (which is currently just the datetime types, UUID, and Tensor).
Also fixes some bugs in the implementation of the existing types, as well as some other tests that used to pass because we didn't validate anything before!
API Changes
Adds some new methods, so this doesn't break anything.
Testing
Adds a few tests via
ExtensionArray::try_new.