-
Notifications
You must be signed in to change notification settings - Fork 699
[Feature request] Tensor attributes #1213
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
@jsubag Jacob, thanks for working on this. Input/output annotation is a solution to some problem. I am not sure if it's the only solution and if it's the best solution. We need to make sure that any new attributes match the design of the rest of the system. For example, how do new attributes interact with public/private, mutability, etc. Let's talk about the problem. What usecase is the current system not handling well? |
@nadavrot Thanks for pointing out WeightVar::MutabilityKind, I missed that in the code :)
This however doesn't map the case where a tensor is used as both input and output, e.g. weights during training. Thanks. |
@jsubag We actually do not have anything that can be Public+Constant currently; Public implies Mutable. So both input and output tensors are considered to be Public+Mutable. Perhaps it makes more sense to allow input tensors to be Public+Constant, though, as they are still constant during execution even if modified/accessed before or after. If we made such a change, then if a tensor was used as both input and output then it would be Public+Mutable, as it currently is. |
@jfix71 I think the thing I'm missing is a clear way to figure out if a tensor is considered an input and/or output. |
@jsubag @jfix71 I think that the description of the problem in the last post is great. The next step would be to post proposal for a design that solves the problem. @qcolombet can help in brainstorming ideas for a design. What do you think? |
Hi @jsubag, I am not sure I get the problem. Outputs should be easy to identify, they are used by Save node. Having a backend utility function sounds reasonable though. Do you see cases where we would need to explicitly tag a variable? |
Hi @qcolombet ,
|
Hi @jsubag,
Now, for figuring out what and when should these be copied around, we are reworking the graph IR to have variables accessed exclusively through save and a new load nodes. We would potentially lower then into some new IR instructions that would make it easy to determine when such copies should occur (basically, just where you see such instructions). |
Hi @qcolombet , Thanks for clarifying - that was pretty much what I understood. Btw, will this change be applied to all variables or just public ones? and will constants be treated differently (weights/biases)? |
All variables public or not, constant or not. |
It would be useful to have more attributes on tensor objects.
Specifically, whether a tensor is an input/output for the function and whether its constant or mutable during inference etc.
Alternatively this could be added as a utility function that backends can invoke.
The text was updated successfully, but these errors were encountered: