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

[TIR] Improve Let/LetStmt support. #5949

Merged
merged 1 commit into from Jun 28, 2020
Merged

[TIR] Improve Let/LetStmt support. #5949

merged 1 commit into from Jun 28, 2020

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Jun 28, 2020

Let/LetStmt are useful primitives to create variable bindings.
While let binding are harmful for simplification and integer analysis(due to the indirection), they are useful for other cases:

  • C0: LetStmt is useful to represent a step that has side effect(e.g. call a PRNG)
  • C1: Let expression can be used to create deep nested expression for complicated functions.

This PR improves the let support in the following ways:

  • Enable vectorization support for let
  • Change let simplification strategy to simplify the most trivial case
    while ignore more complicated cases(to avoid deep nest explosion)
  • Enhance arith module to handle const bound and modular set for let.

We also relaxed the SSA checking conditions for Let expression, to allow the same var to be binded multiple times, as long as their binding value are equal to each other.

The overall recommendation is to only use Let in the cases when necessary(C0, C1).

@tqchen tqchen force-pushed the let branch 3 times, most recently from 9dadf68 to 68553d0 Compare June 28, 2020 01:58
Let/LetStmt are useful primitives to create variable bindings.
While let binding are harmful for simplification and integer analysis,
they are useful for other cases:

- C0: LetStmt is useful to represent a step that has side effect(e.g. call a PRNG)
- C1: Let expression can be used to create deep nested expression for complicated functions.

This PR improves the let support in the following ways:
- Enable vectorization support for let
- Change let simplification strategy to simplify the most trivial case
  while ignore more complicated cases(to avoid deep nest explosion)
- Enhance arith module to handle const bound and modular set for let.

The overall recommendation is to only use Let in the cases when necessary(C0, C1).
@tqchen
Copy link
Member Author

tqchen commented Jun 28, 2020

@tqchen tqchen merged commit 4fbfaca into apache:master Jun 28, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Jun 30, 2020
Let/LetStmt are useful primitives to create variable bindings.
While let binding are harmful for simplification and integer analysis,
they are useful for other cases:

- C0: LetStmt is useful to represent a step that has side effect(e.g. call a PRNG)
- C1: Let expression can be used to create deep nested expression for complicated functions.

This PR improves the let support in the following ways:
- Enable vectorization support for let
- Change let simplification strategy to simplify the most trivial case
  while ignore more complicated cases(to avoid deep nest explosion)
- Enhance arith module to handle const bound and modular set for let.

The overall recommendation is to only use Let in the cases when necessary(C0, C1).
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Jul 2, 2020
Let/LetStmt are useful primitives to create variable bindings.
While let binding are harmful for simplification and integer analysis,
they are useful for other cases:

- C0: LetStmt is useful to represent a step that has side effect(e.g. call a PRNG)
- C1: Let expression can be used to create deep nested expression for complicated functions.

This PR improves the let support in the following ways:
- Enable vectorization support for let
- Change let simplification strategy to simplify the most trivial case
  while ignore more complicated cases(to avoid deep nest explosion)
- Enhance arith module to handle const bound and modular set for let.

The overall recommendation is to only use Let in the cases when necessary(C0, C1).
@tqchen tqchen deleted the let branch July 20, 2020 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants