Skip to content

Commit 8dc0e29

Browse files
committed
reward no longer terminal
1 parent 398812e commit 8dc0e29

6 files changed

+10
-91
lines changed

cluster.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using .job
1111

1212
export ClusterEnv, QUEUE_SIZE, ZONES
1313

14-
const QUEUE_SIZE, ZONES, SLICE_SIZE = 64, 16, 50_000
14+
const QUEUE_SIZE, ZONES, SLICE_SIZE = 64, 16, 8192
1515

1616
struct Metrics
1717
avg_bounded_slowdown::Float32
@@ -212,6 +212,7 @@ function (env::ClusterEnv)(action)
212212
for i in 1:length(env.cluster)
213213
if env.cluster[i].simulated_run_time >= env.cluster[i].run_time
214214
env.available_cores += env.cluster[i].cores
215+
env.reward += env.sjf_bsld - bounded_slowdown(env.cluster[i])
215216
push!(to_remove, i)
216217
end
217218
end
@@ -248,7 +249,7 @@ function (env::ClusterEnv)(action)
248249
# currently: negative average bounded slowdown relative to SJF
249250
# positive reward = better performance than SJF;
250251
# negative = worse; zero = same
251-
env.reward = env.workload.sjf_bsld - avg_bsld
252+
#env.reward = env.workload.sjf_bsld - avg_bsld
252253
env.done = true
253254
env.metrics = Metrics(avg_bsld, avg_wait_time, max_wait_time)#, avg_utilization)
254255
break

run-cpu.jl

-82
This file was deleted.

run.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ using .cluster
1212

1313
save_dir = "save"
1414
N_ENV = 8
15-
TRAJECTORY_SIZE = 1024
16-
N_TRAIN_ITERATION = 50
17-
N_EPOCH = 500
15+
TRAJECTORY_SIZE = 64
16+
N_TRAIN_ITERATION = 150
17+
N_EPOCH = 50
1818
env = MultiThreadEnv([ClusterEnv() for i in 1:N_ENV])
1919

2020
shared_network = Chain(
2121
x -> reshape(x, ZONES + 4, QUEUE_SIZE, :),
22-
Dense(ZONES + 4, 512, relu),
23-
Dense(512, 1),
22+
Dense(ZONES + 4, 128, relu),
23+
Dense(128, 1),
2424
x -> reshape(x, QUEUE_SIZE, :) # squeeze
2525
)
2626

@@ -30,8 +30,8 @@ agent = Agent(
3030
actor = shared_network,
3131
critic = Chain(
3232
shared_network,
33-
Dense(QUEUE_SIZE, 256, relu),
34-
Dense(256, 1),
33+
Dense(QUEUE_SIZE, 128, relu),
34+
Dense(128, 1),
3535
x -> reshape(x, :) # squeeze
3636
),
3737
optimizer = Adam(1e-5)
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)