Fix for runtime error of ROCm build

See https://github.com/tensorflow/tensorflow/issues/34082#issuecomment-552493262

Close https://github.com/tensorflow/tensorflow/pull/34177
Fixes https://github.com/tensorflow/tensorflow/issues/34082

The preconfigured toolchain is updated by:
tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3_opt-gcc5-rocm

PiperOrigin-RevId: 279915064
Change-Id: I41396f8b47624ccc3ebdbb0889512a008c9b827a

[ROCm] Fix for the broken ROCm CSB.

The following commit breaks the --config=rocm build

bf9c196f37

The above commit adds support for complex type in the optimizers. Complex types are not supported on the ROCm platform. Support for it needs to be excluded on the ROCm platform, and that is what this "fix" does.

[ROCm] Fix for the broken ROCm CSB.

The following commit breaks the --config=rocm build

f72695e171

The above commit adds a couple of subtests that require support for the `StatefulUnirformFullInt` Op on the GPU. Currently ROCm does not support that Op on the GPU, which leads to those subtests failing.

The "fix" is to skip those subtests on the ROCm platform.

[ROCm] Fix for the broken ROCm CSB.

The following commit breaks the `--config=rocm` build

ab6524320e

The commit above introduces the test "test_opt_einsum_cached" in //tensorflow/python:special_math_ops_test_gpu

The order of execution of other tests within that file can dictate whether or not the newly added test will pass or fail.
The failure (caught byt he ROCm Nighty CSB run) does not seem specific to the ROCm platform.

The "fix" is to explicitly clear the lru_cache of the routine "special_math_ops._get_opt_einsum_contract_path" (before running the test) to gurantee that the test will pass, irrespective of the order in which it is run relative to the other tests.

[ROCm] Fix for the broken ROCm CSB.

The following commit breaks the `--config=rocm` build

c8b0100b9a

The commit above introduces the test "testFusedBatchNormGradsInference" in //tensorflow/python/eager:forwardprop_test_gpu

We are still working towards analysing the cause of the failure and potentially coming up with the fix. In meantime, the change in this commit is to skip the failing subtest on the ROCm platform. This is so that we can get he ROCm Nightly CSB build passing again.

[ROCm] Update ROCm CI builds to use ROCm 2.8

This PR/commit updates the Dockerfile.rocm file to use ROCm version 2.8 (from the current 2.6).

Switching to ROCm version 2.8, also adds to the requirement of specifying a couple of extra option to the `docker run` command.
That change is also a part of this PR/commit.
This commit is contained in:
sunway513 2019-11-12 02:00:24 -08:00
parent b5d0f01e9e
commit eb7b125276
13 changed files with 124 additions and 36 deletions

View File

