Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6cb78d0
Add ReFlow asynchronous CPU-offloaded optimizers for ZeRO-3
st-bang97 Sep 29, 2026
fdf7bad
Validate ReFlow precision and optimizer usage
st-bang97 Oct 2, 2026
7e18098
Abort ReFlow checkpoints on asynchronous optimizer failures
st-bang97 Oct 2, 2026
255aa7c
Fix Intel MPI NUMA binding checks on target hosts
st-bang97 Oct 2, 2026
0ae955c
Support per-group maximize semantics in ReFlow Adam
st-bang97 Oct 2, 2026
d7d20f3
Allow FP16 parameters in Reflow
st-bang97 Oct 2, 2026
c019239
Merge branch 'master' into PR_branch
st-bang97 Oct 2, 2026
e4e55d8
Merge branch 'master' into PR_branch
st-bang97 Oct 13, 2026
d358000
Merge upstream master and keep ReFlow changes focused
st-bang97 Oct 29, 2026
3035444
Validate ReFlow optimizer and offload compatibility
st-bang97 Oct 29, 2026
3bda341
Merge branch 'master' into PR_branch
st-bang97 Nov 9, 2026
c4b6660
Fix ReFlow gradient handling and CPU affinity
st-bang97 Nov 10, 2026
e18bce9
Merge branch 'master' into PR_branch
st-bang97 Nov 14, 2026
52103d3
Merge branch 'master' into PR_branch
sfc-gh-truwase Nov 14, 2026
958fdc9
Separate ReFlow CPU builders and fix loss scaling
st-bang97 Nov 18, 2026
6a7168e
Merge branch 'master' into PR_branch
st-bang97 Nov 18, 2026
96cb85f
Fix ReFlow CPU compatibility checks
st-bang97 Nov 19, 2026
392e3ee
Fix ReFlow gradient buffer cleanup and overflow restore
st-bang97 Nov 20, 2026
fd0e865
Fix ReFlow gradient accumulation and norm handling
st-bang97 Nov 20, 2026
06a1416
Fix ReFlow local gradient access and CPU placement
st-bang97 Nov 20, 2026
3b47167
Overlap ReFlow Ready updates with backward on a shared optimizer pool
st-bang97 Nov 20, 2026
843e377
Batch ReFlow Ready work and stream parameter transfers
st-bang97 Nov 20, 2026
c727962
Apply full-gradient edits to ReFlow accumulation buffers
st-bang97 Nov 20, 2026
e2549fc
Reuse ZeRO-3 helpers and simplify ReFlow Ready work
st-bang97 Nov 20, 2026
1c1016e
Reuse ReFlow gradient storage and bound master restore copies
st-bang97 Nov 20, 2026
a065529
Merge branch 'master' into PR_branch
st-bang97 Nov 20, 2026
75ea166
Merge branch 'master' into PR_branch
hwchen2017 Nov 21, 2026
ef7da9c
Register ReFlow CPU builders with the CUDA accelerator
st-bang97 Nov 22, 2026
09a8ab7
Merge branch 'master' into PR_branch
pengdurice Nov 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ Conduct](https://opensource.microsoft.com/codeofconduct/). For more information
35. Tingfeng Lan, Yusen Wu, Bin Ma, Zhaoyuan Su, Rui Yang, Tekin Bicer, Masahiro Tanaka, Olatunji Ruwase, Dong Li, Yue Cheng. (2025) ZenFlow: Enabling Stall-Free Offloading Training via Asynchronous Updates [arXiv:2505.12242](https://arxiv.org/abs/2505.12242)
36. Kayhan Behdin, Ata Fatahibaarzi, Qingquan Song, Yun Dai, Aman Gupta, Zhipeng Wang, Hejian Sang, Shao Tang, Gregory Dexter, Sirou Zhu, Siyu Zhu, Tejas Dharamsi, Vignesh Kothapalli, Zhoutong Fu, Yihan Cao, Pin-Lun Hsu, Fedor Borisyuk, Natesh S. Pillai, Luke Simon, Rahul Mazumder.(2025) Scaling Down, Serving Fast: Compressing and Deploying Efficient LLMs for Recommendation Systems [EMNLP 2025](https://aclanthology.org/2025.emnlp-industry.119/)
37. Xinyu Lian, Masahiro Tanaka, Olatunji Ruwase, Minjia Zhang. (2026) SuperOffload: Unleashing the Power of Large-Scale LLM Training on Superchips [arxiv](https://arxiv.org/abs/2509.21271), [ASPLOS 2026](https://www.asplos-conference.org/asplos2026)
38. Seongtae Bang, Gyeongseo Park, Ki-Dong Kang, Hyunkyun Shin, Sungju Kim, Daehoon Kim. (2027) ReFlow: Exposing Parallelism in CPU-Offloaded LLM Training via Register-Resident SIMD Fusion and Decoupled Update Scheduling [ACM](https://dl.acm.org/doi/10.1145/3845814.3850051), [ASPLOS 2027](https://www.asplos-conference.org/asplos2027/)

# Videos
1. DeepSpeed KDD 2020 Tutorial
Expand Down
1 change: 1 addition & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ DCO 针对每次 Git Commit 生效,因此每个提交都需要附加签署声
35. Tingfeng Lan, Yusen Wu, Bin Ma, Zhaoyuan Su, Rui Yang, Tekin Bicer, Masahiro Tanaka, Olatunji Ruwase, Dong Li, Yue Cheng. (2025) ZenFlow: Enabling Stall-Free Offloading Training via Asynchronous Updates [arXiv:2505.12242](https://arxiv.org/abs/2505.12242)
36. Kayhan Behdin, Ata Fatahibaarzi, Qingquan Song, Yun Dai, Aman Gupta, Zhipeng Wang, Hejian Sang, Shao Tang, Gregory Dexter, Sirou Zhu, Siyu Zhu, Tejas Dharamsi, Vignesh Kothapalli, Zhoutong Fu, Yihan Cao, Pin-Lun Hsu, Fedor Borisyuk, Natesh S. Pillai, Luke Simon, Rahul Mazumder.(2025) Scaling Down, Serving Fast: Compressing and Deploying Efficient LLMs for Recommendation Systems [EMNLP 2025](https://aclanthology.org/2025.emnlp-industry.119/)
37. Xinyu Lian, Masahiro Tanaka, Olatunji Ruwase, Minjia Zhang. (2026) SuperOffload: Unleashing the Power of Large-Scale LLM Training on Superchips [arxiv](https://arxiv.org/abs/2509.21271), [ASPLOS 2026](https://www.asplos-conference.org/asplos2026)
38. Seongtae Bang, Gyeongseo Park, Ki-Dong Kang, Hyunkyun Shin, Sungju Kim, Daehoon Kim. (2027) ReFlow: Exposing Parallelism in CPU-Offloaded LLM Training via Register-Resident SIMD Fusion and Decoupled Update Scheduling [ACM](https://dl.acm.org/doi/10.1145/3845814.3850051), [ASPLOS 2027](https://www.asplos-conference.org/asplos2027/)

# 视频讲座与教程
1. DeepSpeed KDD 2020 专题教程
Expand Down
8 changes: 6 additions & 2 deletions accelerator/cpu_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,9 @@ def get_op_builder(self, class_name):
# is op_builder from deepspeed or a 3p version? this should only succeed if it's deepspeed
# if successful this also means we're doing a local install and not JIT compile path
from op_builder import __deepspeed__ # noqa: F401 # type: ignore
from op_builder.cpu import AsyncIOBuilder, CCLCommBuilder, ShareMemCommBuilder, FusedAdamBuilder, CPUAdamBuilder, CPUAdagradBuilder, CPULionBuilder, PinMemoryBuilder, NotImplementedBuilder
from op_builder.cpu import AsyncIOBuilder, CCLCommBuilder, ShareMemCommBuilder, FusedAdamBuilder, CPUAdamBuilder, CPUAdagradBuilder, CPULionBuilder, ReflowCPUAdamBuilder, ReflowCPULionBuilder, PinMemoryBuilder, NotImplementedBuilder
except ImportError:
from deepspeed.ops.op_builder.cpu import AsyncIOBuilder, CCLCommBuilder, ShareMemCommBuilder, FusedAdamBuilder, CPUAdamBuilder, CPUAdagradBuilder, CPULionBuilder, PinMemoryBuilder, NotImplementedBuilder
from deepspeed.ops.op_builder.cpu import AsyncIOBuilder, CCLCommBuilder, ShareMemCommBuilder, FusedAdamBuilder, CPUAdamBuilder, CPUAdagradBuilder, CPULionBuilder, ReflowCPUAdamBuilder, ReflowCPULionBuilder, PinMemoryBuilder, NotImplementedBuilder

if class_name == "CCLCommBuilder":
return CCLCommBuilder
Expand All @@ -491,6 +491,10 @@ def get_op_builder(self, class_name):
return CPUAdagradBuilder
elif class_name == "CPULionBuilder":
return CPULionBuilder
elif class_name == "ReflowCPUAdamBuilder":
return ReflowCPUAdamBuilder
elif class_name == "ReflowCPULionBuilder":
return ReflowCPULionBuilder
elif class_name == "AsyncIOBuilder":
return AsyncIOBuilder
elif class_name == "PinMemoryBuilder":
Expand Down
9 changes: 8 additions & 1 deletion accelerator/cuda_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,14 @@ def _lazy_init_class_dict(self):
# Host-side ops (the CPU optimizers, and async I/O, which stages device tensors through
# host memory) need no CUDA to build, so they share their builders with the CPU accelerator.
cpu_op_builder_module = importlib.import_module("{}.cpu".format(op_builder_dir))
for member_name in ["CPUAdamBuilder", "CPUAdagradBuilder", "CPULionBuilder", "AsyncIOBuilder"]:
for member_name in [
"CPUAdamBuilder",
"CPUAdagradBuilder",
"CPULionBuilder",
"ReflowCPUAdamBuilder",
"ReflowCPULionBuilder",
"AsyncIOBuilder",
]:
self.class_dict[member_name] = getattr(cpu_op_builder_module, member_name)
# end initialize for create_op_builder()

Expand Down
6 changes: 6 additions & 0 deletions ci/tests_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ class TestSelector:
# module_inject is applied at deepspeed.initialize() time (replace_module /
# replace_transformer_layer); the tests it affects don't import it directly.
"deepspeed/module_inject/**": ("tests/unit/v1/moe/**", ),
# Reflow's ZeRO-3 optimizer is chosen inside deepspeed.initialize(); its tests reach it
# through the engine rather than by importing it.
"deepspeed/runtime/reflow/**": (
"tests/unit/v1/zero/test_reflow.py",
"tests/unit/v1/ops/test_reflow_cpu_optimizers.py",
),
}

def __init__(self, repo_root: Path | str, config: WorkflowConfig):
Expand Down
1 change: 1 addition & 0 deletions csrc/adam/cpu_adam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// DeepSpeed Team

#include "cpu_adam.h"
#include <pybind11/pybind11.h>

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
Expand Down
81 changes: 81 additions & 0 deletions csrc/adam/reflow_cpu_adam_bindings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// SPDX-License-Identifier: Apache-2.0
// DeepSpeed Team

#include <torch/extension.h>
#include "reflow_cpu_adam.h"

// Memory fence to enforce store ordering after non-temporal (streaming) stores.
static void reflow_adam_memory_fence()
{
#if defined(__AVX512__) or defined(__AVX256__)
_mm_mfence();
#endif
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
bind_reflow_ready_work(m);
m.def("reflow_create_adam",
&reflow_create_adam_optimizer,
"Reflow CPU Adam create (C++)",
pybind11::arg("optimizer_id"),
pybind11::arg("alpha") = 1e-3,
pybind11::arg("betta1") = 0.9,
pybind11::arg("betta2") = 0.999,
pybind11::arg("eps") = 1e-8,
pybind11::arg("weight_decay") = 0,
pybind11::arg("adamw_mode") = true,
pybind11::arg("should_log") = false,
pybind11::arg("num_threads") = -1);
m.def("reflow_destroy_adam", &reflow_destroy_adam_optimizer, "Reflow CPU Adam destroy (C++)");
m.def("reflow_adam_update_params_halfgrad",
&reflow_ds_adam_step_params_halfgrad,
pybind11::call_guard<pybind11::gil_scoped_release>(),
"Reflow CPU Adam update FP16 with half gradients, GIL-released (C++)",
pybind11::arg("optimizer_id"),
pybind11::arg("step"),
pybind11::arg("lr"),
pybind11::arg("beta1"),
pybind11::arg("beta2"),
pybind11::arg("epsilon"),
pybind11::arg("weight_decay"),
pybind11::arg("bias_correction"),
pybind11::arg("params_fp32"),
pybind11::arg("grads"),
pybind11::arg("exp_avg"),
pybind11::arg("exp_avg_sq"),
pybind11::arg("half_params"),
pybind11::arg("combined_scale"),
pybind11::arg("skip_increment_step") = false,
pybind11::arg("maximize") = false,
pybind11::arg("ready_work") = nullptr,
pybind11::arg("destination_offset") = 0);
m.def("reflow_adam_update_state_halfgrad",
&reflow_ds_adam_state_step_halfgrad,
pybind11::call_guard<pybind11::gil_scoped_release>(),
"Reflow CPU Adam update state stream with half gradients, GIL-released (C++)",
pybind11::arg("optimizer_id"),
pybind11::arg("step"),
pybind11::arg("lr"),
pybind11::arg("beta1"),
pybind11::arg("beta2"),
pybind11::arg("epsilon"),
pybind11::arg("weight_decay"),
pybind11::arg("bias_correction"),
pybind11::arg("params_fp32"),
pybind11::arg("grads"),
pybind11::arg("exp_avg"),
pybind11::arg("exp_avg_sq"),
pybind11::arg("combined_scale"),
pybind11::arg("skip_increment_step") = false,
pybind11::arg("maximize") = false);
m.def("reflow_adam_memory_fence",
&reflow_adam_memory_fence,
"Reflow CPU Adam memory fence (C++)");
m.def("reflow_bf16_accumulate",
&reflow_ds_bf16_accumulate,
pybind11::call_guard<pybind11::gil_scoped_release>(),
"Reflow CPU BF16/FP16 gradient accumulate using AVX, GIL-released (C++)",
pybind11::arg("dst"),
pybind11::arg("src"));
}
Loading
Loading