Mir vs. Numpy: Reworked!
data pulverizer
data.pulverizer at gmail.com
Mon Dec 7 12:28:39 UTC 2020
On Monday, 7 December 2020 at 02:14:41 UTC, 9il wrote:
> I don't know. Tensors aren't so complex. The complex part is a
> design that allows Mir to construct and iterate various kinds
> of lazy tensors of any complexity and have quite a universal
> API, and all of these are boosted by the fact that the
> user-provided kernel(lambda) function is optimized by the
> compiler without the overhead.
I agree that a basic tensor is not hard to implement, but the
specific design to choose is not always obvious. Your benchmarks
shows that design choices have a large impact on performance, and
performance is certainly a very important consideration in tensor
design.
For example I had no idea that your ndslice variant was using
more than one array internally to achieve its performance - it
wasn't obvious to me.
I think literature that discuss various design choices and
approaches would be useful and informative. There is plenty of
literature on creating tree structures, linked lists, stacks,
queues, hash tables and so forth, but virtually nothing on tensor
data structures. It isn't as if implementing a linked list is any
more complex than a tensor. I just think it's a bit strange that
there is so little on the topic - given the widespread use of
tensors in computational science.
More information about the Digitalmars-d-announce
mailing list