mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Only run the no-winograd tests once each.
Only run the no-winograd tests on GPU; this also fixes timeouts in asan and msan. PiperOrigin-RevId: 157505317
This commit is contained in:
parent
a6cd4e7358
commit
46db634e50
|
|
@ -1398,9 +1398,14 @@ class Conv2DBenchmark(test.Benchmark):
|
|||
print("conv_stack_iter_%d: %.4f" % (iter_index, wall_time))
|
||||
|
||||
|
||||
def GetInceptionFwdTest(input_size, filter_size, stride, padding):
|
||||
def GetInceptionFwdTest(input_size, filter_size, stride, padding,
|
||||
gpu_only=False):
|
||||
|
||||
def Test(self):
|
||||
if gpu_only and not test.is_gpu_available():
|
||||
tf_logging.info("Skipping InceptionFwd %s", (input_size, filter_size,
|
||||
stride, padding))
|
||||
return
|
||||
tf_logging.info("Testing InceptionFwd %s", (input_size, filter_size, stride,
|
||||
padding))
|
||||
self._CompareFwdValues(input_size, filter_size, [stride, stride], padding)
|
||||
|
|
@ -1409,9 +1414,14 @@ def GetInceptionFwdTest(input_size, filter_size, stride, padding):
|
|||
|
||||
|
||||
def GetInceptionBackInputTest(input_size, filter_size, output_size, stride,
|
||||
padding):
|
||||
padding,
|
||||
gpu_only=False):
|
||||
|
||||
def Test(self):
|
||||
if gpu_only and not test.is_gpu_available():
|
||||
tf_logging.info("Skipping InceptionBackInput %s",
|
||||
(input_size, filter_size, output_size, stride, padding))
|
||||
return
|
||||
tf_logging.info("Testing InceptionBackInput %s",
|
||||
(input_size, filter_size, output_size, stride, padding))
|
||||
self._CompareBackpropInput(input_size, filter_size, output_size,
|
||||
|
|
@ -1421,9 +1431,13 @@ def GetInceptionBackInputTest(input_size, filter_size, output_size, stride,
|
|||
|
||||
|
||||
def GetInceptionBackFilterTest(input_size, filter_size, output_size, strides,
|
||||
padding):
|
||||
padding, gpu_only=False):
|
||||
|
||||
def Test(self):
|
||||
if gpu_only and not test.is_gpu_available():
|
||||
tf_logging.info("Skipping InceptionBackFilter %s",
|
||||
(input_size, filter_size, output_size, strides, padding))
|
||||
return
|
||||
tf_logging.info("Testing InceptionBackFilter %s",
|
||||
(input_size, filter_size, output_size, strides, padding))
|
||||
self._CompareBackFilter(input_size, filter_size, output_size, strides,
|
||||
|
|
@ -1444,19 +1458,21 @@ if __name__ == "__main__":
|
|||
GetInceptionBackFilterTest(input_size_, filter_size_, output_size_,
|
||||
[stride_, stride_], padding_))
|
||||
|
||||
# TODO(b/35359731)
|
||||
# Fwd, BckInput, and BackFilter to test that for certain input parameter
|
||||
# set, winograd nonfused algorithm will be excluded from conv autotune. If
|
||||
# in such case, winograd nonfused algorithm is added as one option of the
|
||||
# conv autotune, and cuDNN version is smaller than 7, the following tests
|
||||
# will fail.
|
||||
ishape = [1, 400, 400, 128]
|
||||
fshape = [3, 3, 128, 768]
|
||||
oshape = [1, 400, 400, 768]
|
||||
setattr(Conv2DTest, "testInceptionFwd_No_Winograd_Nonfused",
|
||||
GetInceptionFwdTest(ishape, fshape, 1, "SAME"))
|
||||
setattr(Conv2DTest, "testInceptionBackInput_No_Winograd_Nonfused",
|
||||
GetInceptionBackInputTest(ishape, fshape, oshape, 1, "SAME"))
|
||||
setattr(Conv2DTest, "testInceptionBackFilter_No_Winograd_Nonfused",
|
||||
GetInceptionBackFilterTest(ishape, fshape, oshape, [1, 1], "SAME"))
|
||||
# TODO(b/35359731)
|
||||
# Fwd, BckInput, and BackFilter to test that for certain input parameter
|
||||
# set, winograd nonfused algorithm will be excluded from conv autotune. If
|
||||
# in such case, winograd nonfused algorithm is added as one option of the
|
||||
# conv autotune, and cuDNN version is smaller than 7, the following tests
|
||||
# will fail.
|
||||
ishape = [1, 400, 400, 128]
|
||||
fshape = [3, 3, 128, 768]
|
||||
oshape = [1, 400, 400, 768]
|
||||
setattr(Conv2DTest, "testInceptionFwd_No_Winograd_Nonfused",
|
||||
GetInceptionFwdTest(ishape, fshape, 1, "SAME", gpu_only=True))
|
||||
setattr(Conv2DTest, "testInceptionBackInput_No_Winograd_Nonfused",
|
||||
GetInceptionBackInputTest(ishape, fshape, oshape, 1, "SAME",
|
||||
gpu_only=True))
|
||||
setattr(Conv2DTest, "testInceptionBackFilter_No_Winograd_Nonfused",
|
||||
GetInceptionBackFilterTest(ishape, fshape, oshape, [1, 1], "SAME",
|
||||
gpu_only=True))
|
||||
test.main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user