-
Notifications
You must be signed in to change notification settings - Fork 53
result_type for explicit promotion #91
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
Comments
Identified as needed in data-apisgh-14, also came up in data-apisgh-43 and data-apisgh-91.
Thanks @ezyang, good point about performance in eager mode. I'd be inclined to say the damage is limited enough that it's a cost worth paying (for now at least). And if someone finds it to be a bottleneck, that'd be (a) good data, and (b) likely possible to work around with a I just tested TensorFlow 2.4.0, and was surprised that
|
|
Currently the recommendation for code that needs to promote is:
In eager mode frameworks, making operations portable in this way also can result in extra memory usage, as you have to first do the cast, and then do the operation, whereas the cast might have been fused internally in the framework.
However, it's not clear how important this actually is in practice, since at least in PyTorch, a lot promotion is in fact implemented by first doing a cast and then doing a normal operation (instead of implementing quadratically many kernels). I don't know off the top of my head which operations this would be relevant for.
The text was updated successfully, but these errors were encountered: