Skip to content

Conversation

@wesm
Copy link
Member

@wesm wesm commented Aug 28, 2017

This additionally does a few things:

  • Change libarrow_gpu to use CUDA driver API instead of runtime API
  • Adds code for exporting buffers using CUDA IPC on Linux, but this is not yet tested

wesm added 10 commits August 28, 2017 10:37
Change-Id: Ife0b48c87b27983352a498f1d3adbcc5d952265b
Change-Id: I97ba1480dfc13b1a95b2bb05e68a1de2afe9c7cc
Change-Id: I487458dd66e7f544402a3b1fc91793d492ff114e
Change-Id: I3ad52acd665869f0755566f3d7331dcf6567d654
Change-Id: I24d9d9510c8164dea36d83028b3c4bdbddbe2d85
Change-Id: I844b83e2e88c10d60f7c3d6bdd818c6642905a81
… tests yet

Change-Id: Ib46b646219e83c35828cf19a5e8d3bc8cc096f25
Change-Id: I8dd313ac4e1cc0c01fdbe760bcae325a55ec8818
Change-Id: I9eaf54a1a058a18f17251816ec22e5e4e3a260da
Change-Id: I438d03b64f713e24299cc107b90f36a69da59f25
@wesm
Copy link
Member Author

wesm commented Aug 28, 2017

cc @m1mc @asuhan @seibert @sklam

This patch enables writing record batches to GPU device memory with code like:

std::shared_ptr<CudaBuffer> device_serialized;
ASSERT_OK(arrow::gpu::SerializeRecordBatch(*batch, context_.get(),
                                           &device_serialized));

You can also do zero-copy read from device memory:

Status ReadRecordBatch(const std::shared_ptr<Schema>& schema,
                       const std::shared_ptr<CudaBuffer>& buffer,
                       MemoryPool* pool, std::shared_ptr<RecordBatch>* out);

The returned record batch in this case will have device pointers in its buffers.

We'll need to do a tiny bit of work so that libarrow_gpu can "attach" to existing CUcontext created by others (see ARROW-1423), but I wanted to get this reviewed and merged first.

Additionally, we have the new functions for schema serialization:

Status SerializeSchema(const Schema& schema, MemoryPool* pool,
                       std::shared_ptr<Buffer>* out);

Status ReadSchema(io::InputStream* stream, std::shared_ptr<Schema>* out);

# specific language governing permissions and limitations
# under the License.

cuda_version.h No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

newline

@pcmoritz
Copy link
Contributor

Thanks, this is very exciting!

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

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

+1, LGTM

Change-Id: I4b47942c3621d67cfeacb0b14502b89d8ba318cc
@wesm
Copy link
Member Author

wesm commented Aug 28, 2017

Thanks. I will resolve the outstanding issues around shared CUDA contexts in the course of making a PR into MapD to simplify their Arrow serialization code

@asfgit asfgit closed this in 0728148 Aug 28, 2017
@wesm wesm deleted the ARROW-1364 branch August 28, 2017 18:47
@asuhan
Copy link
Contributor

asuhan commented Aug 28, 2017

Thanks, I forward to using this in our product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants