Skip to content

Commit

Permalink
[MLIR][KernelGen] Enable JIT-compiled GPU kernels for min and max
Browse files Browse the repository at this point in the history
Enable the JIT-compiled GPU kernels for the following ops and dtypes:
  - Maximum i8, ui16, ui32, ui64
  - Minimum i8, ui16, ui32, ui64

PiperOrigin-RevId: 407580629
Change-Id: I4ec68881a2b29779697e98a200e216b23a5fcbf0
  • Loading branch information
frgossen authored and tensorflower-gardener committed Nov 4, 2021
1 parent 89fc3d2 commit 61e4fd4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions tensorflow/core/kernels/mlir_generated/gpu_binary_ops_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,6 @@ GENERATE_DEFAULT_TESTS(Maximum, /*test_name=*/UInt8, uint8_t, uint8_t,
test::OpsTestConfig().ExpectStrictlyEqual())

/// Test the experimental JIT-compiled kernels.
#if defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) && \
defined(MLIR_GENERATED_EXPERIMENTAL_KERNELS_ENABLED)
GENERATE_DEFAULT_TESTS(Maximum, /*test_name=*/Int8, int8_t, int8_t,
baseline_maximum,
test::OpsTestConfig().ExpectStrictlyEqual())
Expand All @@ -825,7 +823,6 @@ GENERATE_DEFAULT_TESTS(Maximum, /*test_name=*/UInt32, uint32_t, uint32_t,
GENERATE_DEFAULT_TESTS(Maximum, /*test_name=*/UInt64, uint64_t, uint64_t,
baseline_maximum,
test::OpsTestConfig().ExpectStrictlyEqual())
#endif

/// Test `tf.Minmum`.

Expand Down Expand Up @@ -854,8 +851,6 @@ GENERATE_DEFAULT_TESTS(Minimum, /*test_name=*/UInt8, uint8_t, uint8_t,
test::OpsTestConfig().ExpectStrictlyEqual())

/// Test the experimental JIT-compiled kernels.
#if defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) && \
defined(MLIR_GENERATED_EXPERIMENTAL_KERNELS_ENABLED)
GENERATE_DEFAULT_TESTS(Minimum, /*test_name=*/Int8, int8_t, int8_t,
baseline_minimum,
test::OpsTestConfig().ExpectStrictlyEqual())
Expand All @@ -869,7 +864,6 @@ GENERATE_DEFAULT_TESTS(Minimum, /*test_name=*/UInt32, uint32_t, uint32_t,
GENERATE_DEFAULT_TESTS(Minimum, /*test_name=*/UInt64, uint64_t, uint64_t,
baseline_minimum,
test::OpsTestConfig().ExpectStrictlyEqual())
#endif

/// Test `tf.Mul`.

Expand Down
2 changes: 0 additions & 2 deletions tensorflow/core/kernels/mlir_generated/gpu_op_maximum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ GENERATE_AND_REGISTER_BINARY_GPU_KERNEL(Maximum, DT_INT64);
GENERATE_AND_REGISTER_BINARY_GPU_KERNEL(Maximum, DT_UINT8);

// These kernels are JIT-compiled.
#if defined(MLIR_GENERATED_EXPERIMENTAL_KERNELS_ENABLED)
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Maximum, DT_INT8);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Maximum, DT_UINT16);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Maximum, DT_UINT32);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Maximum, DT_UINT64);
#endif

} // namespace tensorflow
2 changes: 0 additions & 2 deletions tensorflow/core/kernels/mlir_generated/gpu_op_minimum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ GENERATE_AND_REGISTER_BINARY_GPU_KERNEL(Minimum, DT_INT64);
GENERATE_AND_REGISTER_BINARY_GPU_KERNEL(Minimum, DT_UINT8);

// These kernels are JIT-compiled.
#if defined(MLIR_GENERATED_EXPERIMENTAL_KERNELS_ENABLED)
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Minimum, DT_INT8);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Minimum, DT_UINT16);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Minimum, DT_UINT32);
GENERATE_AND_REGISTER_BINARY_JIT_GPU_KERNEL(Minimum, DT_UINT64);
#endif

} // namespace tensorflow

0 comments on commit 61e4fd4

Please sign in to comment.