Skip to content

Fix DataAnalyzer.run_map crashing when specific_threads is set - #8758

Merged
sfc-gh-truwase merged 2 commits into
deepspeedai:masterfrom
Rakshit-gen:fix/data-analyzer-specific-threads
Oct 9, 2026
Merged

sfc-gh-truwase merged 2 commits into
deepspeedai:masterfrom
Rakshit-gen:fix/data-analyzer-specific-threads

Conversation

@Rakshit-gen

Copy link
Copy Markdown
Contributor

DataAnalyzer.run_map fills the process list in the order of threads_to_run but starts and joins with p[thread], so specific_threads only works when it is [0, 1, ..., k]. Anything else, like [2, 3] to rerun two failed threads, raises IndexError: list index out of range.

Fix: start the process that was just appended (p[-1]) and join over p directly. Two lines.

Test: test_data_analyzer_runs_only_the_specific_threads runs run_map with num_threads=4, specific_threads=[2, 3] and checks that only worker0_thread2 and worker0_thread3 are written, holding samples 10 to 14 and 15 to 19. It fails on master with the IndexError and passes with the fix. pytest tests/unit/runtime/test_data_efficiency.py: 15 passed, 2 skipped (the two-GPU curriculum tests). Run on an M-series Mac, CPU only, torch 2.14.0. pre-commit passes on both changed files.

This doesn't touch the len(data) sample counting in the same file, which #8505 already covers.

Fixes #8757

The process list was indexed by thread id while being filled in the
order of threads_to_run, so any specific_threads other than [0..k]
raised IndexError.

Signed-off-by: rakshit-gen <sisodiarakshit456@gmail.com>
@sfc-gh-truwase
sfc-gh-truwase added this pull request to the merge queue Oct 9, 2026
Merged via the queue into deepspeedai:master with commit b7f51df Oct 9, 2026
15 checks passed
@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DataAnalyzer.run_map crashes with IndexError when specific_threads is set

2 participants