Skip to content

Commit

Permalink
Remove outdated tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
  • Loading branch information
mzient committed Aug 2, 2024
1 parent f657d6b commit 8c6e9e1
Showing 1 changed file with 11 additions and 30 deletions.
41 changes: 11 additions & 30 deletions dali/pipeline/pipeline_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PipelineTest : public DALITest {

// Inputs must be know to the pipeline, i.e. ops
// must be added in a topological ordering.
ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
Expand All @@ -71,25 +71,10 @@ class PipelineTest : public DALITest {
.AddArg("device", "gpu")
.AddOutput("data", "gpu"));

// TODO(michalz): Remove this constraint and the tests. This should be a build-time error,
// with old executor, not a construction-time error.

// For dev1 = "cpu": Inputs to CPU ops must be on CPU,
// we do not auto-copy them from gpu to cpu.
// For dev1 = "gpu": CPU inputs to GPU ops must be on CPU,
// we will not copy them back to the host.
ASSERT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
.AddInput("data", dev2)
.AddOutput("copy_out", dev1)),
std::runtime_error);

if (dev1 == "cpu") {
// Inputs to CPU ops must already exist on CPU,
// we do not auto-copy them from gpu to cpu.
ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
Expand All @@ -109,7 +94,7 @@ class PipelineTest : public DALITest {
.AddOutput("data_3", dev1));

// Outputs must have unique names.
ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
Expand All @@ -125,7 +110,7 @@ class PipelineTest : public DALITest {
}
// All data must have unique names regardless
// of the device they exist on.
ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
Expand All @@ -135,7 +120,7 @@ class PipelineTest : public DALITest {


// CPU ops can only produce CPU outputs
ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", dev1)
Expand Down Expand Up @@ -232,7 +217,7 @@ TYPED_TEST_SUITE(PipelineTest, NumThreads);
TEST_F(PipelineTestOnce, TestInputNotKnown) {
Pipeline pipe(1, 1, 0);

ASSERT_THROW(
EXPECT_THROW(
pipe.AddOperator(
OpSpec("Copy")
.AddArg("device", "cpu")
Expand All @@ -249,10 +234,6 @@ TEST_F(PipelineTestOnce, TestEnforceGPUOpConstraints) {
RunTestEnforce("gpu", "cpu");
}

TEST_F(PipelineTestOnce, TestTriggerToContiguous) {
RunTestTrigger("cpu");
}

TEST_F(PipelineTestOnce, TestTriggerCopyToDevice) {
RunTestTrigger("gpu");
}
Expand Down Expand Up @@ -565,7 +546,7 @@ class PrefetchedPipelineTest : public DALITest {
TEST_F(PrefetchedPipelineTest, SetQueueSizesSeparatedFail) {
Pipeline pipe(this->batch_size_, 4, 0);
// By default we are non-separated execution
ASSERT_THROW(pipe.SetQueueSizes(5, 3), std::runtime_error);
EXPECT_THROW(pipe.SetQueueSizes(5, 3), std::runtime_error);
}

TEST_F(PrefetchedPipelineTest, SetExecutionTypesFailAfterBuild) {
Expand All @@ -578,7 +559,7 @@ TEST_F(PrefetchedPipelineTest, SetExecutionTypesFailAfterBuild) {

vector<std::pair<string, string>> outputs = {{"final_images", "gpu"}};
pipe.Build(outputs);
ASSERT_THROW(pipe.SetExecutionTypes(), std::runtime_error);
EXPECT_THROW(pipe.SetExecutionTypes(), std::runtime_error);
}

TEST_F(PrefetchedPipelineTest, SetQueueSizesFailAfterBuild) {
Expand All @@ -591,7 +572,7 @@ TEST_F(PrefetchedPipelineTest, SetQueueSizesFailAfterBuild) {

vector<std::pair<string, string>> outputs = {{"final_images", "gpu"}};
pipe.Build(outputs);
ASSERT_THROW(pipe.SetQueueSizes(2, 2), std::runtime_error);
EXPECT_THROW(pipe.SetQueueSizes(2, 2), std::runtime_error);
}

TEST_F(PrefetchedPipelineTest, TestFillQueues) {
Expand Down Expand Up @@ -713,7 +694,7 @@ TEST(PipelineTest, AddOperator) {
.AddOutput("data_out1", "cpu"), "second_op", first_op);
EXPECT_EQ(first_op, second_op);

ASSERT_THROW(pipe.AddOperator(OpSpec("Copy"), "another_op", first_op), std::runtime_error);
EXPECT_THROW(pipe.AddOperator(OpSpec("Copy"), "another_op", first_op), std::runtime_error);

int third_op = pipe.AddOperator(OpSpec("DummyOpToAdd")
.AddArg("device", "cpu")
Expand All @@ -728,7 +709,7 @@ TEST(PipelineTest, AddOperator) {
.AddInput("data_in0", "cpu")
.AddOutput("data_out3", "cpu"), "DummyOpNoSync");

ASSERT_THROW(pipe.AddOperator(OpSpec("DummyOpNoSync")
EXPECT_THROW(pipe.AddOperator(OpSpec("DummyOpNoSync")
.AddArg("device", "cpu")
.AddInput("data_in0", "cpu")
.AddOutput("data_out4", "cpu"), "DummyOpNoSync2", disallow_sync_op), std::runtime_error);
Expand Down

0 comments on commit 8c6e9e1

Please sign in to comment.