Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and hfp committed Jan 30, 2024
1 parent 0d2c7b7 commit 00311f4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/acc/libsmm_acc/kernels/smm_acc_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"size_b",
"size_c",
# 'nblks', 'nthreads', # constant value for largeDB, since the grouping is always = 16
"sm_desired"
"sm_desired",
# 'warps_per_blk', 'nwarps', # linearly dependent on threads, nthreads
# 'ru_param_stack_unroll_factor', # constant values for each algo
],
Expand Down
12 changes: 6 additions & 6 deletions src/acc/libsmm_acc/predict/predict_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ def read_log_file(log_folder, m, n, k):
"threads": match.group(9),
"grouping": match.group(10),
"minblocks": match.group(11),
"tile_m": match.group(5)
if match.group(5) is not None
else None,
"tile_n": match.group(6)
if match.group(6) is not None
else None,
"tile_m": (
match.group(5) if match.group(5) is not None else None
),
"tile_n": (
match.group(6) if match.group(6) is not None else None
),
"w": match.group(7) if match.group(7) is not None else None,
"v": match.group(8) if match.group(8) is not None else None,
"perf (Gflop/s)": match.group(12),
Expand Down
6 changes: 3 additions & 3 deletions src/acc/libsmm_acc/predict/predict_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,9 +1184,9 @@ def get_predive_model_performances(

perf_chosen_idx = [np.argmax(y_pred[idx_mnk])]
perf_effective = y_true.iloc[idx_mnk].iloc[perf_chosen_idx].values.item()
predictive_model_perf_scaled[
(m, n, k)
] = perf_effective # 'scaled' between 0 and 1
predictive_model_perf_scaled[(m, n, k)] = (
perf_effective # 'scaled' between 0 and 1
)

predictive_model_perf = dict(
zip(
Expand Down
16 changes: 10 additions & 6 deletions src/acc/opencl/smm/tune_multiply.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,11 @@ def merge_jsons(self, filenames):
key = (device, data["TYPEID"], data["M"], data["N"], data["K"])
value = (
data["S"] if "S" in data else 0, # pseudo key component
data["GFLOPS"]
if "GFLOPS" in data and not self.args.nogflops
else 0,
(
data["GFLOPS"]
if "GFLOPS" in data and not self.args.nogflops
else 0
),
data["BS"],
data["BM"],
data["BN"],
Expand Down Expand Up @@ -525,9 +527,11 @@ def save_final_config(self, configuration, final=True):
gflops = data["GFLOPS"] if data and "GFLOPS" in data else 0
filename = os.path.join(
self.args.jsondir,
"{}-{}gflops.json".format(self.args.label, round(gflops))
if 0 < gflops
else "{}.json".format(self.args.label),
(
"{}-{}gflops.json".format(self.args.label, round(gflops))
if 0 < gflops
else "{}.json".format(self.args.label)
),
)
try:
os.rename(filedot, filename)
Expand Down

0 comments on commit 00311f4

Please sign in to comment.