Gpytorch: [Bug] Upstream changes to tensor comparisons breaks things

Created on 1 Aug 2019  路  17Comments  路  Source: cornellius-gp/gpytorch

馃悰 Bug

After https://github.com/pytorch/pytorch/pull/21113 a bunch of tests are failing b/c of the change in tensor comparison behavior (return type from uint8 to bool). Creating this issue to track the fix.

bug compatibility

All 17 comments

It appears most of this happens in batch_symeig where we do 1 - mask - will put up a fix shortly.

@Balandat, we have introduced '~' operator for masks to fix this issue. You should be able to just replace '1-mask' with '~mask'

Sure that works. There are a few other places in the code where this causes failures, but they should be easy enough to fix.

Fixed by #823

Ok of course there are now a bunch more warnings emitted when using uint8 on pytorch master, so all the tests that count the warnings fail there ...

It's worse than that, the change actually breaks the jit script code for _jit_linear_cg_updates. So the correct thing is to use bool everywhere, and fix the tests that count the warnings...

Won't be able to fix all this properly right now, deferring to the above issue.

@Balandat I'll take a look once the nightly build comes out and I can repro the errors without having to build pytorch from source.

@jacobrgardner sounds good, if you base this on #825 at least you won't have to deal with the warnings.

Fwiw, here's a notebook that shows the failure (commented out the jit decorators locally).

It only happens when broadcasting. @izdeby, maybe broadcasting semantics for bool tensors are different?

test_broadcasting_issues.ipynb.txt

@Balandat, what exactly failed in broadcasting for you? there shouldn't be any difference in broadcasting semantics for bool tensors

@izdeby looks like this is a different issue related to changing sizes in addcmul, see #827

For now do we think we could define like a gpytorch.bool type to be torch.bool if that will work (i.e. we are on master), and torch.uint8 otherwise?

We could similarly define gpytorch.not to do ~ and 1 - ... respectively

So ~ will work even with uint8, so there is no need for that. But we can do the gpytorch.bool thing to avoid the mass of warnings

made this change in the latest update to #827

Reasonably fixed for now via #827

Was this page helpful?
0 / 5 - 0 ratings