Live data from Hacker News

HPTT: A High-Performance Tensor Transposition C++ Library

arxiv.org

21–30 of 30 posts

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#21
post #5
post #3

Earlier quoted context omitted.

Faster tensor transposition, which can speed up applications that do manipulation and calculation with tensors. Tensors are typically seen in physics.

For some reason, people use now the name "tensor" to refer to multidimensional arrays.

Thanks. I've been meaning to read up on tensors as per tensorflow. Now I feel I don't need to.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#22
post #5
post #3

Earlier quoted context omitted.

Faster tensor transposition, which can speed up applications that do manipulation and calculation with tensors. Tensors are typically seen in physics.

For some reason, people use now the name "tensor" to refer to multidimensional arrays.

Quietly raising my hand that this bugged me too.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#23
post #14
post #9

Earlier quoted context omitted.

Except that none of these operations are related to the properties that make a tensor a tensor, as far as I know. People were already operating happily on multidimensional arrays before.

"multidimensional array" doesn't quite roll off the tongue

They could have just been called arrays.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#24
post #5
post #3

Earlier quoted context omitted.

Faster tensor transposition, which can speed up applications that do manipulation and calculation with tensors. Tensors are typically seen in physics.

For some reason, people use now the name "tensor" to refer to multidimensional arrays.

Mathematica has been using that terminology since 1988, and was written by mathematicians and physicists.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#25
post #17
post #11

Earlier quoted context omitted.

Probably for same reason as they use the name "vector" to refer one dimensional array, "matrix" to refer 2 dimensional array. Tensor is generalization of matrix to more than 2 indices. In physics people use tensor as a shorthand for tensor field.

> Probably for same reason as they use the name "vector" to refer one dimensional array, "matrix" to refer 2 dimensional array. Yes, that's where the rot started.

That "rot" likely started centuries before anyone even imagined a computer for an "array" to exist on.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#26
post #22
post #5

Earlier quoted context omitted.

For some reason, people use now the name "tensor" to refer to multidimensional arrays.

Quietly raising my hand that this bugged me too.

Mathematics also uses tensor to refer to elements of a tensor product of two vector spaces. A tensor product of an n dimensional and an m dimensional space gives an n x m dimensional space. So to the extent that an array is a vector, a higher dimensional array is in a tensor product of vector spaces, and so we call it a tensor. Or, there's a correspondence between k-dimensional arrays an a tensor product of k vector spaces determined by a choice of bases of the vector spaces. And we're quite comfortable picking a "standard" basis for R^k, so we conflate the two ideas.

Now the part that always bugged me was that, at least in C++, a vector is an array that can change length, which is a very non-vectorial thing to do.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#27
post #6

Earlier quoted context omitted.

Note that they only compared their solution with Eigen’s tensor transposition functionality. HPTT is not a drop-in replacement.

Does anyone know how much time a typical TensorFlow model spends in transposition routines?

No hard numbers to present, but it would be beneficial in long-sequence LSTM networks, because TensorFlow has to do time-major batch-major transposition between steps.

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#28
post #15
post #13

Earlier quoted context omitted.

You might be familiar with more specific definition of tensors in physics where they come with full tensor calculus and transform in certain way. More general mathematical definition of tensor is that tensors are multilinear maps from vector spaces to scalars. That's how TensorFlow and HPTT see these tensors.

> More general mathematical definition of tensor is that tensors are multilinear maps from vector spaces to scalars. That's how TensorFlow and HPTT see these tensors. Oof, you have to squint very hard to see things that way. Just because an image is physically a two-dimensional array of pixels doesn't suddenly make it a rank-2 multilinear map, and just because you have N planes of images doesn't mean you suddenly hav…

[deleted]

Re: HPTT: A High-Performance Tensor Transposition C++ Library

#30

Would be fantastic if this could be contributed to numpy. Edit: source code is GPL licensed https://github.com/springer13/hptt

HPTT is intended as a drop-in replacement for any tensor transposition (see example on GitHub). Please let me know (best via email) if you run into any problems while integrating it.
Post reply on HN