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

[C#] Need bigger ArrowBuffer size for large data #38086

Open
Platob opened this issue Oct 6, 2023 · 4 comments
Open

[C#] Need bigger ArrowBuffer size for large data #38086

Platob opened this issue Oct 6, 2023 · 4 comments

Comments

@Platob
Copy link
Contributor

Platob commented Oct 6, 2023

Describe the enhancement requested

ArrowBuffer are currently based on ReadOnlyMemory

To scale to larger data (with length > int32), arrow buffers will need to handle byte length > int32, maybe a struct with nested memory buffers

public readonly partial struct ArrowBuffer : IEquatable<ArrowBuffer>, IDisposable
    {
        private readonly IMemoryOwner<byte> _memoryOwner;
        private readonly ReadOnlyMemory<byte> _memory;

Component(s)

C#

@Platob Platob changed the title [C#] Need bigger ArowBuffer size for large data [C#] Need bigger ArrowBuffer size for large data Oct 9, 2023
@CurtHagenlocher
Copy link
Contributor

CurtHagenlocher commented Mar 23, 2024

We can't chop the buffers up into a collection of smaller buffers without losing in-memory interoperability via the C API. I think to make this work, we would need to have implementations of LargeMemory<T>, LargeReadOnlyMemory<T>, LargeSpan<T>, LargeReadOnlySpan<T>, LargeMemoryManager<T> and ILargeMemoryOwner<T> which could be used to wrap native allocations and allow safe managed access to it. As I suggested in dotnet/runtime#12221, nothing stops us from defining these types in the C# Arrow implementation itself, though having them in the standard runtime is probably better for code sharing and reuse.

@adamreeve
Copy link
Contributor

Hi @CurtHagenlocher, we might have an intern joining us in the G-Research open source team soon and I thought this could be a useful project for them to work on. Before I propose it as an idea, I just wanted to check that you haven't already started work on this, and would be happy to accept a contribution for this?

@CurtHagenlocher
Copy link
Contributor

@adamreeve Overall, I think that would be great. I've played with it a little but only by starting to implement Large variations of Span, Memory, etc.. I'm also trying to start a conversation with some .NET folks about what they think makes sense, and trying to understand what's possible in terms of the derivative works I've created.

@anreetka
Copy link

take

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

No branches or pull requests

4 participants