Skip to content

Fix Triton NFS detection crash when df wraps long device names - #8259

Open
atirna wants to merge 5 commits into
deepspeedai:masterfrom
atirna:fix/nfs-df-parsing
Open

Fix Triton NFS detection crash when df wraps long device names#8259
atirna wants to merge 5 commits into
deepspeedai:masterfrom
atirna:fix/nfs-df-parsing

Conversation

@atirna

@atirna atirna commented Aug 16, 2026

Copy link
Copy Markdown

Description

is_nfs_path() reads the fs type from the second column of the second df output row. With BusyBox df and a device name longer than ~20 characters (common on AWS, where the EBS device is derived from the volume id), the device wraps onto its own line, the row has a single field, and the [1] lookup raises IndexError.

Since the check runs while printing an informational NFS warning during import deepspeed, that exception kills the whole import in BusyBox-based containers.

I changed the call to df -PT so POSIX output keeps every filesystem on one line (BusyBox and coreutils both honour -P with -T), and made the parse treat a short or malformed row as not-NFS instead of raising, so any other unexpected df output just skips the warning.

Testing

  • pytest -q tests/unit/ops/transformer/inference/test_matmul_ext.py — new mocked regression test covering the wrapped-device case passes, and fails with IndexError on the old parsing
  • pre-commit run --files deepspeed/ops/transformer/inference/triton/matmul_ext.py tests/unit/ops/transformer/inference/test_matmul_ext.py — all hooks pass
  • mocked POSIX nfs4 row is still detected as NFS, so real NFS warnings keep working

Fixes #8249

BusyBox df wraps device names longer than ~20 characters onto their own line, so the second output row holds only the device field and the fs-type lookup raised IndexError. The check runs while printing an informational NFS warning at import time, so this could kill 'import deepspeed' in BusyBox containers with long EBS device names. Use POSIX -P output to keep each filesystem on one line and treat any short/malformed row as not-NFS instead of raising. Add a mocked regression test for the wrapped-output case.

Signed-off-by: Atirna <288419661+atirna@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@pengdurice

Copy link
Copy Markdown
Contributor

lgtm, @tohtana , do you mind having a second eye on it? thank you!

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.

IndexError in is_nfs_path() when df wraps a long device name (breaks import deepspeed)

3 participants