-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4722fb
commit cf5b6c6
Showing
4 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
import json | ||
|
||
import pandas as pd | ||
|
||
# Open the test_results.json file | ||
with open('test_results.json', 'r') as file: | ||
with open("test_results.json") as file: | ||
data = json.load(file) | ||
|
||
# Convert the data into a pandas DataFrame | ||
df = pd.DataFrame(data, columns=['layout', 'backend', 'size', 'success', 'cycles']) | ||
df = pd.DataFrame(data, columns=["layout", "backend", "size", "success", "cycles"]) | ||
|
||
# order the data by layout, backend, and size | ||
df = df.sort_values(by=['layout', 'backend', 'size']) | ||
|
||
print(df) | ||
def calculate_expected(size): | ||
sizes = size.split("x") | ||
sizes = [round(int(x) / 8) for x in sizes] | ||
return sizes[0] * sizes[1] * sizes[2] | ||
|
||
|
||
# Add a new column to the DataFrame with the expected number of cycles | ||
df["expected"] = df["size"].apply(calculate_expected) | ||
|
||
# add a new column to the DataFrame with the speedup | ||
df["utilization"] = df["expected"] / df["cycles"] | ||
|
||
# order the data by layout, backend, and size | ||
df = df.sort_values(by=["layout", "backend", "size"]) | ||
|
||
print(df) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters