summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/ml
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-12-09 11:55:06 -0800
committerShentubot <shentubot@google.com>2020-12-09 15:56:08 -0800
commit992769c7748d886e7ee1580f0c6cfdfa7ce0eb75 (patch)
treed8cc08dbd93588c7badde91ca1d9dea4ea9edfd7 /test/benchmarks/ml
parent45619ded38b9c9f24b2b7ade812fd903e09ac1b9 (diff)
Add tensorflow, ffmpeg, and redis jobs.
PiperOrigin-RevId: 346603153
Diffstat (limited to 'test/benchmarks/ml')
-rw-r--r--test/benchmarks/ml/BUILD5
-rw-r--r--test/benchmarks/ml/ml.go15
-rw-r--r--test/benchmarks/ml/tensorflow_test.go12
3 files changed, 12 insertions, 20 deletions
diff --git a/test/benchmarks/ml/BUILD b/test/benchmarks/ml/BUILD
index 02ff6966f..285ec35d9 100644
--- a/test/benchmarks/ml/BUILD
+++ b/test/benchmarks/ml/BUILD
@@ -7,12 +7,11 @@ go_library(
name = "ml",
testonly = 1,
srcs = ["ml.go"],
- deps = ["//test/benchmarks/harness"],
)
benchmark_test(
- name = "ml_test",
- size = "large",
+ name = "tensorflow_test",
+ size = "enormous",
srcs = ["tensorflow_test.go"],
library = ":ml",
visibility = ["//:sandbox"],
diff --git a/test/benchmarks/ml/ml.go b/test/benchmarks/ml/ml.go
index 13282d7bb..d5fc5b7da 100644
--- a/test/benchmarks/ml/ml.go
+++ b/test/benchmarks/ml/ml.go
@@ -14,18 +14,3 @@
// Package ml holds benchmarks around machine learning performance.
package ml
-
-import (
- "os"
- "testing"
-
- "gvisor.dev/gvisor/test/benchmarks/harness"
-)
-
-var h harness.Harness
-
-// TestMain is the main method for package ml.
-func TestMain(m *testing.M) {
- h.Init()
- os.Exit(m.Run())
-}
diff --git a/test/benchmarks/ml/tensorflow_test.go b/test/benchmarks/ml/tensorflow_test.go
index f7746897d..a55329d82 100644
--- a/test/benchmarks/ml/tensorflow_test.go
+++ b/test/benchmarks/ml/tensorflow_test.go
@@ -15,12 +15,15 @@ package ml
import (
"context"
+ "os"
"testing"
"gvisor.dev/gvisor/pkg/test/dockerutil"
"gvisor.dev/gvisor/test/benchmarks/harness"
)
+var h harness.Harness
+
// BenchmarkTensorflow runs workloads from a TensorFlow tutorial.
// See: https://github.com/aymericdamien/TensorFlow-Examples
func BenchmarkTensorflow(b *testing.B) {
@@ -44,12 +47,12 @@ func BenchmarkTensorflow(b *testing.B) {
for name, workload := range workloads {
b.Run(name, func(b *testing.B) {
ctx := context.Background()
- container := machine.GetContainer(ctx, b)
- defer container.CleanUp(ctx)
b.ResetTimer()
for i := 0; i < b.N; i++ {
b.StopTimer()
+ container := machine.GetContainer(ctx, b)
+ defer container.CleanUp(ctx)
if err := harness.DropCaches(machine); err != nil {
b.Skipf("failed to drop caches: %v. You probably need root.", err)
}
@@ -67,3 +70,8 @@ func BenchmarkTensorflow(b *testing.B) {
}
}
+
+func TestMain(m *testing.M) {
+ h.Init()
+ os.Exit(m.Run())
+}