fix(auto): warn when unavailable accelerators fall back to CPU - #3742
Merged
Merged
Conversation
Signed-off-by: LauraGPT <18321252+LauraGPT@users.noreply.github.com>
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
Follow-up to the reporter's request in #3738 after installing a CUDA-enabled PyTorch build resolved their immediate problem.
ngpu=0remain quiet.Type of change
Validation
tests/test_submodel_device.py,tests/test_auto_model_ncpu.py,tests/test_auto_model.py, andtests/test_amp_device_type.py. The deselected speaker-clustering test downloads a real model and was deliberately not run.torch.nn.Modulehad CPU parameters after construction. No model download or inference was performed.git diff --checkpassed. Independent static review found no P1/P2 issues at the tested file hashes.Accelerator availability is mocked in the configuration tests; the stand-in models retain CPU weights. This is not GPU/MPS/XPU/NPU hardware validation, not a full FunASR suite run, and not a claim that the existing hosted workflows execute these new tests. No dependencies, model assets, CI settings, or inference defaults changed.
User impact
Users expecting accelerator execution can see when initialization has selected CPU instead. Applications can continue controlling verbosity through normal logging configuration.
Notes for reviewers
Related to #3738; the reporter already closed that issue after resolving their environment problem.
Integration
Merged as
7b098acefc22999f1be483b7b6fca62db8c8ad39. Both exact-head hosted checks passed: MOSS adapter and KWS output. These workflows do not replace the 59-test native CPU run above. Verified merge parents, signed commit, source bytes, and exact tree equality with the tested head.Merged through the ordinary SHA-guarded API under the repository's existing admin exemption. No branch protection changes, fabricated review approval, or workflow approval was made. This is a source-main change, not a PyPI release or production deployment.
Post-merge checks at the exact merge SHA also completed successfully: KWS output, MOSS adapter, and API documentation.