Skip to the content.

Softmax orchestrator: Boltzmann exploration of the tiers

What it shows

Same learned table of tier values as the Q-learning example, but a different way to act on it. SoftmaxOrchestrator subclasses QLearningOrchestrator and keeps only the state (application type, task-length bucket, layer-load bucket) and the update rule; it replaces epsilon-greedy with sampling. Open boltzmann_weights and probabilities: each reachable tier weighs exp((value - max) / TEMPERATURE) with TEMPERATURE = 0.05, and the tier is drawn from that distribution. Better tiers win more often, and as the values separate exploration fades on its own, so there is no exploration rate to tune. Two more overrides change the shape of the result: reward divides the delay by the task latency bound (failure penalty drops from -1000 to -10, so a state value means the same thing whatever the task size), and node_in_tier picks the node with the fewest tasks still in flight.

flowchart TD
    state["State<br/>type, len bucket, load bucket"] --> values["Value V of each tier<br/>cloud, edge, mist"]
    values --> weight["Weight = exp((V - max) / 0.05)"]
    weight --> prob["P = weight / sum of weights"]
    prob --> draw["Sample a tier from P"]
    draw --> node["Node with fewest<br/>pending tasks"]
    node --> reward["Reward<br/>-delay/latency, or -10"]
    reward --> update["Q update<br/>alpha 0.2, gamma 0.9"]
    update --> values
    classDef sample fill:#cfe8ff,stroke:#333;
    class weight,prob sample;

The scenario

settings/ describes the city-scale version of the Q-learning workload, run once with the learned policy:

Run it

From the repository root, after pip install -e .:

python examples/softmax_orchestrator/softmax_orchestrator.py

No-install variant:

PYTHONPATH=src python examples/softmax_orchestrator/softmax_orchestrator.py

What to look for

softmax                  tasks= 16870 ok= 12306 avg_delay=0.1704   cloud= 2736 edge=11896 mist= 2238 failed(delay)= 4564 failed(mobility)=   0 energy=76.5122

Set TEMPERATURE higher to flatten the distribution and see exploration return, or lower it to make the policy nearly greedy.

Files

Where to go next