Skip to content

Conversation

@dan-garvey
Copy link
Collaborator

Adds a check for optional type, and covers the case where end < start. Thanks to @cathyzhyi for pointing these out.

@silvasean
Copy link
Contributor

silvasean commented Dec 13, 2021

Please add previously-failing tests which now pass to demonstrate the new functionality :)

@dan-garvey
Copy link
Collaborator Author

Unfortunately this case goes from xfail to xfail, as it results in 0 size tensors which still crash the refbackend #448

Do we want to create tests for xfail on Optional type coverage?

@silvasean
Copy link
Contributor

is there a way to hack around that temporarily? for example, to cat the zero size tensor with a tensor of size 1 so the final tensor is of size 1?

@dan-garvey
Copy link
Collaborator Author

Have they tried cloning you yet

Copy link
Contributor

@silvasean silvasean left a comment

Choose a reason for hiding this comment

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

Go ahead and merge after addressing nit :)

])
def forward(self, x):
return x[5:5, 3:3, -1:]
#TODO: remove hacky cat tensor once refbackend supports 0 size dim
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: space before TODO

@dan-garvey dan-garvey merged commit 396ab35 into llvm:main Dec 15, 2021
qedawkins pushed a commit to nod-ai/torch-mlir that referenced this pull request Oct 3, 2022
* Add krnl.load and knrl.store

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Lower krnl load/store to affine load/store or std load/store

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Edit optimize-memory-pools pass to adapt with the new changes

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Use krnl load/store in onnx-to-krnl pass

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Edit lit tests

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Revise createKrnlLoad/Store

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Add lit tests for krnl.load/store lowering

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Edit lit tests for loop op

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Remaining affine.load in IndexExpr

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Mark std.load/store and affine.load/store illegal at the krnl level

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

* Use krnl.load/store in the LRN lowering

Signed-off-by: Tung D. Le <tung@jp.ibm.com>

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
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