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.

[RFC] [Relay]A Normal Form Conversion

See original GitHub issue

https://github.com/dmlc/tvm/pull/2251 implement a pass which converts expression with sharing (different occurrence of Expr might be the same ptr) into expression without sharing, by inserting let all over the place.

It is useful because it allows subsequent passes to ignore sharing and only deal with let (which might also reside in the original program anyway).

However, to do so, we must define precisely what is the scope of a node. It is determined by the Expr that immediately depends on it. For example in the Graph a + b, a + b immediate depends on both a and b. We will call ‘immediately depends on’ ‘point to’ from now on.

Let’s start from the degenerate case that there is only one graph a that points to b. In that case, GetScope(a, b) = scope(a) if (b is not in curly brace position of a) else new_subscope(scope(a))

Now the other case. If nothing points to node b: b is the outmost scope

If there are multiple pointer pointing to b: b’s scope is the least common ancestor of all GetScope.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
MarisaKirisamecommented, Jan 22, 2019

@junrushao1994 0: we decided to used anf instead of cps because the latter is more complex (not just the transformation, but subsequent optimization is harder to write in cps style). also we do not need continuation. 1: the complexity is somewhere around n log n, so it would not be an issue. also other passes will have a higher complexity, so this is not a bottleneck afaik. also even if the nn is 10k layers we might simply represent it as a compact program.

1reaction
junrushaocommented, Jan 19, 2019

@tqchen in your example, %1 = %x -1 should be %1 = %x, which is a typo

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 5766 - Traversal Using Relays around NAT (TURN)
Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN) (RFC 5766, April 2010; obsoleted by ...
Read more >
RFC 4141: SMTP and MIME Extensions for Content Conversion
Such content needs to be converted to an acceptable form, with the same information or ... When an SMTP relay or server performs...
Read more >
Basic Block Normal Form - pre-RFC - Apache TVM Discuss
This RFC discusses the pros and cons of each normal form and proposes a new normal form that can help to balance the...
Read more >
Internet Relay Chat - Wikipedia
Standard (RFC 1459) modesEdit ; i, Invisible—cannot be seen without a common channel or knowing the exact name ; s, Receives server notices...
Read more >
RFC822: Standard for ARPA Internet Text Messages
The syntax of the standard, in RFC #733, was originally specified in the Backus-Naur Form (BNF) meta-language. Ken L. Harrenstien, of SRI International,...
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