Skip to content

GH-43854: [C++] Expose the set of device types where a ChunkedArray is allocated - #43853

Merged
felipecrv merged 7 commits into
apache:mainfrom
felipecrv:chunked_array_device_types
Aug 28, 2024
Merged

GH-43854: [C++] Expose the set of device types where a ChunkedArray is allocated#43853
felipecrv merged 7 commits into
apache:mainfrom
felipecrv:chunked_array_device_types

Conversation

@felipecrv

@felipecrvfelipecrv commented Aug 27, 2024

Copy link
Copy Markdown
Contributor

Rationale for this change

ChunkedArrays allow flexible allocation of arrays -- the whole array doesn't have to be allocated in huge contiguous buffers. Nothing today prevents chunked arrays from being made of chunks allocated in different devices and that is good. But we need a way to query the set of devices where a chunked array is allocated at. This PR adds that missing part.

What changes are included in this PR?

Addition of:

  • the DeviceAllocationTypeSet class
  • ChunkedArray::device_types()
  • Datum::device_types()

Moved enum DeviceAllocationType to the type_fwd.h header because device.h is too expensive of a header to hold this widely used enum.

Are these changes tested?

Added more asserts to chunked_array_test.cc.

Are there any user-facing changes?

New APIs.

@felipecrvfelipecrv changed the title [C++] Expose the set of device types where a ChunkedArray is allocatedGH-43854: [C++] Expose the set of device types where a ChunkedArray is allocatedAug 27, 2024
@apacheapache deleted a comment from github-actionsBotAug 27, 2024
@felipecrv
felipecrv requested a review from bkietzAugust 27, 2024 18:54
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #43854has been automatically assigned in GitHub to PR creator.

Comment threadcpp/src/arrow/chunked_array.h Outdated
@github-actionsgithub-actionsBot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Aug 27, 2024
Comment threadcpp/src/arrow/type_fwd.h
@github-actionsgithub-actionsBot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Aug 27, 2024
@github-actionsgithub-actionsBot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Aug 27, 2024
@felipecrv
felipecrv requested a review from bkietzAugust 27, 2024 21:23
@github-actionsgithub-actionsBot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Aug 28, 2024
@felipecrv
felipecrv merged commit 0bc91dd into apache:mainAug 28, 2024
@felipecrvfelipecrv removed the awaiting merge Awaiting merge label Aug 28, 2024
@felipecrv
felipecrv deleted the chunked_array_device_types branch August 28, 2024 18:14
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 0bc91dd.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.

khwilson pushed a commit to khwilson/arrow that referenced this pull request Sep 14, 2024
…rray is allocated (apache#43853)
### Rationale for this change
`ChunkedArray`s allow flexible allocation of arrays -- the whole array doesn't have to be allocated in huge contiguous buffers. Nothing today prevents chunked arrays from being made of chunks allocated in different devices and that is good. But we need a way to query the set of devices where a chunked array is allocated at. This PR adds that missing part.
### What changes are included in this PR?
Addition of:
- the `DeviceAllocationTypeSet` class
- `ChunkedArray::device_types()`
- `Datum::device_types()`
Moved `enum DeviceAllocationType` to the `type_fwd.h` header because `device.h` is too expensive of a header to hold this widely used `enum`.
### Are these changes tested?
Added more asserts to `chunked_array_test.cc`.
### Are there any user-facing changes?
New APIs.
* GitHub Issue: apache#43854
Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@felipecrv@bkietz