profile
viewpoint
Adrian Kuegel akuegel Google Germany GmbH

pull request commenttensorflow/tensorflow

Add multi-algorithm deterministic cuDNN convolutions

I will try to roll forward again.

duncanriach

comment created time in 20 days

pull request commenttensorflow/tensorflow

Add multi-algorithm deterministic cuDNN convolutions

This change had to be rolled back. It seems one of our test targets became flaky with this CL.

duncanriach

comment created time in 22 days

push eventllvm/llvm-project

Adrian

commit sha 5a6eae3dea2342c2a83e4502de43927808f8ca21

[mlir] Ran git-clang-format. Summary: I forgot to ran git-clang-format before committing.

view details

push time in a month

push eventllvm/llvm-project

Adrian Kuegel

commit sha 018b042593f007456b0695421942ec84ec816a30

[mlir] Add loop.parallel, loop.reduce and loop.reduce.return operations. Summary: These operations can be used to specify a loop nest with a body that can contain reductions. The iteration space can be iterated in any order. RFC: https://groups.google.com/a/tensorflow.org/d/topic/mlir/pwtSgiKFPis/discussion Differential Revision: https://reviews.llvm.org/D72394

view details

push time in a month

Pull request review commenttensorflow/tensorflow

Added hlo/lhlo emitters for Abs, Ceil, Convert, Cos, Negate, Remainder, Sign and Tanh ops.

 ENTRY %AddReduce (x: f32[100,10], c: f32[]) -> f32[100] {       )"); } +TEST_F(LhloGenTest, Abs) {+  CompileAndVerifyIr(R"(+HloModule Abs+ENTRY %Abs (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %abs = f32[2,2]{1,0} abs(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @abs(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.abs"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Ceil) {+  CompileAndVerifyIr(R"(+HloModule Ceil+ENTRY %Ceil (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %ceil = f32[2,2]{1,0} ceil(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @ceil(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.ceil"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Convert) {+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> f32[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f32[2,2]) -> f64[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %convert = f64[2,2]{1,0} convert(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f64[2,2]) -> f32[2,2] {+  %val = f64[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(f64[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> i8[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = i8[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i8[2,2]) -> i32[2,2] {+  %val = i8[2,2]{1,0} parameter(0)+  ROOT %convert = i32[2,2]{1,0} convert(i8[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Cos) {+  CompileAndVerifyIr(R"(+HloModule Cos+ENTRY %Cos (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %cos = f32[2,2]{1,0} cos(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @cos(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {

When you fix the HLO above, you need to name this cosine as well.

dfki-jugr

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

Added hlo/lhlo emitters for Abs, Ceil, Convert, Cos, Negate, Remainder, Sign and Tanh ops.

 ENTRY %AddReduce (x: f32[100,10], c: f32[]) -> f32[100] {       )"); } +TEST_F(LhloGenTest, Abs) {+  CompileAndVerifyIr(R"(+HloModule Abs+ENTRY %Abs (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %abs = f32[2,2]{1,0} abs(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @abs(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.abs"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Ceil) {+  CompileAndVerifyIr(R"(+HloModule Ceil+ENTRY %Ceil (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %ceil = f32[2,2]{1,0} ceil(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @ceil(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.ceil"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Convert) {+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> f32[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f32[2,2]) -> f64[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %convert = f64[2,2]{1,0} convert(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f64[2,2]) -> f32[2,2] {+  %val = f64[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(f64[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> i8[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = i8[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i8[2,2]) -> i32[2,2] {+  %val = i8[2,2]{1,0} parameter(0)+  ROOT %convert = i32[2,2]{1,0} convert(i8[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Cos) {+  CompileAndVerifyIr(R"(+HloModule Cos+ENTRY %Cos (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %cos = f32[2,2]{1,0} cos(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @cos(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.cos"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Neg) {+  CompileAndVerifyIr(R"(+HloModule Neg+ENTRY %Neg (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %neg = f32[2,2]{1,0} neg(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @neg(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.neg"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Rem) {+  CompileAndVerifyIr(R"(+HloModule Rem+ENTRY %Rem(x: f32[2,2], y: f32[2,2]) -> f32[2,2] {+  %x = f32[2,2]{1,0} parameter(0)+  %y = f32[2,2]{1,0} parameter(1)+  ROOT %rem = f32[2,2]{1,0} remainder(f32[2,2]{1,0} %x, f32[2,2]{1,0} %y)+})",+                     R"(+;CHECK: func @remainder(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]], %[[ARG2:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.remainder(%[[ARG0]], %[[ARG1]], %[[ARG2]]) : ([[TYPE]], [[TYPE]], [[TYPE]]) -> ()

missing " after remainder: "xla_lhlo.remainder"

dfki-jugr

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

Added hlo/lhlo emitters for Abs, Ceil, Convert, Cos, Negate, Remainder, Sign and Tanh ops.

 ENTRY %AddReduce (x: f32[100,10], c: f32[]) -> f32[100] {       )"); } +TEST_F(LhloGenTest, Abs) {+  CompileAndVerifyIr(R"(+HloModule Abs+ENTRY %Abs (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %abs = f32[2,2]{1,0} abs(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @abs(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.abs"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Ceil) {+  CompileAndVerifyIr(R"(+HloModule Ceil+ENTRY %Ceil (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %ceil = f32[2,2]{1,0} ceil(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @ceil(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.ceil"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Convert) {+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> f32[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f32[2,2]) -> f64[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %convert = f64[2,2]{1,0} convert(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f64[2,2]) -> f32[2,2] {+  %val = f64[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(f64[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> i8[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = i8[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i8[2,2]) -> i32[2,2] {+  %val = i8[2,2]{1,0} parameter(0)+  ROOT %convert = i32[2,2]{1,0} convert(i8[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Cos) {+  CompileAndVerifyIr(R"(+HloModule Cos+ENTRY %Cos (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %cos = f32[2,2]{1,0} cos(f32[2,2]{1,0} %val)

HLO for cos is "cosine" So needs to be cosine(f32[2,2]{1,0} %val)

dfki-jugr

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

Added hlo/lhlo emitters for Abs, Ceil, Convert, Cos, Negate, Remainder, Sign and Tanh ops.

 ENTRY %AddReduce (x: f32[100,10], c: f32[]) -> f32[100] {       )"); } +TEST_F(LhloGenTest, Abs) {+  CompileAndVerifyIr(R"(+HloModule Abs+ENTRY %Abs (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %abs = f32[2,2]{1,0} abs(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @abs(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.abs"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Ceil) {+  CompileAndVerifyIr(R"(+HloModule Ceil+ENTRY %Ceil (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %ceil = f32[2,2]{1,0} ceil(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @ceil(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.ceil"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Convert) {+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> f32[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f32[2,2]) -> f64[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %convert = f64[2,2]{1,0} convert(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: f64[2,2]) -> f32[2,2] {+  %val = f64[2,2]{1,0} parameter(0)+  ROOT %convert = f32[2,2]{1,0} convert(f64[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i32[2,2]) -> i8[2,2] {+  %val = i32[2,2]{1,0} parameter(0)+  ROOT %convert = i8[2,2]{1,0} convert(i32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+  CompileAndVerifyIr(R"(+HloModule Convert+ENTRY %Convert (val: i8[2,2]) -> i32[2,2] {+  %val = i8[2,2]{1,0} parameter(0)+  ROOT %convert = i32[2,2]{1,0} convert(i8[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @convert(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.convert"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Cos) {+  CompileAndVerifyIr(R"(+HloModule Cos+ENTRY %Cos (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %cos = f32[2,2]{1,0} cos(f32[2,2]{1,0} %val)+})",+                     R"(+;CHECK: func @cos(%[[ARG0:.*]]: [[TYPE:.*]], %[[ARG1:.*]]: [[TYPE]]) {+;CHECK:   "xla_lhlo.cos"(%[[ARG0]], %[[ARG1]]) : ([[TYPE]], [[TYPE]]) -> ()+;CHECK: }+      )");+}++TEST_F(LhloGenTest, Neg) {+  CompileAndVerifyIr(R"(+HloModule Neg+ENTRY %Neg (val: f32[2,2]) -> f32[2,2] {+  %val = f32[2,2]{1,0} parameter(0)+  ROOT %neg = f32[2,2]{1,0} neg(f32[2,2]{1,0} %val)

neg -> negate for the HLO op. Similar to the cosine fix, you will also have to adjust func below.

dfki-jugr

comment created time in 2 months

pull request commenttensorflow/tensorflow

Added hlo/lhlo emitters for Abs, Ceil, Convert, Cos, Negate, Remainder, Sign and Tanh ops.

The convert op isn't specified correctly in the dialect, it currently expects to have the same input and output shape. But the whole point of the convert op is to be able to convert the types of shapes. The tests generated this error: FAILED: 'xla_lhlo.convert' op requires all operands to have the same type We will probably merge this request with a few fixes, but without the convert op.

dfki-jugr

comment created time in 2 months

Pull request review commenttensorflow/tensorflow

Add Label for XlaOp

 class XlaOpRegistry {     // operands and not their values.     bool is_metadata_op = false; +    string label;

use std::string please. I know that right now this file uses mostly string instead of std::string, but at some point this will be fixed with a large scale change. But I would prefer if we already start using std::string everywhere when we introduce new variables :)

Agoniii

comment created time in 3 months

Pull request review commenttensorflow/tensorflow

Add Label for XlaOp

 XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::IsMetadataOp() {   return *this; } +XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::Label(+    absl::string_view label) {+  registration_->label = string(label);

std::string please

Agoniii

comment created time in 3 months

issue commenttensorflow/tensorflow

Failed to run the unit test of bonus_tests

The name of the tf_cc_tests rule is never used to create an executable. If you check the definition, it creates executable tests for each of the entries in srcs (their name derived from name of their source file). So you can for example run: bazel --output_user_root=$build_dir test //tensorflow/core/kernels:adjust_contrast_op_test (this is the first of the created tests from the bonus_tests target).

Leslie-Fang

comment created time in 3 months

more