Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- reinforcement-learning
|
| 5 |
+
- contextual-bandit
|
| 6 |
+
- offline-rl
|
| 7 |
+
- speculative-decoding
|
| 8 |
+
- energy-efficiency
|
| 9 |
+
- sglang
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# EAGLE3 Speculative Decoding -- Energy-Aware Policy Models
|
| 13 |
+
|
| 14 |
+
Eight models, one problem: pick `(speculative_num_steps,
|
| 15 |
+
speculative_eagle_topk, speculative_num_draft_tokens)` for sglang + EAGLE3 so
|
| 16 |
+
GPU energy utilization lands inside a 95-98% band. All trained on the
|
| 17 |
+
[`eagle3-speculative-decoding-energy-sweep`](https://huggingface.co/datasets/Pradheep1647/eagle3-speculative-decoding-energy-sweep)
|
| 18 |
+
dataset. Full writeup, sweep mechanism, and live-validated results:
|
| 19 |
+
[project README](https://github.com/HyperKuvid-Labs/energy_throttling_llms).
|
| 20 |
+
|
| 21 |
+
**Shared I/O contract** -- input is a 4-dim state
|
| 22 |
+
`[batch_size/8.0, gpu_temp_c/100.0, gpu_mem_used_mb/8192.0, gpu_util_pct/100.0]`;
|
| 23 |
+
output is an index into the same 19-action space (`RL/policy.py` in the repo
|
| 24 |
+
above), decoded to the three sglang flags.
|
| 25 |
+
|
| 26 |
+
| file | algorithm | format | load |
|
| 27 |
+
|---|---|---|---|
|
| 28 |
+
| `mlp_bandit/policy.pth` | contextual bandit (QNetwork) | torch state_dict | `QNetwork(4, 19).load_state_dict(torch.load(...))` |
|
| 29 |
+
| `lookup_table/model.json` | per-bs empirical best | JSON | `json.load(open(...))` -- `{batch_size: {"config": [...], "mean_reward": ...}}` |
|
| 30 |
+
| `linucb/model.npz` | LinUCB | numpy | `np.load(...)` -- `theta` (per-action weight vectors), `A` (per-action design matrices), `actions` |
|
| 31 |
+
| `thompson_sampling/model.npz` | Bayesian linear TS | numpy | `np.load(...)` -- `mean`, `cov` (per-action posteriors), `actions` |
|
| 32 |
+
| `gbt/model.joblib` | gradient boosted trees | sklearn | `joblib.load(...)` -- `GradientBoostingRegressor`, features `[state, action_idx/19]` |
|
| 33 |
+
| `doubly_robust/model.joblib` | doubly robust (direct model) | sklearn | `joblib.load(...)` -- `LinearRegression`, IPS correction term is not persisted (recomputed from raw sweep data at pick time) |
|
| 34 |
+
| `cql/policy.pth` | conservative Q-learning | torch state_dict | `QNetwork(4, 19).load_state_dict(torch.load(...))` |
|
| 35 |
+
| `bcq/policy.pth` | discrete BCQ | torch state_dict | `torch.load(...)` -- dict with `behavior_state_dict`, `q_state_dict`, `actions` |
|
| 36 |
+
|
| 37 |
+
## Which one to actually use
|
| 38 |
+
|
| 39 |
+
`mlp_bandit`, `lookup_table`, and `doubly_robust` agree on every batch size
|
| 40 |
+
and are the live-validated picks. `cql` and `bcq` collapsed to the
|
| 41 |
+
non-speculative baseline past `bs=1` (overly conservative default
|
| 42 |
+
hyperparameters against this reward scale) and are **not recommended** --
|
| 43 |
+
kept here for completeness, not as a suggested pick. See the project README
|
| 44 |
+
for the full live A/B numbers per algorithm.
|
| 45 |
+
|
| 46 |
+
## Hardware this was validated on
|
| 47 |
+
|
| 48 |
+
RTX 4060 Laptop GPU (8GB), `unsloth/Llama-3.2-1B-Instruct` target +
|
| 49 |
+
`rescommons/SpecForge-EAGLE3-Llama-3.2-1B-Instruct` draft, 80W power cap.
|
| 50 |
+
Picks are specific to this hardware/model pair -- retrain on the linked
|
| 51 |
+
dataset (or a fresh sweep) before trusting these on different hardware.
|