Enable gating & add simple gating test
Resolves: RHEL-52114
This commit is contained in:
parent
aeadd68cf5
commit
a98ebdff7a
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
7
gating.yaml
Normal file
7
gating.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
--- !Policy
|
||||
|
||||
product_versions:
|
||||
- rhel-10
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
7
gating/main.fmf
Normal file
7
gating/main.fmf
Normal file
@ -0,0 +1,7 @@
|
||||
summary: Verify that FlexiBLAS swaps BLAS libraries by checking if OpenBLAS is considerably faster than Netlib
|
||||
test: ./test.sh
|
||||
require:
|
||||
- python3-numpy
|
||||
- flexiblas
|
||||
duration: 5m
|
||||
|
||||
39
gating/test.sh
Executable file
39
gating/test.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh -eux
|
||||
# Test to verify that FlexiBLAS swaps BLAS libraries
|
||||
# by checking if OpenBLAS is at least 3 times faster than Netlib BLAS
|
||||
|
||||
PYTHON_SCRIPT=$(cat <<EOF
|
||||
import numpy as np
|
||||
import time
|
||||
|
||||
size = 2000
|
||||
a = np.random.rand(size, size)
|
||||
b = np.random.rand(size, size)
|
||||
|
||||
start_time = time.time()
|
||||
np.dot(a, b)
|
||||
end_time = time.time()
|
||||
|
||||
print(end_time - start_time)
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "Testing with NETLIB"
|
||||
netlib_time=$(FLEXIBLAS="NETLIB" python3 -c "$PYTHON_SCRIPT")
|
||||
echo "Time taken with NETLIB: $netlib_time seconds"
|
||||
echo "-----------------------------------"
|
||||
|
||||
echo "Testing with OPENBLAS-OPENMP"
|
||||
openblas_time=$(FLEXIBLAS="OPENBLAS-OPENMP" python3 -c "$PYTHON_SCRIPT")
|
||||
echo "Time taken with OPENBLAS-OPENMP: $openblas_time seconds"
|
||||
echo "-----------------------------------"
|
||||
|
||||
# Verify that OpenBLAS is at least 3 times faster than Netlib BLAS
|
||||
if (( $(echo "$netlib_time >= 3 * $openblas_time" | bc -l) )); then
|
||||
echo "Test passed: OpenBLAS is at least 3 times faster than Netlib BLAS."
|
||||
exit 0
|
||||
else
|
||||
echo "Test failed: OpenBLAS is not at least 3 times faster than Netlib BLAS. Flexiblas might not have swapped the libraries."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
4
plans/main.fmf
Normal file
4
plans/main.fmf
Normal file
@ -0,0 +1,4 @@
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
Loading…
Reference in New Issue
Block a user