Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extrap multi-parameter support for modeling and visualization #83

Open
wants to merge 63 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c317c78
check .cali file type in reader_dispatch()
Aug 16, 2023
99467fb
updated produce_models() in model_extrap.py to enable measurement rep…
Aug 22, 2023
30e3e38
added aggregation, scaling support for model creation
Aug 22, 2023
33db8b6
added basic code for interactive plot
Aug 23, 2023
4640379
added exceptions for produce_models(), support for multi parameter mo…
Aug 24, 2023
13e602d
added custom exception class for extra-p reader
Aug 24, 2023
83d94b0
code cleanup, removed debug code
Aug 24, 2023
e9ff101
added basic plotting support for 2 parameters
Aug 25, 2023
400a453
improved 2 parameter model visualization
Aug 26, 2023
ae2a6d9
added parameters to control output of display function
Aug 26, 2023
ce04201
added plotting options for 1,2 parameters vizs
Aug 29, 2023
71645e8
Merge branch 'LLNL:develop' into extrap
marcusritter1 Aug 29, 2023
6f46a4d
deleted UPDATES file
Aug 29, 2023
a682b8f
Merge branch 'extrap' of github.com:MeaParvitas/thicket into extrap
Aug 29, 2023
f9a17aa
formatted code to pep8 standard
Aug 29, 2023
b72f019
updated test cases for extra-p code
Aug 29, 2023
a4b8f7e
added optional parameter for display function to specify scaling curve
Aug 29, 2023
de874bf
formatted code to pep8 standard
Aug 29, 2023
9c12116
formatted code to pep8 standard
Aug 29, 2023
3f1fb4b
fixed F401 '*.log2' imported but unused
Aug 29, 2023
51bd673
added complexity analysis for extra-p models with one parameter
Aug 31, 2023
e843a94
added growth trend ranking to analyze complexity function
Sep 1, 2023
25a6b86
added type checking, hints
Sep 6, 2023
ea69fc1
added multi-parameter support for componentize function
Sep 7, 2023
773adde
added multi-parameter support for complexity_statsframe function
Sep 7, 2023
8826ded
Merge branch 'develop' into extrap
marcusritter1 Sep 7, 2023
7ae9a36
fixed F402 import 'node' from line 21 shadowed by loop variable
Sep 7, 2023
42c300b
fixded F402 import 'node' from line 21 shadowed by loop variable
Sep 7, 2023
8bcc01e
added basic code for color coding complexity classes in hatchet tree
Sep 8, 2023
1bd89c4
added colormapping support for complexity analysis with tree function
Sep 8, 2023
0dc7d24
black
Sep 8, 2023
cb69c82
fixed F821 undefined name 'plt'
Sep 8, 2023
73a27d0
changed tuple type hints to be compatible with Python3.8
Sep 8, 2023
448995c
load DEFAULT_PARAM_NAMES from extrap directly to improve compatability
Sep 13, 2023
a31e453
multi eval target support for complexity analysis statsframe function
Sep 13, 2023
dbe438f
fixed multi-parameter visualization bug for constant functions
Sep 14, 2023
af2e64e
removed color coding information after adding it into hatchet codebase
Sep 14, 2023
fdb1a9f
added basic implementation for multi_display function and phase analysis
Sep 15, 2023
e1e8649
multi display method working for multi-parameter models
Sep 19, 2023
858ba7a
produce_aggregated_model function is working
Sep 19, 2023
a37ecd5
single-parameter support for mutli_display()
Sep 19, 2023
d33ce04
produce_aggregated_model() multi metric support bug fix
Sep 19, 2023
2f9e5f4
multi_display() color chosen by dominant scaling
Sep 19, 2023
de6b809
Merge branch 'LLNL:develop' into extrap
marcusritter1 Oct 3, 2023
ef6b94f
refactored extrap modeling code
Oct 5, 2023
8200109
Merge branch 'LLNL:develop' into extrap
marcusritter1 Oct 10, 2023
878c5aa
extrap models shown in latex encoding in dataframe, bugfixes
Oct 11, 2023
192ad9d
extrap modeler configurtion support and multi column index for modeli…
Oct 20, 2023
de5db03
basic multi index for extrap modeling in thicket working
Oct 20, 2023
b3a5b98
added logic to print out available extra-p modelers and their options
Nov 2, 2023
4d2d5a4
added full support for extra-p modeler configuration options with err…
Nov 2, 2023
bafe065
multi column indexing working
Nov 3, 2023
96deacf
updated visualization methods
Nov 3, 2023
30bdd47
fixed bugs in multi column indexing
Nov 7, 2023
4c28290
updated
Nov 17, 2023
365b271
resolved merge conflicts
Nov 17, 2023
c7e389d
added check for .cali files
Nov 17, 2023
72727f8
updated
Nov 27, 2023
0d3ffca
updated complexity analysis support for multi index and modeler confi…
Nov 29, 2023
6e2be10
componentize and aggregation function now support new interface
Dec 1, 2023
8642599
modeler configuration support for componentize function
Dec 1, 2023
6ee3ce8
updated
Dec 1, 2023
7ee61f3
black
Dec 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions thicket/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,24 @@ def _check_structures():
"""Check that the structures of the thicket objects are valid for the incoming operations."""
# Required/expected format of the data
for th in thickets:
verify_thicket_structures(th.dataframe, index=["node", "profile"])
verify_thicket_structures(th.statsframe.dataframe, index=["node"])
verify_thicket_structures(
th.dataframe, index=["node", "profile"])
verify_thicket_structures(
th.statsframe.dataframe, index=["node"])
verify_thicket_structures(th.metadata, index=["profile"])
# Check for metadata_key in metadata
if metadata_key:
for th in thickets:
verify_thicket_structures(th.metadata, columns=[metadata_key])
verify_thicket_structures(
th.metadata, columns=[metadata_key])
# Check length of profiles match if metadata key is not provided
if metadata_key is None:
for i in range(len(thickets) - 1):
if len(thickets[i].profile) != len(thickets[i + 1].profile):
raise ValueError(
"Length of all thicket profiles must match if 'metadata_key' is not provided. {} != {}".format(
len(thickets[i].profile), len(thickets[i + 1].profile)
len(thickets[i].profile), len(
thickets[i + 1].profile)
)
)
# Ensure all thickets profiles are sorted. Must be true when metadata_key=None to
Expand Down Expand Up @@ -124,16 +128,19 @@ def _handle_metadata():
thickets_cp[i].metadata.reset_index(drop=True, inplace=True)
if metadata_key is None:
for i in range(len(thickets_cp)):
thickets_cp[i].metadata.index.set_names("profile", inplace=True)
thickets_cp[i].metadata.index.set_names(
"profile", inplace=True)
else:
for i in range(len(thickets_cp)):
thickets_cp[i].metadata.set_index(metadata_key, inplace=True)
thickets_cp[i].metadata.set_index(
metadata_key, inplace=True)
thickets_cp[i].metadata.sort_index(inplace=True)

