-
Notifications
You must be signed in to change notification settings - Fork 8
Implement immediate feedback for unsupported test environments for models deployment #658
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
Conversation
Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com>
|
@srikanthbachala20 is this ready to review? |
Enhanced GPU requirement detection in environment validation to also check for num_accelerators field in inference_compute_info. If num_accelerators is not 0, requires_gpu is set to True, providing more comprehensive GPU requirement detection as requested in code review. Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com>
c5983a4 to
04e092f
Compare
Updated the environment validation tests to align with the current implementation in model_run_locally.py: - Removed accelerator_type from GPU model fixture since current logic only checks num_accelerators - Added comprehensive test for num_accelerators detection logic - Added test for CPU-only models (num_accelerators=0) - Updated test descriptions to match current behavior - Fixed import issues for better code organization Tests now properly validate the simplified GPU detection logic that only checks num_accelerators field. Co-authored-by: srikanthbachala20 <170492893+srikanthbachala20@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements comprehensive environment validation for model testing to provide immediate feedback when users attempt to run tests on unsupported configurations. The validation checks Python version compatibility, platform-specific GPU support based on model requirements, and Docker availability, failing fast with clear error messages before expensive setup operations.
Key changes:
- Added
_validate_test_environment()method that performs early validation checks - Integrated validation call at the start of
main()function before any setup operations - GPU requirement detection based on
num_acceleratorsconfiguration field
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| clarifai/runners/models/model_run_locally.py | Added _validate_test_environment() method with Python version, GPU availability, and Docker checks; integrated validation call in main() |
| tests/runners/test_environment_validation.py | Comprehensive test suite covering Python version validation, GPU/CPU model detection, platform validation, and integration with main function |
|
Just curious, the added function |
Minimum allowed line rate is |
This PR adds comprehensive environment validation to provide immediate feedback when users attempt to run model tests on unsupported configurations, helping them understand limitations and avoid confusion when tests fail.
Problem
Users running model tests on unsupported environments (e.g., macOS without NVIDIA support, incompatible Python versions) would encounter confusing failures without clear guidance on what was wrong or how to fix it.
Solution
Added early environment validation that checks for:
Python Version Compatibility
Platform-Specific GPU Support
num_acceleratorsfield to determine GPU requirementsDocker Availability
Key Features
num_acceleratorsfieldExample Output
For a GPU model on an environment without NVIDIA support:
Changes Made
Modified:
clarifai/runners/models/model_run_locally.py_validate_test_environment()method with comprehensive checksnum_acceleratorsfield (if not 0, GPU is required)main()functionAdded:
tests/runners/test_environment_validation.pynum_acceleratorsdetection logicTesting
All tests pass, including:
num_acceleratorsfield (fails appropriately without GPU)num_acceleratorslogic validationFixes #657.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.