DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

Fix/warnings stacklevel mvapich runner

Open nathon-lee opened this issue 7 months ago • 2 comments

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 avatar Apr 02 '26 14:04 nathon-lee

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.

tohtana avatar Apr 08 '26 20:04 tohtana

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 avatar Apr 09 '26 02:04 nathon-lee