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

[INFA][IR] Build and Evolve Low-level IR. Remove HalideIR dep. #3533

Merged
merged 6 commits into from
Jul 11, 2019

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Jul 11, 2019

  • Node system in include/tvm/node
  • IR node sin include/tvm/ir.h
  • Keep the IR nodes as consistent to the HalideIR as possible, will bring later PRs for refactoring so changes can be visible.

#3474

@tqchen tqchen requested a review from phisiart as a code owner July 11, 2019 00:59
*/
static Range make_by_min_extent(Expr min, Expr extent);
// declare range.
TVM_DEFINE_NODE_REF_METHODS(Range, NodeRef, RangeNode);
Copy link
Member

Choose a reason for hiding this comment

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

Can we unify the RELAY and TVM macros into one?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, likely we will need to use these macros instead in relay and remove relay specific macros.

};

/*! \brief Create a vector where all the elements are value. */
class Broadcast : public ExprNode {
Copy link
Member

Choose a reason for hiding this comment

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

This might be out of the scope for now, but I think we should use the XNode and X for the Node and NodeRef subclasses, it might be a good time to stop using raw pointers in the functor as well

static constexpr const char* shift_right = "shift_right";
static constexpr const char* popcount = "popcount";
static constexpr const char* likely = "likely";
static constexpr const char* glsl_texture_store = "glsl_texture_store";
Copy link
Member

Choose a reason for hiding this comment

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

Do we use this?

Copy link
Member Author

Choose a reason for hiding this comment

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

we do have a semi-functioning webgl backend that uses this intrinsic

});

TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
.set_dispatch<Free>([](const Free* op, IRPrinter* p) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should unify both printers and start using a layout algorithm, we already have some lines which are incredibly ugly in current printing strategy, probably out of scope of this PR though.

cc @MarisaKirisame

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of work in the printer. I am still trying to wrap up roundtripping.

Copy link
Member

@jroesch jroesch left a comment

Choose a reason for hiding this comment

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

I have a couple comments, but otherwise looks good

}

Stmt ProducerConsumer::make(FunctionRef func, bool is_producer, Stmt body) {
CHECK(body.defined());
Copy link
Contributor

Choose a reason for hiding this comment

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

#define CHECK_DEFINE(x) CHECK(x.defined()) << #x << " is not defined";

Copy link
Member Author

Choose a reason for hiding this comment

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

The error message of CHECK will automatically display the content, which is self-explained

Copy link
Member Author

Choose a reason for hiding this comment

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

it will be CHECK: body.defined() failed

});

TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
.set_dispatch<Free>([](const Free* op, IRPrinter* p) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of work in the printer. I am still trying to wrap up roundtripping.

@tqchen tqchen changed the title [INFA][IR] Build and Evolve Low-level IR. Remove dep from HalideIR. [INFA][IR] Build and Evolve Low-level IR. Remove HalideIR dep. Jul 11, 2019
tqchen and others added 3 commits July 11, 2019 09:48
Co-Authored-By: Jared Roesch <roeschinc@gmail.com>
Co-Authored-By: Jared Roesch <roeschinc@gmail.com>
@tqchen tqchen merged commit 0218557 into apache:master Jul 11, 2019
@tqchen
Copy link
Member Author

tqchen commented Jul 11, 2019

Thanks @jroesch @MarisaKirisame , this PR is now merged

@kparzysz-quic
Copy link
Contributor

Is this an effort to replace the Halide IR with something else? Is there a discussion somewhere?

@tqchen
Copy link
Member Author

tqchen commented Jul 12, 2019

@kparzysz-quic see RFC #3474

wweic pushed a commit to wweic/tvm that referenced this pull request Aug 9, 2019
…e#3533)

* [INFA][IR] Build and Evolve Low-level IR. Remove dep from HalideIR.


* Update include/tvm/node/ir_functor.h

Co-Authored-By: Jared Roesch <roeschinc@gmail.com>

* Update include/tvm/node/ir_functor.h

Co-Authored-By: Jared Roesch <roeschinc@gmail.com>
wweic pushed a commit to neo-ai/tvm that referenced this pull request Sep 6, 2019
…e#3533)

* [INFA][IR] Build and Evolve Low-level IR. Remove dep from HalideIR.


* Update include/tvm/node/ir_functor.h

Co-Authored-By: Jared Roesch <roeschinc@gmail.com>

* Update include/tvm/node/ir_functor.h

Co-Authored-By: Jared Roesch <roeschinc@gmail.com>
@tqchen tqchen deleted the ir branch October 31, 2019 17:03
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Oct 27, 2022
This parameter is nullable for cases where the else block isn't
present.  Previously, it was represented as a `Stmt` holding
`nullptr`, because
`IfThenElse` (apache#3533) predates the
`Optional` utility (apache#5314).  This
commit updates to use `Optional<Stmt>` instead, and updates all usages
of `else_case`.
junrushao pushed a commit that referenced this pull request Oct 29, 2022
This parameter is nullable for cases where the else block isn't
present.  Previously, it was represented as a `Stmt` holding
`nullptr`, because
`IfThenElse` (#3533) predates the
`Optional` utility (#5314).  This
commit updates to use `Optional<Stmt>` instead, and updates all usages
of `else_case`.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 10, 2022
This parameter is nullable for cases where the else block isn't
present.  Previously, it was represented as a `Stmt` holding
`nullptr`, because
`IfThenElse` (apache#3533) predates the
`Optional` utility (apache#5314).  This
commit updates to use `Optional<Stmt>` instead, and updates all usages
of `else_case`.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
This parameter is nullable for cases where the else block isn't
present.  Previously, it was represented as a `Stmt` holding
`nullptr`, because
`IfThenElse` (apache#3533) predates the
`Optional` utility (apache#5314).  This
commit updates to use `Optional<Stmt>` instead, and updates all usages
of `else_case`.
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.

4 participants