# Create multi-index columns
for i in range(len(thickets_cp)):
thickets_cp[i].metadata.columns = pd.MultiIndex.from_tuples(
_create_multiindex_columns(thickets_cp[i].metadata, headers[i])
_create_multiindex_columns(
thickets_cp[i].metadata, headers[i])
)

# Concat metadata together
Expand All @@ -145,11 +152,13 @@ def _handle_metadata():
def _handle_misc():
"""Misceallaneous Thicket object operations."""
for i in range(1, len(thickets_cp)):
combined_th.profile += thickets_cp[i].profile # Update "profile" object
# Update "profile" object
combined_th.profile += thickets_cp[i].profile
combined_th.profile_mapping.update(
thickets_cp[i].profile_mapping
) # Update "profile_mapping" object
combined_th.profile = [new_mappings[prf] for prf in combined_th.profile]
combined_th.profile = [new_mappings[prf]
for prf in combined_th.profile]
profile_mapping_cp = combined_th.profile_mapping.copy()
for k, v in profile_mapping_cp.items():
combined_th.profile_mapping[
Expand Down Expand Up @@ -179,7 +188,8 @@ def _handle_perfdata():
thickets_cp[i].metadata_column_to_perfdata(
"new_profiles", drop=True
)
thickets_cp[i].dataframe.reset_index(level="profile", inplace=True)
thickets_cp[i].dataframe.reset_index(
level="profile", inplace=True)
new_mappings.update(
pd.Series(
thickets_cp[i]
Expand All @@ -189,7 +199,8 @@ def _handle_perfdata():
index=thickets_cp[i].dataframe["profile"],
).to_dict()
)
thickets_cp[i].dataframe.drop("profile", axis=1, inplace=True)
thickets_cp[i].dataframe.drop(
"profile", axis=1, inplace=True)
thickets_cp[i].dataframe.set_index(
"new_profiles", append=True, inplace=True
)
Expand All @@ -199,7 +210,8 @@ def _handle_perfdata():
else: # Change second-level index to be from metadata's "metadata_key" column
for i in range(len(thickets_cp)):
thickets_cp[i].metadata_column_to_perfdata(metadata_key)
thickets_cp[i].dataframe.reset_index(level="profile", inplace=True)
thickets_cp[i].dataframe.reset_index(
level="profile", inplace=True)
new_mappings.update(
pd.Series(
thickets_cp[i]
Expand All @@ -209,7 +221,8 @@ def _handle_perfdata():
index=thickets_cp[i].dataframe["profile"],
).to_dict()
)
thickets_cp[i].dataframe.drop("profile", axis=1, inplace=True)
thickets_cp[i].dataframe.drop(
"profile", axis=1, inplace=True)
thickets_cp[i].dataframe.set_index(
metadata_key, append=True, inplace=True
)
Expand Down Expand Up @@ -351,10 +364,11 @@ def _fill_perfdata(perfdata, fill_value=np.nan):
# Extend dataframe
unify_df = pd.concat([th.dataframe, unify_df])
# Sort by keys
unify_profile_mapping = OrderedDict(sorted(unify_profile_mapping.items()))
unify_profile_mapping = OrderedDict(
sorted(unify_profile_mapping.items()))

# Insert missing rows in dataframe
unify_df = _fill_perfdata(unify_df)
# unify_df = _fill_perfdata(unify_df)

# Sort PerfData
unify_df.sort_index(inplace=True)
Expand Down
Loading
Loading