Skip to content

Fix/warnings stacklevel mvapich runner#7949

Draft
nathon-lee wants to merge 14 commits intodeepspeedai:masterfrom
nathon-lee:fix/warnings-stacklevel-mvapich-runner
Draft

Fix/warnings stacklevel mvapich runner#7949
nathon-lee wants to merge 14 commits intodeepspeedai:masterfrom
nathon-lee:fix/warnings-stacklevel-mvapich-runner

Conversation

@nathon-lee
Copy link
Copy Markdown
Contributor

MVAPICHRunner.backend_exists calls warnings.warn without stacklevel,
so Python reports the warning as coming from inside DeepSpeed rather than
the user's code. Adding stacklevel=2 fixes the reported call site.

No functional change.

@nathon-lee nathon-lee requested a review from loadams as a code owner April 2, 2026 14:00
@tohtana
Copy link
Copy Markdown
Collaborator

tohtana commented Apr 8, 2026

Hi @nathon-lee,
Thank you for the PR~ I wonder if stacklevel=2 still doesn't point the user code. Before this PR, it isdeepspeed/launcher/multinode_runner.py but it will be deepspeed/launcher/runner.py.

@nathon-lee
Copy link
Copy Markdown
Contributor Author

Hi @nathon-lee, Thank you for the PR~ I wonder if stacklevel=2 still doesn't point the user code. Before this PR, it isdeepspeed/launcher/multinode_runner.py but it will be deepspeed/launcher/runner.py.

Hi @tohtana, you're right — stacklevel=2 still points inside DeepSpeed, and since a RuntimeError is raised right after, users won't even see the warning. This change has no real effect. Converting to draft while I reconsider. Thanks!

@nathon-lee nathon-lee marked this pull request as draft April 9, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants