Skip to content

Kernel IR refactoring: part 4.1#284

Merged
tlemo merged 59 commits into20_7_6_develfrom
code_ir_part4b
Aug 12, 2020
Merged

Kernel IR refactoring: part 4.1#284
tlemo merged 59 commits into20_7_6_develfrom
code_ir_part4b

Conversation

@tlemo
Copy link
Copy Markdown
Collaborator

@tlemo tlemo commented Aug 11, 2020

A small followup to the previous iteration, completing a few unfinished parts around kir::Allocate.

tlemo added 30 commits July 20, 2020 17:55
This reverts commit fc09c1b5a7240701da093406753908eba6f41e1d.
Copy link
Copy Markdown
Owner

@csarofeen csarofeen left a comment

Choose a reason for hiding this comment

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

Blocking for now as Indexing is being rebased.

@tlemo tlemo requested a review from csarofeen August 12, 2020 18:38

if (a->buffer()->getValType().value() == ValType::KirTensorView) {
const auto tv = a->buffer()->as<kir::TensorView>();
TORCH_INTERNAL_ASSERT(tv->domain()->nDims() > 0);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm not 100% certain we won't actually send a 0-dim tensor view to this. That would indicate it's just a scalar.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Actually it looks like we were supporting it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good question. Yes, the code was in there but never used as far as I can tell.

More importantly, this is a good example where we can consider different trade-offs between Fusion IR and Kernel IR: in the former the benefit of treating 0-dimensional Tensors as scalars makes sense. We can, and should, eliminate this duality of representing scalars during lowering.

@tlemo tlemo merged commit 5215680 into 20_7_6_devel Aug 12, 2020
@tlemo tlemo deleted the code_ir_part4b branch August 12, 2020 19:51
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.

2 participants