Reduce the number of tests inside unit-test and shard it to speed it up.

PiperOrigin-RevId: 228373086
This commit is contained in:
Karim Nosir 2019-01-08 11:59:53 -08:00 committed by TensorFlower Gardener
parent 35279e5c61
commit a849894f02
3 changed files with 8 additions and 6 deletions

View File

@ -641,6 +641,7 @@ cc_test(
srcs = [ srcs = [
"softmax_quantized_test.cc", "softmax_quantized_test.cc",
], ],
shard_count = 3,
deps = [ deps = [
":optimized_base", ":optimized_base",
":quantization_util", ":quantization_util",
@ -657,6 +658,7 @@ cc_test(
srcs = [ srcs = [
"logsoftmax_quantized_test.cc", "logsoftmax_quantized_test.cc",
], ],
shard_count = 3,
tags = [ tags = [
# TODO(b/122242739): Reenable after fixing the flakiness? # TODO(b/122242739): Reenable after fixing the flakiness?
"nomac", "nomac",

View File

@ -225,7 +225,7 @@ bool TryOneSkyscraperLogSoftmax(bool small_depth) {
} }
TEST(TestQuantizedLogSoftmax, UniformLogSoftmaxTests) { TEST(TestQuantizedLogSoftmax, UniformLogSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneUniformLogSoftmax()) { while (!TryOneUniformLogSoftmax()) {
} }
@ -233,7 +233,7 @@ TEST(TestQuantizedLogSoftmax, UniformLogSoftmaxTests) {
} }
TEST(TestQuantizedLogSoftmax, SkyscraperLogSoftmaxTests) { TEST(TestQuantizedLogSoftmax, SkyscraperLogSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneSkyscraperLogSoftmax(false)) { while (!TryOneSkyscraperLogSoftmax(false)) {
} }
@ -241,7 +241,7 @@ TEST(TestQuantizedLogSoftmax, SkyscraperLogSoftmaxTests) {
} }
TEST(TestQuantizedLogSoftmax, SmallSkyscraperLogSoftmaxTests) { TEST(TestQuantizedLogSoftmax, SmallSkyscraperLogSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneSkyscraperLogSoftmax(true)) { while (!TryOneSkyscraperLogSoftmax(true)) {
} }

View File

@ -210,7 +210,7 @@ bool TryOneSkyscraperSoftmax(bool small_depth) {
} }
TEST(TestQuantizedSoftmax, UniformSoftmaxTests) { TEST(TestQuantizedSoftmax, UniformSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneUniformSoftmax()) { while (!TryOneUniformSoftmax()) {
} }
@ -218,7 +218,7 @@ TEST(TestQuantizedSoftmax, UniformSoftmaxTests) {
} }
TEST(TestQuantizedSoftmax, SkyscraperSoftmaxTests) { TEST(TestQuantizedSoftmax, SkyscraperSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneSkyscraperSoftmax(false)) { while (!TryOneSkyscraperSoftmax(false)) {
} }
@ -226,7 +226,7 @@ TEST(TestQuantizedSoftmax, SkyscraperSoftmaxTests) {
} }
TEST(TestQuantizedSoftmax, SmallSkyscraperSoftmaxTests) { TEST(TestQuantizedSoftmax, SmallSkyscraperSoftmaxTests) {
const int kTestsToRun = 1000; const int kTestsToRun = 100;
for (int i = 0; i < kTestsToRun; i++) { for (int i = 0; i < kTestsToRun; i++) {
while (!TryOneSkyscraperSoftmax(true)) { while (!TryOneSkyscraperSoftmax(true)) {
} }