tensorflow / mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1.74k stars 258 forks source link

linalg_integration_test.mlir uses undefined attribute #231

Closed bondhugula closed 4 years ago

bondhugula commented 4 years ago

https://github.com/tensorflow/mlir/blob/c902682b0ee21c7b91228df2bfe252ee14bc26ae/test/mlir-cpu-runner/linalg_integration_test.mlir#L17

is adding an alignment attribute that is not defined on the op: https://github.com/tensorflow/mlir/blob/c902682b0ee21c7b91228df2bfe252ee14bc26ae/include/mlir/Dialect/StandardOps/Ops.td#L170

Adding the attribute to the op (such as with 'Confined<OptionalAttr, [IntMinValue<0>]>:$alignment') yields test failures like these that provide no clues!

FAIL: MLIR :: mlir-cpu-runner/linalg_integration_test.mlir (325 of 354)
******************** TEST 'MLIR :: mlir-cpu-runner/linalg_integration_test.mlir' FAILED ********************
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 804, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 757, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 408, in _handle_results
    cache[job]._set(i, obj)
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 577, in _set
    self._callback(self._value)
  File "/home/uday/llvm-project/llvm/utils/lit/lit/run.py", line 125, in <lambda>
    callback=lambda r, t=test: self._process_result(t, r))
  File "/home/uday/llvm-project/llvm/utils/lit/lit/run.py", line 79, in _process_result
    self.progress_callback(test)
  File "/home/uday/llvm-project/llvm/utils/lit/lit/main.py", line 178, in progress_callback
    display.update(test)
  File "/home/uday/llvm-project/llvm/utils/lit/lit/display.py", line 53, in update
    self.print_result(test)
  File "/home/uday/llvm-project/llvm/utils/lit/lit/display.py", line 90, in print_result
    out = out.decode(encoding=sys.stdout.encoding)
  File "/usr/lib64/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb1 in position 3519: invalid start byte
bondhugula commented 4 years ago

The above was from a release build - so scratch that. The only issue is the missing attribute on the op here - adding it would help with verification and preserving during transformation and lowering.

nicolasvasilache commented 4 years ago

Can you please try again? The CL that adds alignment to alloc should help.

On Sat, Nov 16, 2019 at 11:45 AM jpienaar notifications@github.com wrote:

Assigned #231 https://github.com/tensorflow/mlir/issues/231 to @nicolasvasilache https://github.com/nicolasvasilache.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/mlir/issues/231?email_source=notifications&email_token=ACNNU5FFJOETQ2NKDLDUTTLQUAPUNA5CNFSM4JLQNUSKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOU4XPTBQ#event-2804873606, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNNU5HN5VVHZ4KMIOUPVU3QUAPUNANCNFSM4JLQNUSA .

-- N

bondhugula commented 4 years ago

I now notice that the attribute has been added on AllocOp.