Replies: 2 comments 1 reply
-
So the PR that made things explicit about tensors being F ordered aimed to resolve some of the confusion. It made the internal storage Fortran layout almost everywhere but as you noted in the tutorial we're getting the warning about conversions occuring so obviously we need to track down where the extra conversions are occuring (which was the goal of making the loud warning to catch edge cases). As for the 1D tensors I don't know the Numpy internals offhand but I think that for 1D arrays the layouts should be equivalent. We have a custom implementation of linear indexing etc so if you use the tensor class access methods it should be consistent with Fortran even if the internals are inefficiently laid out in memory. Are you seeing actual functional errors or are we just tracking down making the docs/instructions clearer? My preference would be to make everything explicitly F ordered to start with the goal to set things up to support F and C order in the future (since C is numpys default). As for performance we have some minimal benchmarking code setup but if we start to see issues while running real world examples we can expand that further to identify hot spots with existing tooling. |
Beta Was this translation helpful? Give feedback.
-
The loud warning is great and very helpful. Are you doing both MATRICES and TENSORS in Fortran order? I ask because this may also impact some computations. I don't think it should be a major hit, but we probably need to make a list somewhere of all the functions where the layout matters. For 1D, it is the same - C and F are the same. Nevertheless, I might suggest removing that comment as it should be irrelevant. I'm curious about the custom implementation of linear indexing. We did our own in MATLAB because theirs didn't support conventions such as providing an array of linear indices. Is the reason here similar? I haven't seen functional errors yet, but I also haven't been testing things at that level. I should get to that point in January. I think it should be possible to support both F & C orders. Is there any way to get a listing of all functions in pyttb? Both standalone functions and class functions? Thanks. Also, what do you do in terms of performance testing? That needn't (and probably shouldn't) be a regular check-in test because it would be expensive, but it could be helpful in terms of identifying performance issues. |
Beta Was this translation helpful? Give feedback.
-
There is a lot of confusion for me about how tensors are stored and what this means for linear indexing, various efficient computations, etc. There is a note that "Note that 1D tensors (i.e., when len(shape)==1) contains a data array that follow the Numpy convention of being a row vector." in the tensor documentation. This, for instance, implies C order. Also, it seems that it is stored in C order until some other order is needed, which can be a major performance hit. I want to have a thread going as this gets sorted. It is possible to do everything in C order, but it just means revisiting a lot of things, especially some of the linear indexing, special in-place methods for TTM, etc.
Beta Was this translation helpful? Give feedback.
All reactions