Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d777fa6
feat: Performance comparison (#1)
davidchuyaya Sep 19, 2025
d38dacf
Bug fix (op id to prev id mapping)
davidchuyaya Sep 20, 2025
66db14a
fix(hydro_optimize): MultiRunMetadata not appending runs correctly
davidchuyaya Sep 20, 2025
fbd7457
feat(hydro_optimize): Sync with hydro-project up to PR #2225 (#4)
davidchuyaya Oct 28, 2025
1f4811d
Rustflags fix (#5)
davidchuyaya Oct 29, 2025
0a799fa
fix(hydro_optimize): Switch ILP solver (#6)
davidchuyaya Nov 4, 2025
06ba677
fix(hydro_optimize): ILP solver decoupling network fix (#7)
davidchuyaya Nov 10, 2025
5a5b136
Fix case where some nodes' cardinalities were not tracked correctly; …
davidchuyaya Nov 10, 2025
8b28ae1
Create function for checking input taint
davidchuyaya Nov 17, 2025
078e34b
`output_to_input_fields` maps how each operator changes dependencies
davidchuyaya Nov 18, 2025
da988ba
Add partitionability function for each node
davidchuyaya Nov 19, 2025
735ebcd
Track whether EDBs need to be partitionable (before the ILP is invoke…
davidchuyaya Nov 19, 2025
0974351
Remove EDB special cases, can address with mechanism after partitioni…
davidchuyaya Nov 20, 2025
5d04e9b
Add function to check if a node introduces persistence
davidchuyaya Nov 20, 2025
c0aad0f
Add function to find canonical fields for each operator
davidchuyaya Nov 21, 2025
4c2018a
Decoupling supports > 2 destinations (untested)
davidchuyaya Nov 22, 2025
ad0d4fd
Minor fixes for decoupling
davidchuyaya Nov 24, 2025
a3c46ea
Integrating partitioning ILP, WIP
davidchuyaya Nov 24, 2025
e73bcaf
Partitioning ILP WIP, missing link between child field and parents
davidchuyaya Nov 25, 2025
2f8cf4f
Consistently name the "input" of a node/operator a "parent", the "inp…
davidchuyaya Nov 25, 2025
10938fc
Complete partitioning ILP, untested
davidchuyaya Nov 25, 2025
1adf2a0
Minor fixes
davidchuyaya Nov 26, 2025
9cb5335
Consistently check node_is_at_location to account for Network
davidchuyaya Nov 26, 2025
acc193b
Double RefCell::borrow_mut fix, canonical_fields returns vec, syn_ana…
davidchuyaya Dec 4, 2025
dc9ca03
Partitioning analysis no longer errors for Paxos proposers.
davidchuyaya Dec 6, 2025
6e4c78b
Don't run sidecar for clients/aggregators
davidchuyaya Apr 17, 2026
6bd533d
exclude marked processes/clusters from perf, collect more sar stats, …
davidchuyaya Apr 17, 2026
096efeb
Fix hydro version in Cargo.toml because we know this one works
davidchuyaya Apr 17, 2026
be2752a
Record perf and counters to file, replay with paxos_optimizations
davidchuyaya Apr 17, 2026
7d9bb42
merge main
davidchuyaya Apr 17, 2026
8ecf6b5
Don't analyze perf/counters for excluded nodes, no more CPU bottlenec…
davidchuyaya Apr 17, 2026
8ab2776
Merge branch 'record_stats' into auto_decouple_and_partition
davidchuyaya Apr 17, 2026
48f0046
Merging latest hydro-optimize, DecoupleDecision WIP
davidchuyaya Apr 20, 2026
d43cf23
decouple_analysis output made consistent, untested
davidchuyaya Apr 20, 2026
ec6d52a
Combining decoupling & partitioning ILP with kiro, all reviewed excep…
davidchuyaya Apr 23, 2026
34d5e2e
WIP with kiro on full optimization passes
davidchuyaya Apr 24, 2026
046d3ed
Network calibration functional
davidchuyaya Apr 25, 2026
64d9961
Kiro work checked except for parse_results and decouple_analysis, wit…
davidchuyaya Apr 25, 2026
85e9e87
Merge branch 'auto_decouple_and_partition' of https://github.com/hydr…
davidchuyaya Apr 25, 2026
89b7d8c
reduce pushdown now runs on all locations except those excluded
davidchuyaya Apr 25, 2026
bddb5bd
Simplify rewrite application logic, TODOs created about where to star…
davidchuyaya Apr 25, 2026
e1020b6
optimization types are mutually exclusive
davidchuyaya Apr 25, 2026
2e2aa42
Remove jank in deploy_and_analyze
davidchuyaya Apr 25, 2026
5425b7a
Add early stop if throughput plateaus
davidchuyaya Apr 26, 2026
e9cced6
Should save the right data for blow-up, size, and network analysis now
davidchuyaya Apr 26, 2026
baf2791
Allow configuring virtual clients step (for network calibration, whic…
davidchuyaya Apr 26, 2026
eea51b5
Merge branch 'auto_decouple_and_partition' of https://github.com/hydr…
davidchuyaya Apr 26, 2026
64aeb36
Merge reduce_pushdown fixes from main
davidchuyaya Apr 27, 2026
ee77079
update network calibration python
davidchuyaya Apr 27, 2026
ae55e8b
Merge branch 'auto_decouple_and_partition' of https://github.com/hydr…
davidchuyaya Apr 27, 2026
a164dad
Rewrites should now account for a budget on the number of nodes, unte…
davidchuyaya Apr 27, 2026
c8e2d7f
Merge branch 'auto_decouple_and_partition' of https://github.com/hydr…
davidchuyaya Apr 27, 2026
132e7c7
size calibration works
davidchuyaya Apr 27, 2026
cc67a26
Merge branch 'auto_decouple_and_partition' of https://github.com/hydr…
davidchuyaya Apr 27, 2026
098da23
decoupler + partitioner debugged. 1. add_new_network was outputting t…
davidchuyaya Apr 27, 2026
827e734
Decoupling & partitioning working for Hydro with ILP analysis
davidchuyaya May 6, 2026
224b721
testing ilp analysis
davidchuyaya May 8, 2026
0383a5e
Merge latest hydro (new MergeOrdered node), further prepping for rewr…
davidchuyaya May 8, 2026
7262427
ILP analysis accounts for all resource usages. Streamline saving resu…
davidchuyaya May 11, 2026
05defd0
Network calibration changes physical num clients, deployment consider…
davidchuyaya May 12, 2026
f24c913
Network calibration with varying physical clients to create socket-b…
davidchuyaya May 13, 2026
9d3c46e
rewriter repair network panic fix
davidchuyaya May 13, 2026
a014047
Switch to gurobi for speed, remove early exit
davidchuyaya May 13, 2026
103f35f
Fix optimization path, existing network rewrite for partitioning
davidchuyaya May 15, 2026
d09085e
Partitioning correctly ignores non-IDBs, downward pass for canonical …
davidchuyaya May 15, 2026
04e5d68
README + script to set up gurobi
davidchuyaya May 20, 2026
f3f7e85
Further simplify benchmarking process and add details
davidchuyaya May 20, 2026
03c7ac5
Remove socket counting logic, use new Hydro api (supply num networkin…
davidchuyaya May 21, 2026
232906d
Missed decoupling
davidchuyaya May 21, 2026
22c3970
Save operator IDs during perf run so I can analyze it
davidchuyaya May 21, 2026
956a212
Network calibration with special calibration mode
davidchuyaya May 22, 2026
1970865
CAS uses cluster always since rewrites don't work on processes
davidchuyaya May 22, 2026
2535c20
Merge branch 'main' into auto_decouple_and_partition
davidchuyaya May 26, 2026
6c76a27
remove outdated scritps
davidchuyaya May 26, 2026
be059ee
cargo clippy and fmt
davidchuyaya May 26, 2026
26e3b8a
Reduce pushdown test requires lots of structs to be pub
davidchuyaya May 26, 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
597 changes: 185 additions & 412 deletions Cargo.lock

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ members = [
resolver = "2"

[workspace.dependencies]
hydro_lang = { version = "0.15.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa" }
hydro_std = { version = "0.15.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa" }
hydro_test = { version = "0.0.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa" }
dfir_lang = { version = "0.15.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa" }
hydro_build_utils = { version = "0.0.1", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa", features = ["insta"] }
hydro_deploy = { version = "0.15.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa", features = ["profile-folding"] }
include_mdtests = { version = "0.0.0", git = "https://github.com/hydro-project/hydro.git", rev = "e5099aaa" }
hydro_lang = { version = "0.16.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count" }
hydro_std = { version = "0.16.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count" }
hydro_test = { version = "0.0.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count" }
dfir_lang = { version = "0.16.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count" }
hydro_build_utils = { version = "0.1.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count", features = ["insta"] }
hydro_deploy = { version = "0.16.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count", features = ["profile-folding"] }
include_mdtests = { version = "0.0.0", git = "https://github.com/davidchuyaya/hydroflow.git", branch = "fix_network_pull_count" }
serde = { version = "1.0.197", features = ["derive"] }
stageleft = "0.13.4"
stageleft_tool = "0.13.4"
stageleft = "0.13.5"
stageleft_tool = "0.13.5"
tokio = { version = "1.29.0", features = ["full"] }
ctor = "0.2"
clap = { version = "4.4", features = ["derive"] }
regex = "1.11.1"


# Uncomment to use on cloud desktop
# [patch."https://github.com/hydro-project/hydro.git"]
# [patch."https://github.com/davidchuyaya/hydroflow.git"]
# hydro_lang = { path = "/local/home/chudc/hydroflow/hydro_lang" }
# hydro_std = { path = "/local/home/chudc/hydroflow/hydro_std" }
# hydro_test = { path = "/local/home/chudc/hydroflow/hydro_test" }
Expand All @@ -35,11 +35,11 @@ regex = "1.11.1"
# include_mdtests = { path = "/local/home/chudc/hydroflow/include_mdtests" }

# Uncomment to use local hydro checkout on Mac
# [patch."https://github.com/hydro-project/hydro.git"]
# hydro_lang = { path = "/Users/chudc/Desktop/hydro/hydro_lang" }
# hydro_std = { path = "/Users/chudc/Desktop/hydro/hydro_std" }
# hydro_test = { path = "/Users/chudc/Desktop/hydro/hydro_test" }
# dfir_lang = { path = "/Users/chudc/Desktop/hydro/dfir_lang" }
# hydro_build_utils = { path = "/Users/chudc/Desktop/hydro/hydro_build_utils" }
# hydro_deploy = { path = "/Users/chudc/Desktop/hydro/hydro_deploy/core" }
# include_mdtests = { path = "/Users/chudc/Desktop/hydro/include_mdtests" }
# [patch."https://github.com/davidchuyaya/hydroflow.git"]
# hydro_lang = { path = "/home/chudc/hydroflow/hydro_lang" }
# hydro_std = { path = "/home/chudc/hydroflow/hydro_std" }
# hydro_test = { path = "/home/chudc/hydroflow/hydro_test" }
# dfir_lang = { path = "/home/chudc/hydroflow/dfir_lang" }
# hydro_build_utils = { path = "/home/chudc/hydroflow/hydro_build_utils" }
# hydro_deploy = { path = "/home/chudc/hydroflow/hydro_deploy/core" }
# include_mdtests = { path = "/home/chudc/hydroflow/include_mdtests" }
65 changes: 56 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
# Hydro Optimize

Automatically apply decoupling and partitioning to Hydro programs for higher throughput.

> ![NOTE]
> Only Linux is supported, as we compile with `glibc` for better performance and more legibile `perf` results.


## Installation

### ILP Solver
These crates rely on the [HiGHS](https://highs.dev/) ILP solver to find the optimal set of rewrites. The cmake compiler is required:
We rely on the [Gurobi](https://www.gurobi.com/) ILP solver to find the optimal set of rewrites.
Gurobi is not free; you will need to either create a Gurobi account (and use a free educational license) or use your organization's license, if available.

```bash
./setup_gurobi.sh
```

Create a Gurobi license following your organization's instructions.
For free educational licenses, you may request a named license from Gurobi, then run the command they provide, which should resemble the following:

```bash
grbgetkey <unique-hash-from-gurobi>
```

## Execution

To run Microbus or Krupa without applying any optimizations, run:
```bash
cargo run --example benchmark_paxos -- --aws > paxos.txt
cargo run --example cas -- --aws > cas.txt
```
The current progress of each execution can be found in the piped `.txt` files.
Note that killing the process (or putting the running machine to sleep) will leave the machines hanging, so if you must kill the process, be sure to follow instructions in "Tearing Down" to tear it down.

### Automatic Optimization

Optimization relies on an accurate model of networking costs, which must first be calibrated with NetworkCalibrator.
This may take multiple hours, as it cycles through multiple network sizes, and gradually increases the number of clients for each size until throughput saturates.
```bash
cargo run --example network_calibrator -- --aws > network.txt
```

Linux:
Once network calibration is complete, we can optimize either protocol by adding `--optimize`. For example:
```bash
sudo apt-get install cmake
cargo run --example benchmark_paxos -- --aws --optimize > paxos_optimize.txt
```

MacOS (assuming HomeBrew is installed):
Run the command above continuously in a loop until it returns with no outputs.
Use the following script to automate that process:
```bash
brew install cmake
./run_protocol.sh benchmark_paxos
./run_protocol.sh cas
```

### Profiling
MacOS profiling requires [samply](https://github.com/mstange/samply):
All results are stored in `benchmark_results`.

## Tearing Down

If the experiment ever goes wrong, you can terminate it with `Ctrl+C`.
Then delete any cloud resources with:
```bash
./terraform_cleanup.sh
```

Afterwards, you may optionally delete the terraform files to speed up future terraform cleanups:
```bash
cargo install --locked samply
```
rm -rf .hydro
```
3 changes: 1 addition & 2 deletions hydro_optimize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ edition = "2024"
all-features = true

[dependencies]
chrono = "0.4.44"
ena = "0.14.4"
good_lp = { version = "1.14.0", features = ["highs"], default-features = false }
good_lp = { version = "1.14.0", features = ["lp-solvers"], default-features = false }
hydro_deploy.workspace = true
hydro_lang = { workspace = true, features = ["deploy"] }
hydro_std.workspace = true
Expand Down
71 changes: 0 additions & 71 deletions hydro_optimize/src/debug.rs

This file was deleted.

Loading
Loading