@ -670,7 +670,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -682,7 +684,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -849,7 +853,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -861,7 +867,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -1340,7 +1348,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -1352,7 +1362,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -1456,7 +1468,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -1468,7 +1482,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -2957,7 +2973,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -2969,7 +2987,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -3195,7 +3215,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -3207,7 +3229,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -3337,7 +3361,9 @@ DECLARE_GPU_SPEC(float, int32);
DECLARE_GPU_SPEC(float, int64);
DECLARE_GPU_SPEC(double, int32);
DECLARE_GPU_SPEC(double, int64);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64, int32);
DECLARE_GPU_SPEC(complex64, int64);
@ -3355,7 +3381,9 @@ DECLARE_GPU_SPEC(complex128, int64);
REGISTER_GPU_KERNELS(Eigen::half);
REGISTER_GPU_KERNELS(float);
REGISTER_GPU_KERNELS(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_GPU_KERNELS(complex64);
REGISTER_GPU_KERNELS(complex128);
@ -3622,7 +3650,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -3634,7 +3664,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);
@ -4151,7 +4183,9 @@ namespace functor {
DECLARE_GPU_SPEC(Eigen::half);
DECLARE_GPU_SPEC(float);
DECLARE_GPU_SPEC(double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
DECLARE_GPU_SPEC(complex64);
DECLARE_GPU_SPEC(complex128);
@ -4163,7 +4197,9 @@ DECLARE_GPU_SPEC(complex128);
REGISTER_KERNELS(GPU, Eigen::half);
REGISTER_KERNELS(GPU, float);
REGISTER_KERNELS(GPU, double);
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
REGISTER_KERNELS(GPU, complex64);
REGISTER_KERNELS(GPU, complex128);

View File

@ -524,7 +524,9 @@ struct ApplyPowerSign<GPUDevice, T> {
template struct functor::ApplyGradientDescent<GPUDevice, Eigen::half>;
template struct functor::ApplyGradientDescent<GPUDevice, float>;
template struct functor::ApplyGradientDescent<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyGradientDescent<GPUDevice, complex64>;
template struct functor::ApplyGradientDescent<GPUDevice, complex128>;
@ -534,7 +536,9 @@ template struct functor::ApplyGradientDescent<GPUDevice, complex128>;
template struct functor::ApplyAdagrad<GPUDevice, Eigen::half>;
template struct functor::ApplyAdagrad<GPUDevice, float>;
template struct functor::ApplyAdagrad<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyAdagrad<GPUDevice, complex64>;
template struct functor::ApplyAdagrad<GPUDevice, complex128>;
@ -544,7 +548,9 @@ template struct functor::ApplyAdagrad<GPUDevice, complex128>;
template struct functor::ApplyAdagradV2<GPUDevice, Eigen::half>;
template struct functor::ApplyAdagradV2<GPUDevice, float>;
template struct functor::ApplyAdagradV2<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyAdagradV2<GPUDevice, complex64>;
template struct functor::ApplyAdagradV2<GPUDevice, complex128>;
@ -554,7 +560,9 @@ template struct functor::ApplyAdagradV2<GPUDevice, complex128>;
template struct functor::ApplyAdadelta<GPUDevice, Eigen::half>;
template struct functor::ApplyAdadelta<GPUDevice, float>;
template struct functor::ApplyAdadelta<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyAdadelta<GPUDevice, complex64>;
template struct functor::ApplyAdadelta<GPUDevice, complex128>;
@ -572,7 +580,9 @@ template struct functor::ApplyFtrlV2<GPUDevice, double>;
template struct functor::ApplyMomentum<GPUDevice, Eigen::half>;
template struct functor::ApplyMomentum<GPUDevice, float>;
template struct functor::ApplyMomentum<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyMomentum<GPUDevice, complex64>;
template struct functor::ApplyMomentum<GPUDevice, complex128>;
@ -582,7 +592,9 @@ template struct functor::ApplyMomentum<GPUDevice, complex128>;
template struct functor::ApplyKerasMomentum<GPUDevice, Eigen::half>;
template struct functor::ApplyKerasMomentum<GPUDevice, float>;
template struct functor::ApplyKerasMomentum<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyKerasMomentum<GPUDevice, complex64>;
template struct functor::ApplyKerasMomentum<GPUDevice, complex128>;
@ -597,7 +609,9 @@ template struct functor::SparseApplyKerasMomentum<GPUDevice, float, int32>;
template struct functor::SparseApplyKerasMomentum<GPUDevice, float, int64>;
template struct functor::SparseApplyKerasMomentum<GPUDevice, double, int32>;
template struct functor::SparseApplyKerasMomentum<GPUDevice, double, int64>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::SparseApplyKerasMomentum<GPUDevice, complex64, int32>;
template struct functor::SparseApplyKerasMomentum<GPUDevice, complex64, int64>;
@ -609,7 +623,9 @@ template struct functor::SparseApplyKerasMomentum<GPUDevice, complex128, int64>;
template struct functor::ApplyAdam<GPUDevice, Eigen::half>;
template struct functor::ApplyAdam<GPUDevice, float>;
template struct functor::ApplyAdam<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyAdam<GPUDevice, complex64>;
template struct functor::ApplyAdam<GPUDevice, complex128>;
@ -627,7 +643,9 @@ template struct functor::ApplyAdaMax<GPUDevice, double>;
template struct functor::ApplyRMSProp<GPUDevice, Eigen::half>;
template struct functor::ApplyRMSProp<GPUDevice, float>;
template struct functor::ApplyRMSProp<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyRMSProp<GPUDevice, complex64>;
template struct functor::ApplyRMSProp<GPUDevice, complex128>;
@ -637,7 +655,9 @@ template struct functor::ApplyRMSProp<GPUDevice, complex128>;
template struct functor::ApplyCenteredRMSProp<GPUDevice, Eigen::half>;
template struct functor::ApplyCenteredRMSProp<GPUDevice, float>;
template struct functor::ApplyCenteredRMSProp<GPUDevice, double>;
#ifndef TENSORFLOW_USE_NVCC // TODO(b/143684500): Eigen to support complex sqrt
#if !defined(TENSORFLOW_USE_NVCC) && \
!defined(TENSORFLOW_USE_ROCM) // TODO(b/143684500): Eigen to support
// complex sqrt
#ifndef PLATFORM_WINDOWS
template struct functor::ApplyCenteredRMSProp<GPUDevice, complex64>;
template struct functor::ApplyCenteredRMSProp<GPUDevice, complex128>;

View File

@ -469,6 +469,13 @@ class ForwardpropTest(test.TestCase, parameterized.TestCase):
atol=1e-3)
def testFusedBatchNormGradsInference(self):
if test.is_built_with_rocm():
# This test was addeded recently and has been failing on the ROCm
# platform, since it was added.
# TODO(rocm): do root cause analysis of test failure and fix it.
self.skipTest("Test fails on ROCm platform, needs further analysis")
x_shape = [4, 10, 10, 2]
increment = 3. / math_ops.reduce_prod(
constant_op.constant(x_shape, dtype=dtypes.float32))

View File

@ -187,6 +187,11 @@ class RandomCropTest(keras_parameterized.TestCase):
self._run_test(expected_height, expected_width)
def test_training_with_mock(self):
if test.is_built_with_rocm():
# TODO(rocm):
# re-enable this test once ROCm adds support for
# the StatefulUniformFullInt Op (on the GPU)
self.skipTest("Feature not supported on ROCm")
np.random.seed(1337)
height, width = 3, 4
height_offset = np.random.randint(low=0, high=3)
@ -207,6 +212,11 @@ class RandomCropTest(keras_parameterized.TestCase):
('random_crop_4_by_6', 4, 6),
('random_crop_3_by_2', 3, 2))
def test_random_crop_output_shape(self, expected_height, expected_width):
if test.is_built_with_rocm():
# TODO(rocm):
# re-enable this test once ROCm adds support for
# the StatefulUniformFullInt Op (on the GPU)
self.skipTest("Feature not supported on ROCm")
with CustomObjectScope({'RandomCrop': image_preprocessing.RandomCrop}):
self._run_test(expected_height, expected_width)

View File

@ -35,7 +35,8 @@ from tensorflow.python.platform import test
_DATA_TYPES = [dtypes.half, dtypes.float32, dtypes.float64]
# TODO(b/143684500): Eigen to support complex sqrt
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows":
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows" \
and not test.is_built_with_rocm():
_DATA_TYPES += [dtypes.complex64, dtypes.complex128]

View File

@ -38,7 +38,8 @@ from tensorflow.python.platform import test
_DATA_TYPES = [dtypes.half, dtypes.float32, dtypes.float64]
# TODO(b/143684500): Eigen to support complex sqrt
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows":
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows" \
and not test.is_built_with_rocm():
_DATA_TYPES += [dtypes.complex64, dtypes.complex128]

View File

@ -41,7 +41,8 @@ from tensorflow.python.platform import test
_DATA_TYPES = [dtypes.half, dtypes.float32, dtypes.float64]
# TODO(b/143684500): Eigen to support complex sqrt
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows":
if not test_util.IsBuiltWithNvcc() and platform.system() != "Windows" \
and not test.is_built_with_rocm():
_DATA_TYPES += [dtypes.complex64, dtypes.complex128]
_TEST_PARAM_VALUES = [

View File

@ -436,6 +436,16 @@ class EinsumTest(test.TestCase):
with test.mock.patch.object(
opt_einsum, 'contract_path',
wraps=opt_einsum.contract_path) as mock_contract_path:
# explicitly clear the lru_cache contents for the method
# special_math_ops.get_opt_einsum_contract_path
# We need to do this because other tests in this file invoke that method
# with the same input args (as input_1 and input_2 above), and if
# those tests run before this test, then the call_count for the method
# mock_contract_path will not increment.
if six.PY3:
special_math_ops._get_opt_einsum_contract_path.cache_clear()
self.assertEqual(mock_contract_path.call_count, 0)
self._check(*input_1)
self.assertEqual(mock_contract_path.call_count, 1)

View File

@ -3,7 +3,7 @@
FROM ubuntu:xenial
MAINTAINER Jeff Poznanovic <jeffrey.poznanovic@amd.com>
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/2.6/
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/2.8.0/
ARG ROCM_PATH=/opt/rocm
ENV DEBIAN_FRONTEND noninteractive

View File

@ -109,7 +109,8 @@ if [ "${IMAGE_TYPE}" == "gpu" ]; then
libs=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | xargs -I{} echo '-v {}:{}')
GPU_EXTRA_PARAMS="${devices} ${libs}"
elif [ "${IMAGE_TYPE}" == "rocm" ]; then
ROCM_EXTRA_PARAMS="--device=/dev/kfd --device=/dev/dri --group-add video"
ROCM_EXTRA_PARAMS="--device=/dev/kfd --device=/dev/dri --group-add video \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined --shm-size 16G"
else
GPU_EXTRA_PARAMS=""
ROCM_EXTRA_PARAMS=""

View File

@ -111,7 +111,8 @@ fi
# Add extra params for rocm devices and libraries for ROCm container.
if [[ "${CONTAINER_TYPE}" == "rocm" ]]; then
ROCM_EXTRA_PARAMS="--device=/dev/kfd --device=/dev/dri --group-add video"
ROCM_EXTRA_PARAMS="--device=/dev/kfd --device=/dev/dri --group-add video \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined --shm-size 16G"
else
ROCM_EXTRA_PARAMS=""
fi

View File

@ -90,7 +90,7 @@ cc_toolchain_config(
"-lm",
],
link_libs = [],
opt_link_flags = ["-Wl,--gc-sections"],
opt_link_flags = [],
unfiltered_compile_flags = [
"-fno-canonical-system-headers",
"-Wno-builtin-macro-redefined",

View File

@ -122,7 +122,7 @@ cc_toolchain_config(
"-ffunction-sections",
"-fdata-sections",
],
opt_link_flags = ["-Wl,--gc-sections"],
opt_link_flags = [],
supports_start_end_lib = True,
target_libc = "local",
target_system_name = "local",