[BugFix][Runtime] Sanitize empty Ascend RT visible devices#1
Merged
Conversation
- ignore empty ASCEND_RT_VISIBLE_DEVICES values during runtime env construction - fall back to ASCEND_VISIBLE_DEVICES when runtime visibility is unset - add regression tests covering empty and explicit visibility values Co-authored-by: GitHub Copilot <copilot@github.com> Signed-off-by: moonandlife <moonandlife@qq.com>
Document the ASCEND_RT_VISIBLE_DEVICES normalization and non-standard runtime version detection added on the PR 1 branch. Signed-off-by: moonandlife <moonandlife@qq.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.
What this PR does / why we need it?
This hardens the Ascend runtime environment builder used by
hust-ascend-manager runtime check.When
ASCEND_RT_VISIBLE_DEVICESis present but empty or whitespace-only,torch_npucan reportnpu_available=falseanddevice_count=0even when host NPUs are healthy. This PR:ASCEND_RT_VISIBLE_DEVICESASCEND_VISIBLE_DEVICESwhen a valid runtime-visible set is not presentThis is related to
vLLM-HUST/vllm-hustPR 40, where benchmark preflight failed withtorch_npu_import_ok=truebutdevice_count=0.Does this PR introduce any user-facing change?
Yes. CI and scripted runtime checks stop misreporting zero visible NPUs when the parent environment exports an empty
ASCEND_RT_VISIBLE_DEVICES.How was this patch tested?
/root/miniconda3/envs/vllm-hust-dev/bin/python -m pytest tests/test_doctor.py tests/test_runtime.py -qASCEND_RT_VISIBLE_DEVICES='' ... hust_ascend_manager.cli runtime check ...Duplicate-work check
No overlapping open PR was found in
vLLM-HUST/ascend-runtime-managerfor this runtime visibility sanitization.AI assistance
AI assistance was used via GitHub Copilot.