Draft
Conversation
Adds comprehensive GPU testing via Modal serverless platform: - Modal runner module (tests/modal_runner.py) with functions for: - GPU unit tests (30 min timeout) - Integration tests for training (40 min timeout) - Performance benchmarks (20 min timeout) - Multi-GPU distributed tests (20 min timeout) - GPU test suites: - tests/test_gpu/test_training_gpu.py: 6 GPU training tests - tests/test_gpu/test_inference_gpu.py: 6 inference/benchmark tests - tests/test_gpu/test_distributed.py: 6 multi-GPU tests - Configuration: - tests/modal_config.py: pytest fixtures and test config - modal.toml: Modal app configuration - requirements-modal.txt: Modal dependencies - GitHub Actions: - .github/workflows/modal-gpu-tests.yml: Label-triggered CI workflow - Runs on PR labels: gpu-tests or modal-tests - Tests on 3 Python versions (3.10, 3.11, 3.12) - Uses T4 GPUs for cost-effectiveness - Documentation: - docs/modal-testing.md: Complete guide for Modal testing - Setup instructions for local and CI/CD - Cost breakdown and optimization tips - Troubleshooting guide Updates: - pyproject.toml: Added modal>=0.63.0 to dev dependencies
Contributor
|
✅ Skylos Scan: No dead code or security issues detected. |
9f49dd6 to
c34708f
Compare
Contributor
|
✅ Skylos Scan: No dead code or security issues detected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive GPU testing infrastructure using Modal, a serverless GPU compute platform. Tests are automatically triggered on PRs labeled with
gpu-testsormodal-tests, enabling cost-effective GPU testing without maintaining dedicated hardware.Key Features
GPU Test Suites (1,571 lines across 11 files):
test_training_gpu.py): GPU memory management, forward/backward passes, loss computation, gradient accumulation, end-to-end trainingtest_inference_gpu.py): Batch inference benchmarks, mixed precision inference, throughput measurement, large batch handlingtest_distributed.py): GPU availability, DataParallel wrapper, gradient synchronization, device consistency, multi-GPU training loopsInfrastructure:
tests/modal_runner.py): Serverless GPU functions with 4 test suites + orchestratortests/modal_config.py): Pytest fixtures, markers, and configuration constants.github/workflows/modal-gpu-tests.yml): Label-triggered CI/CD on 3 Python versions with T4 GPUsdocs/modal-testing.md): 434-line guide covering setup, usage, cost breakdown, and troubleshootingCost Optimization:
Test Coverage
Setup Requirements
MODAL_TOKEN_IDandMODAL_TOKEN_SECRET(obtainable from Modal dashboard)pip install modal>=0.63.0+modal token newgpu-testsormodal-teststo trigger automated testingFiles Added/Modified
.github/workflows/modal-gpu-tests.yml(164 lines) - CI/CD workflowtests/modal_runner.py(327 lines) - Modal serverless functionstests/modal_config.py(106 lines) - Test configuration & fixturestests/test_gpu/test_training_gpu.py(174 lines) - Training teststests/test_gpu/test_inference_gpu.py(158 lines) - Inference teststests/test_gpu/test_distributed.py(197 lines) - Distributed testsdocs/modal-testing.md(434 lines) - Complete documentationmodal.toml(2 lines) - Modal configurationrequirements-modal.txt(7 lines) - Modal dependenciespyproject.toml(+1 line) - Added modal>=0.63.0How to Test
Run locally (requires Modal setup):
Trigger in CI/CD:
gpu-testslabel to PRManual workflow dispatch (coming in next update):
Documentation
See
docs/modal-testing.mdfor:Dependencies:
modal>=0.63.0(optional, only needed for CI/CD and local Modal testing)