Variable vs VariableState #4465
Replies: 1 comment
-
|
i understand, now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question regarding the difference between the two. This question came to mind because of the
nnx.get_partition_spec()functionality.What I’m trying to do is create function a that automatically create
PartitionSpecby inferring the shape of the parameters and the mesh configuration.When I try to do this:
It results in an error:
xhas no attributeshape. But when I run the following code:It runs fine.
If I understand correctly, the
variablelib.Variablecorresponds toparam.value, so it has the.shapeand even.shardingproperties (even though it's still the unsharded one). But what exactly isVariableStateused for, and what is the corresponding part in thennx.Moduleclass? Also, why doesnnx.get_partition_spec()perform the tree mapping withVariableStateas the definition of leaf?Beta Was this translation helpful? Give feedback.
All reactions