xla icon indicating copy to clipboard operation
xla copied to clipboard

Extend `nonzero` to provide dynamism to its `torch::lazy::shape` member

Open miladm opened this issue 3 years ago • 1 comments

miladm avatar Jul 14 '22 08:07 miladm

The latest commit succeeds at passing the nonzero -> expand unit test in c++. Below is the output of test/cpp/build/test_ptxla --gtest_filter=AtenXlaTensorTest.TestExpandSymInt

*Ran nonzero
added the node
*is test symbolic: 1
*xla_y.sym_sizes()[0] SymInt(-9223232436526075024) is_symbolic: 1
*xla_y.sym_sizes()[1] SymInt(1) is_symbolic: 0
*xla_a
*Ran expand_symint
*xla_b.sym_sizes()[0]: added the node SymInt(-9223372036768888736) is_symbolic: 1
*xla_b.sym_sizes()[1]: SymInt(3) is_symbolic: 0
*xla_b.sym_sizes()[2]: SymInt(4) is_symbolic: 0
In SetDimensionSizes
In SetDimensionSizes loop 0                     <-- SetDimensionSize is not set correctly
In SetDimensionSizes loop 1
In SetDimensionSizes loop 2
*Ran AllClose
*Ran ExpectCounterNotChanged
*Ran ExpectCounterChanged
[       OK ] AtenXlaTensorTest.TestExpandSymInt (274 ms)
[----------] 1 test from AtenXlaTensorTest (274 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (274 ms total)
[  PASSED  ] 1 test.

This is great.

Next issues to resolve:

  • https://github.com/pytorch/xla/issues/3906
  • Dynamic Python tests fail (even after I hacked my way around https://github.com/pytorch/xla/issues/3906)

CC @JackCaoG @Krovatkin

miladm avatar Aug 18 '22 23:08 miladm