Add envs.py for environment checks and update imports in test files#1432
Open
Add envs.py for environment checks and update imports in test files#1432
Conversation
Signed-off-by: He, Xin3 <xin3.he@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves test-only environment/helpers utilities out of the main auto_round package surface by introducing a test-local envs module and updating CUDA/CPU tests to import environment gates (e.g., require_*, multi_card, has_module) from it instead of auto_round.testing_utils.
Changes:
- Replaced
auto_round.testing_utilsimports across CUDA and CPU test suites with...envsrelative imports. - Standardized test dependencies on environment checks to be test-local (supporting removal of
testing_utilsfrom the main package).
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_cuda/schemes/test_auto_scheme.py | Switches multi_card import to test-local envs. |
| test/test_cuda/quantization/test_mxfp_nvfp.py | Switches require_awq/require_optimum imports to test-local envs. |
| test/test_cuda/quantization/test_mxfp_and_nvfp_quant.py | Switches has_module import to test-local envs. |
| test/test_cuda/quantization/test_mix_bits.py | Switches require_* imports to test-local envs. |
| test/test_cuda/quantization/test_2_3bits.py | Switches require_* imports to test-local envs. |
| test/test_cuda/models/test_vlms.py | Switches require_* imports to test-local envs. |
| test/test_cuda/models/test_support_vlms.py | Switches require_* imports to test-local envs. |
| test/test_cuda/models/test_diffusion.py | Switches require_* imports to test-local envs. |
| test/test_cuda/models/test_conv1d.py | Switches require_gptqmodel import to test-local envs. |
| test/test_cuda/integrations/test_transformers.py | Switches is_ipex_available import to test-local envs. |
| test/test_cuda/export/test_gguf.py | Switches require_gguf import to test-local envs. |
| test/test_cuda/export/test_export.py | Switches require_* imports to test-local envs. |
| test/test_cuda/export/test_auto_round_format.py | Switches require_* imports to test-local envs. |
| test/test_cuda/core/test_main_func.py | Switches require_* imports to test-local envs. |
| test/test_cuda/backends/test_triton_backend.py | Switches require_greater_than_050 import to test-local envs. |
| test/test_cuda/backends/test_torch_backend.py | Switches require_* imports to test-local envs. |
| test/test_cuda/backends/test_exllamav2_backend.py | Switches require_* imports to test-local envs. |
| test/test_cuda/advanced/test_multiple_card_calib.py | Switches multi_card import to test-local envs. |
| test/test_cuda/advanced/test_multiple_card.py | Switches multi_card/require_* imports to test-local envs. |
| test/test_cpu/quantization/test_mxfp_save_load.py | Switches has_module import to test-local envs. |
| test/test_cpu/quantization/test_mix_bits.py | Switches require_gptqmodel import to test-local envs. |
| test/test_cpu/backends/test_torch_backend.py | Switches require_* imports to test-local envs. |
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.
Description
testing_utils is only used by tests and should be removed from main folder.
Type of Change
Related Issues
Fixes or relates to #1134
Checklist Before Submitting