Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
"reallocate" should be "relocate"
  • Loading branch information
SylvanBrocard committed Dec 10, 2024
1 parent 5ba3e3e commit 355bca0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def log_dpu(
df.loc[dimm_index, ("results", "dpu", "pim_cpu_times")] = DPU_kmeans.pim_cpu_time_
df.loc[dimm_index, ("results", "dpu", "inertia_times")] = DPU_kmeans.inertia_timer_
df.loc[dimm_index, ("results", "dpu", "reallocate_times")] = (
DPU_kmeans.reallocate_timer_
DPU_kmeans.relocate_timer_
)
df.loc[dimm_index, ("results", "dpu", "single_kmeans_times")] = (
DPU_kmeans.main_loop_timer_
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dimension/CPU+DPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
DPU_cpu_pim_timer = DPU_kmeans.cpu_pim_time_
DPU_pim_cpu_timer = DPU_kmeans.pim_cpu_time_
DPU_inertia_timer = DPU_kmeans.inertia_timer_
DPU_reallocate_timer = DPU_kmeans.reallocate_timer_
DPU_reallocate_timer = DPU_kmeans.relocate_timer_
DPU_train_timer = DPU_kmeans.train_time_

DPU_timer = toc - tic
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/higgs/CPU+DPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
DPU_cpu_pim_timer = DPU_kmeans.cpu_pim_time_
DPU_pim_cpu_timer = DPU_kmeans.pim_cpu_time_
DPU_inertia_timer = DPU_kmeans.inertia_timer_
DPU_reallocate_timer = DPU_kmeans.reallocate_timer_
DPU_reallocate_timer = DPU_kmeans.relocate_timer_
DPU_train_timer = DPU_kmeans.train_time_

DPU_timer = toc - tic
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/simple_benchmark/CPU+DPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
DPU_cpu_pim_timer = DPU_kmeans.cpu_pim_time_
DPU_pim_cpu_timer = DPU_kmeans.pim_cpu_time_
DPU_inertia_timer = DPU_kmeans.inertia_timer_
DPU_reallocate_timer = DPU_kmeans.reallocate_timer_
DPU_reallocate_timer = DPU_kmeans.relocate_timer_
DPU_train_timer = DPU_kmeans.train_time_

DPU_timer = toc - tic
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/strong_scaling/CPU+DPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
DPU_cpu_pim_timer = DPU_kmeans.cpu_pim_time_
DPU_pim_cpu_timer = DPU_kmeans.pim_cpu_time_
DPU_inertia_timer = DPU_kmeans.inertia_timer_
DPU_reallocate_timer = DPU_kmeans.reallocate_timer_
DPU_reallocate_timer = DPU_kmeans.relocate_timer_
DPU_train_timer = DPU_kmeans.train_time_

DPU_timer = toc - tic
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/weak_scaling/CPU+DPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
DPU_cpu_pim_timer = DPU_kmeans.cpu_pim_time_
DPU_pim_cpu_timer = DPU_kmeans.pim_cpu_time_
DPU_inertia_timer = DPU_kmeans.inertia_timer_
DPU_reallocate_timer = DPU_kmeans.reallocate_timer_
DPU_reallocate_timer = DPU_kmeans.relocate_timer_
DPU_train_timer = DPU_kmeans.train_time_

DPU_timer = toc - tic
Expand Down
8 changes: 4 additions & 4 deletions src/dpu_kmeans/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _lloyd_iter_dpu(
np.linalg.norm(centers_new_int - centers_old_int, ord="fro") ** 2
/ scale_factor**2
)
return center_shift_tot, reallocate_timer
return center_shift_tot, relocate_timer


def _kmeans_single_lloyd_dpu(
Expand Down Expand Up @@ -520,7 +520,7 @@ def fit(self, X, y=None, sample_weight=None):

# run a k-means once
tic = time.perf_counter()
inertia, centers, n_iter_, inertia_timer, reallocate_timer = kmeans_single(
inertia, centers, n_iter_, inertia_timer, relocate_timer = kmeans_single(
X,
sample_weight,
centers_init,
Expand Down Expand Up @@ -550,7 +550,7 @@ def fit(self, X, y=None, sample_weight=None):
best_main_loop_timer = main_loop_timer
best_dpu_run_time = dpu_run_time
best_inertia_timer = inertia_timer
best_reallocate_timer = reallocate_timer
best_relocate_timer = relocate_timer
best_pim_cpu_time = pim_cpu_time

# compute final labels CPU side
Expand Down Expand Up @@ -580,7 +580,7 @@ def fit(self, X, y=None, sample_weight=None):
self.dpu_run_time_ = best_dpu_run_time
self.main_loop_timer_ = best_main_loop_timer
self.inertia_timer_ = best_inertia_timer
self.reallocate_timer_ = best_reallocate_timer
self.relocate_timer_ = best_relocate_timer
self.pim_cpu_time_ = best_pim_cpu_time
self.train_time_ = train_time
return self

0 comments on commit 355bca0

Please sign in to comment.