-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add power, exponent, log ops large tensor support #15794
Conversation
@@ -351,6 +351,69 @@ def test_topk(): | |||
l = nd.topk(b, k=1, axis=-1, dtype=np.int64, ret_typ="value") | |||
assert l.sum() == np.sum(np.arange(0, SMALL_Y)) | |||
|
|||
def test_exponent_logarithm_operators(): | |||
a = 2*nd.ones(shape=(LARGE_X, SMALL_Y)) |
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.
reuse create_2d_tensor?
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.
a. create_2d_tensor uses 114G (htop reading) for the creating an nd array while same MXNet nd would do it around 40G.
b. np.arange is not really necessary. All we need to do is test if the function works for large arrays.
What do you think?
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.
maybe we should change create_2d_array to make it more efficient.
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.
yes. but ill address that in separate PR if that's fine.
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.
Yeah lets remove unnecessary numpy APIs from this test file if they eat up too much memory
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
* power, exponent, log ops * lint * Trigger notification * Trigger notification * Trigger notification
* power, exponent, log ops * lint * Trigger notification * Trigger notification * Trigger notification
* power, exponent, log ops * lint * Trigger notification * Trigger notification * Trigger notification
* power, exponent, log ops * lint * Trigger notification * Trigger notification * Trigger notification
Description
Added large tensor support to follow ops
Exponent & Log -
exp
,expm1
,log
,log2
,log10
,log1p
Power -
sqrt
,rsqrt
,cbrt
,rcbrt
,square
,reciprocal
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.