Skip to content

Commit e2bfd92

Browse files
Chong Gaores-life
authored andcommitted
Test GPU allocation across parallel workers
Signed-off-by: Chong Gao <chongg@nvidia.com>
1 parent eed5f5f commit e2bfd92

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/src/test/scala/com/nvidia/spark/rapids/ParallelUnitTestRunnerSuite.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ class ParallelUnitTestRunnerSuite extends AnyFunSuite {
111111
assert(minimum === 0.25)
112112
}
113113

114+
test("GPU allocation fractions are divided across workers") {
115+
val (allocation, maximum, minimum) =
116+
ParallelUnitTestRunner.perWorkerGpuAllocations(4, 1.0, 1.0, 0.25)
117+
118+
assert(math.abs(allocation - 0.2) < 1e-10)
119+
assert(math.abs(maximum - 0.2) < 1e-10)
120+
assert(minimum === 0.0625)
121+
}
122+
114123
test("suites are ordered by fully qualified name") {
115124
val suites = Seq("example.SuiteZ", "another.SuiteB", "another.SuiteA")
116125

0 commit comments

Comments
 (0)