Skip to content
illinois-nsaiPublic

About

DeDe (OSDI '25): an optimization framework for large-scale resource allocation

Resources

Stars

15 stars

Watchers

0 watching

Forks

Latest commit

 

History

42 Commits

Folders and files

Repository files navigation

dede logo

PyPI - version PyPI - downloads

DeDe is a general, scalable, and theoretically grounded optimization framework that accelerates large-scale resource allocation problems through a decouple-and-decompose approach.

Getting started

Hardware requirements

  • Linux OS (e.g., Ubuntu 24.04)
  • A multi-core CPU instance

Dependencies

  • Python >= 3.8
  • g++ (required by cvxpy)

Installation

We have made DeDe available as a PyPI package! You can simply install it using pip:

pip install dede
  • We recommend creating a Python virtual environment (e.g., venv or Conda) before installation.

Modifications

If you want to modify DeDe's source code and use that as your package instead, navigate to the project root directory and run:

pip install -e .

For a complete development environment that includes tests and linting, run the following instead:

pip install -e ".[dev]"
  • After making modifications, there is no need to rerun this command, as the package was installed in editable (-e) mode.
  • Once again, we recommend creating a Python virtual environment beforehand.

Code structure

.
├── dede/                       # core source code
├── tests/                      # test suite
│     └── test_dede.py
└── examples/                   # example use cases
      ├── traffic_engineering/
      ├── cluster_scheduling/
      └── load_balancing/

Using DeDe

DeDe adopts a familiar interface from cvxpy, e.g., Variable(.), Minimize(.).

Key differences in DeDe:

  • DeDe requires specifying separate resource_constraints and demand_constraints when constructing a problem.
  • The solve(.) method includes additional parameters:
    • enable_dede: enables DeDe if True; defaults to cvxpy if False.
    • num_cpus: number of CPU cores (defaults to all available cores).
    • rho: ADMM parameter acting like a ``learning rate''.
    • num_iter: maximum number of iterations; if not specified, DeDe stops when the primal and dual residuals meet the termination tolerances.
    • xi: residual-balancing scale for adaptive rho; 0.1 is the default and performs best across a variety of cases, while 0.01-0.3 is the most robust general tuning range (smaller favors primal feasibility, larger favors dual feasibility).
    • mu: residual-imbalance threshold for adaptive rho; larger values make rho updates less aggressive.
    • balance_iterations: how often DeDe checks residuals and updates rho; larger values make adaptation less frequent.

⚠️ Work in progress:

This high-level interface is designed for ease of use, but performance enhancements are still underway. For optimal performance, we currently recommend lower-level APIs, as demonstrated in the example use cases.

Toy examples

A toy example for resource allocation with DeDe is as follows:

import dede as dd
N, M = 100, 100

# Create allocation variables
x = dd.Variable((N, M), nonneg=True)

# Create the constraints
resource_constraints = [x[i,:].sum() >= i for i in range(N)]
demand_constraints = [x[:,j].sum() <= j for j in range(M)]

# Create an objective
objective = dd.Minimize(x.sum())

# Construct the problem
prob = dd.Problem(objective, resource_constraints, demand_constraints)

# Solve the problem with DeDe on 4 CPU cores
print(prob.solve(num_cpus=4, solver=dd.ECOS))

Another toy example is provided in tests/test_dede.py. To test these examples quickly, from the project root directory, run

./tests/test_dede.py

or, if pytest is installed:

pytest

In the test suite, gurobi, a third-party optimizer, is utilized as a point of comparison for DeDe's outputs. The gurobipy packages an installation of gurobi, but a gurobi license is required. The gurobi site has a help page for setting up a license.

Example output screenshots are provided in the assets folder.

Example use cases of DeDe

We provide three example applications of DeDe in the research paper:

  • Traffic engineering: a network flow optimization problem.
  • Cluster scheduling: a resource allocation problem in cluster computing.
  • Load balancing: a query balancing problem in distributed stores.

These examples are implemented using the lower-level APIs of DeDe, which currently offer greater efficiency than the high-level APIs. Please see examples/README.md for more details.

Citation

If you use DeDe in your research, please cite our paper:

@inproceedings{dede,
    title={{Decouple and Decompose: Scaling Resource Allocation with DeDe}},
    author={Xu, Zhiying and Yu, Minlan and Yan, Francis Y.},
    booktitle={Proceedings of the USENIX OSDI 2025 Conference},
    month=jul,
    year={2025}
}

About

DeDe (OSDI '25): an optimization framework for large-scale resource allocation

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages