Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add kserve gpu tests #3283

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a check to validate gpu mem usage
  • Loading branch information
rohithkrn committed Aug 12, 2024
commit 82270d6b4cd1369f934fa8af7fbb0ec8107d180e
4 changes: 2 additions & 2 deletions .github/workflows/kserve_gpu_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: KServe CPU Nightly Tests
name: KServe GPU Nightly Tests

on:
workflow_dispatch:
Expand All @@ -7,7 +7,7 @@ on:
- cron: '15 5 * * *'

jobs:
kserve-cpu-tests:
kserve-gpu-tests:
# runs-on: [self-hosted, regression-test-gpu
steps:
rohithkrn marked this conversation as resolved.
Show resolved Hide resolved
- name: Clean up previous run
Expand Down
23 changes: 23 additions & 0 deletions kubernetes/kserve/tests/scripts/test_mnist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ else
TEST_GPU="false"
fi

function validate_gpu_memory_usage() {
echo "Validating GPU memory usage..."
memory_usage=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)

# Check if any GPU memory usage is above zero
memory_above_zero=false
while IFS= read -r usage; do
if [ "$usage" -gt 0 ]; then
memory_above_zero=true
break
fi
done <<< "$memory_usage"

if [ "$memory_above_zero" = true ]; then
echo "GPU memory usage is greater than 0, proceeding with the tests."
else
echo "✘ GPU memory usage is 0, indicating no GPU activity. Test failed."
delete_minikube_cluster
exit 1
fi
}

function start_minikube_cluster() {
echo "Removing any previous Kubernetes cluster"
minikube delete
Expand Down Expand Up @@ -182,6 +204,7 @@ install_kserve
echo "MNIST KServe V2 test begin"
if [ "$TEST_GPU" = "true" ]; then
deploy_cluster "kubernetes/kserve/tests/configs/mnist_v2_gpu.yaml" "torchserve-mnist-v2-predictor"
validate_gpu_memory_usage
else
deploy_cluster "kubernetes/kserve/tests/configs/mnist_v2_cpu.yaml" "torchserve-mnist-v2-predictor"
fi
Expand Down
Loading