-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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
[Feature Request] Support Sparse Tensors in tf.linalg operations #27380
Comments
FYI: We are working towards this goal, but I cannot give you any firm dates. Stay tuned! |
@rmlarsen any updates on this? I am planning ahead and I'd need to know if I should wait for |
Please check tensorflow/addons#2396 |
Are there any updates in this regard? Especially a sparse solver (like linalg.solve) would be great. |
This would indeed be a huge benefit, thanks! |
Hi, Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base. The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate. Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space. Thank you! |
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. |
Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template
System information
Describe the feature and the current behavior/state.
Currently the
tf.linalg
operations seem to only support dense tensors. I have verifiedtf.linalg.solve
. Consider the following variablesnow if I do
this errors out with
However, if I do
it works, giving
which is roughly the correct answer. Example taken from the scipy sparse matrix factorized documentation.
Will this change the current api? How?
Instead of erroring out, the
linalg
operations will work for sparse inputs just as well as for dense inputs.Who will benefit with this feature?
I came across this while implementing NVIDIA's FastPhotoStyle in TensorFlow 2.0 + Keras.
The algorithm essentially has 2 steps,
PhotoWCT
transformation that isWCT
but uses maxpooling argvalues as unpooling masksThe NVIDIA implementation provides a
photo_wct
net implementation in PyTorch. However for the second step, a CPU implementation in scipy is used. The second step essentially solves a closed form system of equations.Consider line 48, what it is essentially doing is creating a diagonal matrix of size (width x height) of the image. So for a 512x512 image, in dense form it will have to create a matrix of 2^36 floats.
The matrix is later used to solve a system of equations (https://github.com/NVIDIA/FastPhotoStyle/blob/master/photo_smooth.py#L52).
2^36 tf.float32 values will occupy 2^8 = 256GB of memory, which will definitely overflow. Ideally, I should be able to work with tensorflow's
linalg
module just the same as the scipy implementation. An additional flexibility with TensorFlow is that it will place operations on GPUs automatically. Additionally, I can put it in a kerasLambda
layer to add it to a model.Any Other info.
No
The text was updated successfully, but these errors were encountered: