-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update profiling records without reseting catalog #519
Update profiling records without reseting catalog #519
Conversation
Can you add tests for these? |
nos/common/profiler.py
Outdated
@@ -228,6 +228,22 @@ def as_df(self) -> pd.DataFrame: | |||
) | |||
return df | |||
|
|||
def from_df(self, df: pd.DataFrame) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a classmethod
where you return cls(records)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@classmethod
def from_df(cls, df: pd.DataFrame) -> "Profiler":
...
return cls(records)
nos/common/profiler.py
Outdated
record.update(key, value) | ||
self.records.append(record) | ||
|
||
def from_json_path(self, filename: Union[Path, str]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above, needs to be a classmethod
that returns return cls.from_df(df)
nos/common/profiler.py
Outdated
self.prof = Profiler() | ||
self.prof.from_json_path(NOS_PROFILE_CATALOG_PATH) | ||
else: | ||
logger.debug("No prof catalog found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use f"Profile catalog not found (filename={NOS_PROFILE_CATALOG_PATH})."
nos/common/profiler.py
Outdated
with Profiler() as self.prof, torch.inference_mode(): | ||
from nos.constants import NOS_PROFILE_CATALOG_PATH | ||
|
||
self.prof = Profiler() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.prof = Profiler.from_json_path(NOS_PROFILE_CATALOG_PATH)
ae09f21
to
49b158e
Compare
…rofiler, profiling data and profiling context managers
… the hub based on profile path, gpu utilization populates now
…ult for profiling
0c0c126
to
c2b6b9f
Compare
…ferent key strucure. Init an empty profiler by default and require rebuild
see additions, we now check for gpu utilization in the catalog for |
Variety of updates/fixes to the profiler to support generating profiling catalogs across local/cloud:
prof
less ambiguous between the Profiler itself, context managers, actual profiling results etc.--catalog-path
flag so we can write profiling results to a filemount in skypilot rather than needing to track down the catalog inside the nos cache each time.Summary
Related issues
Checks
make lint
: I've runmake lint
to lint the changes in this PR.make test
: I've made sure the tests (make test-cpu
ormake test
) are passing.