deepspeedai / deepspeedai/DeepSpeed

[REQUEST] Auto-Tuning CPU Core Binding for DeepSpeed&ZenFlow

Open
#7,478 32 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Description

Currently, DeepSpeed offers --bind_cores_to_rank and --bind_core_list flags to bind CPU cores, but these require explicit specification from the user. While core binding works, it is not fully automated and does not adapt dynamically to different NUMA node configurations or CPU layouts.

Problem

The current core binding functionality requires users to manually specify which cores to bind to each worker. This approach does not provide flexibility in handling complex CPU layouts, particularly when dealing with non-sequential core IDs or varying NUMA node configurations.

Proposed Discussion

We may explore the possibility of auto-tuning CPU core binding to find optimal strategies automatically. This would involve:

  • Automatic Core Binding: Automatically determine the best core binding across NUMA nodes without requiring user input.

  • Adaptation to Non-Sequential Core Layouts (due to logical cores): Account for irregularities in core numbering (e.g., non-sequential core IDs within a NUMA node) to ensure efficient binding.

  • Maximizing Core Utilization: Ensure that the binding maximizes CPU utilization and minimizes memory contention across workers.

Possible Context

Deepspeed CPU binding: https://github.com/deepspeedai/DeepSpeed/blob/master/deepspeed/utils/numa.py#L117
ZenFlow CPU binding:
zenflow_optimizer_process() at #7391

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CPU-binding implementation in deepspeed/utils/numa.py around line 117, then inspect the zenflow_optimizer_process() entry point referenced from issue #7391. Compare the existing bind_cores_to_rank and bind_core_list behavior with the proposed NUMA and non-sequential-core requirements; the work is done when an agreed auto-tuning design is implemented and its behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.