question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Review of merged #235 and #262

See original GitHub issue

@dsyme this merge #235 is slightly worrying. Let’s discuss when we meet next time.

About the Tensor0 case: I understand that you have some very good reason for this based on how you feel the codebase will evolve. I don’t like the change, but I have a feeling it needs to happen. Tensor0 is not a great name. Let’s think about a better one TensorC can be better. What about Tensor_?

Another thing is the “%A” printing which has been relying on the default DU printer. So that we got it look like Tensor [1.; 2.; 3.] I have a feeling this can be addressed through other means. (Later edit: I can see now that there is a new tensor printing code merged here #234, will check.)

More importantly I have significant worries about the following two changes. I have a feeling that the mistakes you identified were not mistakes but were some intentional design influenced by Python-like conventions. I need to remember and inspect the behavior and then try to understand your change better.

Fix a mistake in the slicing shape computation where the 1 flag was being set for slices like t.[3…] resulting in incorrect result shapes when using that notaion to slice the first or last single element.

Fix a mistake in boundsToShape, which is used in two slightly different ways - one to get the result shape of slicing, the other to push adjoints in the SliceTT reverse mode op back into the adjoint for the originating tensor.

Later edit: I think this is also connected with why you added the check here

member t.reversePush(value:Tensor) =
    let check (v:Tensor,t:Tensor) = 
        // check the shapes of the adjoints match the nodes to which they are being propagated
        assert (Shape.canExpand v.shape t.derivative.shape || Shape.canExpand t.derivative.shape v.shape)

I remember there were some very clear reasons and a careful design for the behavior you changed and it was also about the reverse mode shapes. I’m quite concerned about this merged code and I think the expand check is not a good idea. We don’t want things in reverse mode to rely on broadcasting/expansions etc. We need to check if the reverse pushed value has exactly the same shape with the primal of the node to which we are propagating. Anything other than that can be a cause for silent erroneous behavior with derivatives in future code. I think it’s very likely I would like to revert this merge.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dsymecommented, Nov 29, 2020

OK no problem

Bounds-related changes in #235 and #262: still no idea but I think I will understand when I read your messages more carefully

This was basically reverted in 262. There’s no change here now end to end

1reaction
dsymecommented, Nov 28, 2020

About the Tensor0 case: I understand that you have some very good reason for this based on how you feel the codebase will evolve. I don’t like the change, but I have a feeling it needs to happen. Tensor0 is not a great name. Let’s think about a better one TensorC can be better. What about Tensor_?

I don’t mind the name, TensorC or Tensor_ are both fine by me. I guess TensorC would be my preference

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Public Interest Test in Merger Review
In the first section of this report, an examination of public interest approaches to merger review internationally reveals differences in how each country ......
Read more >
Resolve "Google Analytics code not always present" (!262)
An error occurred while retrieving approval data for this merge request. Resolve "Google Analytics code not always present". Code. Review ...
Read more >
Modernizing Bank Merger Review
This Article asserts that contemporary bank merger analysis should instead emphasize statutory factors that regulators have long neglected:.
Read more >
Anticompetitive Merger Review
ANTICOMPETITIVE MERGER REVIEW. Samuel N. Weinstein*. U.S. antitrust law empowers enforcers to review pending mergers that might undermine competition.
Read more >
New error handling proof of concept (!262) · Merge requests
In this series, I plumb an IO::Error from the underlying TCP transport, through the channel and circuit managers, up to the toplevel, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found