Add nccl_version to the source-checkout torch_info fallback - #8383
Add nccl_version to the source-checkout torch_info fallback#8383alanhuangyoo wants to merge 2 commits into
Conversation
setup.py writes version, bf16_support, cuda_version, nccl_version and hip_version into git_version_info_installed. The fallback used when that module is absent - any source checkout that was not pip-installed - listed only three of them, so reading torch_info['nccl_version'] raised KeyError instead of taking the '0.0' runtime-detection path the readers expect. tests/unit/util.py:50 reads it on the way into bf16_required_version_check, so every test that goes through there fails to even reach its body. Signed-off-by: alanhuangyoo <alanhuangyoo@gmail.com>
|
While verifying this on 2 GPUs I hit a second symptom of the same degenerate source-checkout
No released DeepSpeed ever reported For reference, the sweep those two came out of: |
| accelerator_name = "" | ||
| torch_info = {'version': "0.0", "cuda_version": "0.0", "hip_version": "0.0"} | ||
| # Keys must match what setup.py writes into git_version_info_installed, and "0.0" is the | ||
| # sentinel readers check to fall back to runtime detection. nccl_version was missing, so |
There was a problem hiding this comment.
“nccl_version was missing, so
# reading it off a source checkout raised KeyError instead of taking that fallback.”
This needs to be removed since its the reason to make the change, but not necessary after the change.
There was a problem hiding this comment.
Agreed — removed. Kept the part that describes the contract (keys have to match what setup.py writes into git_version_info_installed, and "0.0" is the sentinel readers check), since that is what someone editing this dict next needs to know. The reason for the change now lives only in the PR description and commit message.
Why the key was added belongs in the PR, not in a comment that outlives it. The part describing the contract - keys must match what setup.py writes, and "0.0" is the fallback sentinel - stays. Signed-off-by: alanhuangyoo <alanhuangyoo@gmail.com>
Running the unit tests from a source checkout — one that was not
pip installed, sogit_version_info_installed.pydoes not exist — fails before any test body runs:setup.py:292writes five keys:and the fallback in
deepspeed/git_version_info.py:22lists three:tests/unit/util.pyreadsnccl_versionon the way intobf16_required_version_check:The
"0.0"is a sentinel — the reader's own comment says so, andversion,cuda_versionandhip_versionall carry it for exactly that reason.nccl_versionwas left out, so instead oftaking the runtime-detection branch the lookup raises.
The change
Add the missing key with the same sentinel the other three use, so the reader takes the fallback
it was written to take.
Not adding
bf16_support, the other keysetup.pywrites and this dict omits: nothing reads itoff
torch_infotoday (get_accelerator().is_bf16_supported()is used instead), and there is noestablished sentinel for a bool the way
"0.0"is for a version. Happy to add it if you wouldrather the two dicts match key-for-key.
Verification
Reproduced on both a CPU checkout and 2×H100:
On 2 GPUs,
unit/runtime/zero/test_zero_tensor_fragment.py:The failures that remain in my environment are all
Unable to JIT load the {cpu_adam,fused_adam} op due to ninja not being installed— a missing build tool on that box, unrelated to thischange and present identically before and after.