Skip to content
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

Missing callbacks #92

Closed
khatchad opened this issue Oct 19, 2023 · 2 comments · Fixed by ponder-lab/ML#61 or #114
Closed

Missing callbacks #92

khatchad opened this issue Oct 19, 2023 · 2 comments · Fixed by ponder-lab/ML#61 or #114
Assignees
Labels
bug Something isn't working

Comments

@khatchad
Copy link
Collaborator

khatchad commented Oct 19, 2023

Missing Strategy.run()

Called here: https://github.com/mead-ml/mead-baseline/blob/5d7632bb151c2d09501ebf49f36ba8c4204df4c8/mead/api_examples/pretrain_discrim_tf.py#L414.

The callback function _replicated_train_step() is defined here: https://github.com/mead-ml/mead-baseline/blob/5d7632bb151c2d09501ebf49f36ba8c4204df4c8/mead/api_examples/pretrain_discrim_tf.py#L394-L405.

But, we don't see it in the call graph. The method reference should be: < PythonLoader, Lscript pretrain_discrim_tf.py/train/_replicated_train_step, do()LRoot; >. The call graph nodes: https://gist.github.com/khatchad/ab56e3be454103829275c7507999b7d1

Regression

There are some callbacks defined in tensorflow.xml, as well as others. I see the return values are specified, but I wonder if adding the callback summary will also consider the given function argument as invoked:

<package name="tensorflow/estimator">
<class name="Estimator" allocatable="true">
<method name="do" descriptor="()LRoot;" numArgs="2" paramNames="self model">
<new def="x" class="Ltensorflow/estimator/train/train" />
<putfield class="LRoot" field="train" fieldType="LRoot" ref="self" value="x" />
<putfield class="LRoot" field="$callback" fieldType="LRoot" ref="x" value="model" />
<return value="arg0" />
</method>
</class>

<package name="tensorflow/estimator/train">
<class name="train" allocatable="true">
<method name="do" descriptor="()LRoot;" numArgs="3">
<getfield class="LRoot" field="$callback" fieldType="LRoot" ref="arg0" def="xx" />
<getfield class="LRoot" field="data" fieldType="LRoot" ref="arg1" def="data" />
<call class="LRoot" name="do" descriptor="()LRoot;" type="virtual" arg0="xx" arg1="data" arg2="3" numArgs="3" def="v" />
<return value="v" />
</method>
</class>
</package>

The ones there are for estimators (looks like there's two definitions). I wonder if we just need to add more for, e.g., TF2 APIs. I found these docs for the estimator.

@khatchad khatchad added the bug Something isn't working label Oct 19, 2023
@khatchad
Copy link
Collaborator Author

khatchad commented Nov 1, 2023

Actually, above, we can see that xx represents the passed function (arg0; but represented as a field?):

<getfield class="LRoot" field="$callback" fieldType="LRoot" ref="arg0" def="xx" />

Then, a call is added to this function:

<call class="LRoot" name="do" descriptor="()LRoot;" type="virtual" arg0="xx" arg1="data" arg2="3" numArgs="3" def="v" />

The first argument of the original function is passed:

<getfield class="LRoot" field="data" fieldType="LRoot" ref="arg1" def="data" />

@khatchad
Copy link
Collaborator Author

khatchad commented Dec 4, 2023

For experimental_distribute_datasets_from_function, that function:

Generates tf.distribute.DistributedValues from value_fn.

Tracking DistributedValues isn't currently supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant