Skip to content

Memory Limitations #340

Closed
Closed

Description

@Nucs

Allocation currently supports up to 2^32 bytes due to using int and not IntPtr and long.

Activity

  1. self-assigned this
    on Aug 8, 2019
  2. Nucs commented on Aug 8, 2019

    @Nucs
    MemberAuthor

    Unit test

    [TestMethod]
    public void MyTestMethod()
    {
        NDArray x = np.zeros(new Shape(600, 1000, 1000), np.float32);
    }
  3. Nucs commented on Aug 12, 2019

    @Nucs
    MemberAuthor

    Ported UnmanagedMemoryBlock and ArraySlice to use long in commit 539683f .
    Next is to port Shape to use long and all the algorithms with it. Mainly refactoring job

  4. added
    coreInternal engine: Shape, Storage, TensorEngine, iterators
    architectureCross-cutting structural changes affecting multiple components
    on Feb 14, 2026
  5. Nucs commented on Sep 7, 2026

    @Nucs
    MemberAuthor

    Done via the int→long rewrite (#596, in 0.70.0 #628). The int/IntPtr allocation cap is gone: Shape size/dimensions/strides/offset are long (npy_intp parity) and the sort/select core is 64-bit, so arrays past int.MaxValue elements work:

    var a = np.arange(6).reshape(2, 3);
    Console.WriteLine(string.Join(",", a.strides));   // 24,8  (bytes per axis, npy_intp)

    The >2 GB / >int.MaxValue paths are gated by the [HighMemory] NpyLargeFileTests and a >int.MaxValue byte oracle. Closing.

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

Metadata

Metadata

Assignees

Labels

architectureCross-cutting structural changes affecting multiple componentscoreInternal engine: Shape, Storage, TensorEngine, iteratorsenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions