Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwitchRef

Code and data for Switching-Reference Voltage Control for Distribution Systems with AI-Training Data Centers.

Preprint: arXiv:2603.15588

Overview

Large-scale AI training workloads induce rapid, near-periodic power fluctuations at the data-center bus. When such loads are connected to a distribution feeder, conventional droop-style voltage regulation either chases the fluctuations too aggressively (high reactive effort) or fails to keep voltage inside the operating band. This repository implements the switching-reference controller (Algorithm 1), which adapts a per-bus reference $v^{\mathrm{ref}}$ to the workload's two-phase structure and absorbs the periodic component before it reaches the droop loop.

The same dimensionless design rule, with four constants $(\alpha,\beta,\gamma,c) = (1,,1,,1/8,,1/4)$, is used across every experiment; only the workload cycle period varies per trace.

Repository structure

switchref/
├── README.md
├── LICENSE
├── pyproject.toml                          # `pip install -e .` makes `switchref` importable anywhere
├── switchref/
│   ├── config.py
│   ├── env.py                              # linear voltage model
│   ├── case33.py                           # IEEE 33-bus loader + droop gain
│   ├── controllers.py                      # Algorithm 1 (AdaRefVBiasAmpMaxDV)
│   ├── utils.py                            # actions, disturbance shaping, metrics
│   ├── plotting.py                         # publication plot helpers
│   └── runners.py                          # scenario setup + trace loaders
├── data/
│   ├── case33/
│   │   ├── TestCase33.mat                  # linearized IEEE 33-bus model
│   │   └── linear_gain.pkl                 # pre-computed per-bus droop gain
│   ├── traces/
│   │   ├── dgx_h100_choukse.csv            # DGX-H100 rack (Choukse 2025)
│   │   ├── rtx8000.csv                     # RTX8000 (single GPU), LLaMA-3.3-70B-Instruct QLoRA
│   │   ├── l40s_4x.csv                     # 4×L40S, LLaMA-3.3-70B-Instruct QLoRA
│   │   ├── a100_4x.csv                     # 4×A100, LLaMA-3.3-70B-Instruct QLoRA
│   │   ├── h100_4x.csv                     # 4×H100, LLaMA-3.3-70B-Instruct QLoRA
│   │   ├── h200_4x.csv                     # 4×H200, LLaMA-2-70B-chat QLoRA (micro-batch 16×2)
│   │   └── h200_4x_b8x2.csv                # same as above with micro-batch 8×2 (two-DC variant)
│   └── traces_regulated.pkl                # storage-regulated tail (used by Fig 6)
├── main.ipynb                              # Figs 1-2 (motivation) + Tables I/II + Figs 3-6
└── figures/                                # regenerated by the notebook

Reproduce

A single notebook main.ipynb reproduces every numerical result and every figure in the paper: the Section III motivation figures (Figs 1-2) and all of Section V (Tables I/II, Figs 3-6). It ships pre-executed, so the results, printed tables, and embedded figures can be reviewed without running anything.

To re-run locally (Python ≥ 3.10):

python -m venv .venv                        # create an isolated environment in the local clone
source .venv/bin/activate                   # Windows: .\.venv\Scripts\Activate.ps1
pip install -e ".[notebook]"                # installs deps + makes `switchref` importable anywhere
jupyter notebook                            # then open main.ipynb and run all cells

(Without pip install -e ., the notebook falls back to sys.path injection, so it still runs as long as Jupyter is launched from inside switchref/.)

main.ipynb writes figures into figures/. The reported metric values come from this notebook and match bit-exactly on the included data (verified to ≤ 0.01 × 10⁻⁴ p.u.). Sections:

Section Reproduces
Fig 1 raw DGX-H100 training-power trace, phase-shaded (§III)
Fig 2 power-to-voltage causality, fixed vs switching reference (§III)
Table I 4×H200, 4×A100, 4×L40S, DGX-H100
Fig 3 4×H200 detail
Fig 4 four-trace overlay
Two-DC Table II + Fig 5 (§V-B)
Fig 6 load smoothing (§V-C)

The figures use matplotlib.rcParams['text.usetex'] = True. A working LaTeX install (TeX Live, MiKTeX, or MacTeX) is required to regenerate the PDFs. pdflatex and dvipng must be reachable from the shell that launches Jupyter; on Windows with MiKTeX, add the MiKTeX bin/x64 directory to PATH before starting Jupyter. If LaTeX is unavailable, set text.usetex to False before running. The numerical results are unaffected.

Data sources

Trace Source
dgx_h100_choukse.csv Public release accompanying Choukse et al., arXiv:2508.14318, rescaled and resampled.
rtx8000.csv Measured at NYU HPC; single RTX8000 GPU extracted from a 4-GPU QLoRA training of meta-llama/Llama-3.3-70B-Instruct.
l40s_4x.csv Measured at NYU HPC; QLoRA fine-tuning of meta-llama/Llama-3.3-70B-Instruct on 4×L40S.
a100_4x.csv Measured at NYU HPC; QLoRA fine-tuning of meta-llama/Llama-3.3-70B-Instruct on 4×A100.
h100_4x.csv Measured at NYU HPC; QLoRA fine-tuning of meta-llama/Llama-3.3-70B-Instruct on 4×H100.
h200_4x.csv Measured at NYU HPC; QLoRA fine-tuning of meta-llama/Llama-2-70b-chat-hf on 4×H200 with micro-batch 16×2 (sequence length 2048, LoRA rank 64).
h200_4x_b8x2.csv Same model and setup as h200_4x.csv, but with smaller micro-batch 8×2.
traces_regulated.pkl Paired DC-bus power time series (unregulated / regulated). The regulated track applies an internal storage + UPS dispatch (supplementary material) that smooths compute-phase fluctuations; Fig 6 splices the two.

Citation

@misc{yan2026switchingreferencevoltagecontroldistribution,
  title         = {Switching-Reference Voltage Control for Distribution Systems with AI-Training Data Centers},
  author        = {Mingyuan Yan and Trager Joswig-Jones and Baosen Zhang and Yize Chen and Wenqi Cui},
  year          = {2026},
  eprint        = {2603.15588},
  archivePrefix = {arXiv},
  primaryClass  = {eess.SY},
  url           = {https://arxiv.org/abs/2603.15588}
}

License

Released under the MIT License. See LICENSE.

Contact

For questions about the code, experiments, or reproduction details, please open an issue on the GitHub repository or contact the corresponding author.

About

Code for switching-reference voltage control in distribution systems with AI-training data centers.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages