Skip to content
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

Add serialization API for set of rows #7883

Closed
wants to merge 1 commit into from

Conversation

oerling
Copy link
Contributor

@oerling oerling commented Dec 5, 2023

Top level rows are more efficiently serialized in row sets rather than arrays or ranges. Arrays of ranges are still useful for repeated nested content. The row set path can uses SIMD to gather nulls and extract idices of non-null values for serialization.

A Scratch objett is added to signatures to pass reusable scratch memory also for top level calls to range serializing serializatin functions. This can remove malloc use for temporary vectors.

The API is tested standalone but is not connected to running code, so this diff does not affect running systens.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 5, 2023
Copy link

netlify bot commented Dec 5, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 26b000a
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/65773ad8d939e40008f4e6c9

@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@oerling oerling requested a review from Yuhta December 5, 2023 18:45
@Yuhta Yuhta requested a review from xiaoxmeng December 8, 2023 15:17
velox/serializers/PrestoSerializer.cpp Outdated Show resolved Hide resolved
auto nulls = nullsHolder.get(bits::nwords(numRows));
simd::gatherBits(rawNulls, rows, nulls);
auto nonNulls = nonNullsHolder.get(numRows);
const auto numNonNull = simd::indicesOfSetBits(nulls, 0, numRows, nonNulls);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment that we expect mostly set bits so prefer materializing indices to maximize instruction level parallelism

auto size = serializer->maxSerializedSize();
LOG(INFO) << "Size=" << size << " estimate=" << sizeEstimate << " "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging or turn it into an assertion

velox/serializers/tests/PrestoSerializerTest.cpp Outdated Show resolved Hide resolved
@Yuhta
Copy link
Contributor

Yuhta commented Dec 8, 2023

@oerling There are also some tests failing in the internal builds

@oerling
Copy link
Contributor Author

oerling commented Dec 10, 2023 via email

@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Top level rows are more efficiently serialized in row sets rather than
arrays or ranges. Arrays of ranges are still useful for repeated
nested content.  The row set path can uses SIMD to gather nulls and
extract idices of non-null values for serialization.

A Scratch objett is added to signatures to pass reusable scratch
memory also for top level calls to range serializing serializatin
functions. This can remove malloc use for temporary vectors.

The API is tested standalone but is not connected to running code, so
this diff does not affect running systens.
@facebook-github-bot
Copy link
Contributor

@oerling merged this pull request in 25398f2.

Copy link

Conbench analyzed the 1 benchmark run on commit 25398f21.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants