Skip to content

Conversation

@yelite
Copy link
Owner

@yelite yelite commented Jun 29, 2022

No description provided.

using OpKind = OperationDocNode::Kind;

switch (operation_kind) {
case OpKind::kAssert:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make a separate AssertDoc which is a StmtDoc? It seems strange to mix it with operations which are expressions, not statements.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point and I am open to discussion here. When we designed Doc, our goal is to have a minimal representation of language syntax. So the Doc sub classes are either:

  1. General syntax structure shared by many ordinary programming languages, like AttrAccessDoc, IfDoc, etc.
  2. Critical structure for our use case (representation of TIR), like ScopeDoc and LambdaDoc.

I don't feel that assert belongs to either cases above so it's not represented as a top level Doc class. I agree that it's not intuitive to represent assert statement as an ExprStmtDoc(OperationDoc(OpKind::kAssert, ...)).

@yelite yelite merged commit 10d1bd1 into tunip Jun 30, 2022
yelite pushed a commit that referenced this pull request Feb 17, 2023
* Shape and type deduction.

* Fix header.

* Add call attrs to the deduce signature.

* Address comments.

* Add DiagnosticContext to IRBuilder and inference signature.

* Fix nits.
yelite pushed a commit that referenced this pull request Feb 17, 2023
* [IR] Introduce StructInfo

* StructInfoFunctor and Analysis Support

* [TVMScript] Parse type/shape annotation with StructInfo

* remove runtime type assign

* Remove type/shape during parsing (#2)

* Normalizer prep: simple checks and legacy function renaming.

* Struct info deduction in BlockBuilder.

* Two TODOs

* StructInfo Normalizer Fixes (#3)

* StructInfo AST Fix

* Fix Extern Func Deduction and shape mutator.

* Update VoidStructInfo & globalvar (#4)

* Fix passes and proper sinfo propagation.

* Refactor EraseToWellDefined to Enable Remapping

* [WIP] First stab at symbolic param tracking

* Update EraseToWellDefined to support symbolic shape return (#5)

* fix R.shape with ndim (#6)

* Remove update shape/type

* Address review comment, AnnotateTypeShape=>AnnotateStructInfo

* Update include/tvm/script/ir_builder/relax/frame.h

Co-authored-by: Ruihang Lai <ruihangl@cs.cmu.edu>

* Address comments

* Update printer to use structinfo (#7)

* Update Error mechanism to prep for obj loc based reporting

* Symbolic shape aware function call return value derivation.

The main flow works as follows:
- Match and populate shape_var_map and var_map by visit each pair of
  param and call arguments.
- Call EraseToWellDefined to map the ret parameter to new result.

* [ANALYSIS] Refactor well-form to only look at struct info.

* Update comments according to reviews.

* Update include/tvm/relax/struct_info.h

Co-authored-by: Ruihang Lai <ruihangl@cs.cmu.edu>

Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
Co-authored-by: Tianqi Chen <tqchen>
Co-authored-by: Ruihang Lai <ruihangl@cs.cmu.edu>
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.

3 participants