-
Notifications
You must be signed in to change notification settings - Fork 232
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
Forbid inefficient TensorDescriptor initialization #3393
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although there are a couple of minor comments.
Majority of tests heavily rely on |
* Improve 'size_t' support for the tests (related to #3393) * move tensor_scale/set tests to gtest * add binary and ternary subtensor operations and speed everything up unary: 2.1-3.8x binary: 1.8-2.7x ternary: 1.3-1.7x * move tenosor_cast/_copy tests to gtest, fix obvious bugs * use lambdas insteal of functor structs * replace inefficient loop * fix compilation error * remove removed tests * fix build * fix test names * clang-format * fix tensor initialization * fix msvc macro expansion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. A lot. I'd like it even more if we abandoned using std::vector directly and create objects for lengths and strides and wrap a lot of the conversions and checks into them.
@randyspauldingamd I believe this is now your PR 😄. Does it pass the CI? |
It doesn't. Fixing old the CTests is a pain in the |
I just had to open my big mouth...lol. Yeah, I can take this one. I expect I'll get a few of those ctest->gtest conversion tasks after the new year anyway :) |
Initializing TensorDescriptor from
std::vector<int>
is very inefficient due to extra checks and multiple intermediate vector, since internallystd::vector<size_t>
is used.Changed all the initializations to the native
size_t
, removed constructors withstd::vector<int>
and added workarounds for a legacy descriptors initializations withint
's.It increased performance for the current RNN implementation for a few percents.