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

Add interface to trace events in custom runtimes #584

Merged
merged 5 commits into from
Jan 26, 2023

Conversation

emcastillo
Copy link
Contributor

No description provided.

@@ -311,6 +311,17 @@ def map(
"""
raise NotImplementedError()

@classmethod
@contextlib.contextmanager
def trace(cls, event_name: str, arg: Any) -> Generator[None, None, None]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a class method since we can have multiple runtime instances (one per module created with ppe.to). I think we should address these issues in other PR since the ppe.to and nested modules semantics changed and can be tricky.

@kmaehashi kmaehashi self-assigned this Aug 5, 2022
@@ -218,6 +218,8 @@ def run(self,
self._train_len = train_len
self._eval_len = eval_len

device = self.handler._entry_runtime.device_spec # type: ignore[attr-defined]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if we should pass the device spec as a trainer arg instead of accessing it like this. It would be much simpler.

@kmaehashi kmaehashi added this to the v0.6.1 milestone Aug 18, 2022
@kmaehashi kmaehashi modified the milestones: v0.6.1, v0.6.2 Aug 26, 2022
@kmaehashi kmaehashi modified the milestones: v0.6.2, v0.6.3 Nov 2, 2022
@kmaehashi kmaehashi modified the milestones: v0.6.3, v0.6.4 Dec 2, 2022
@kmaehashi
Copy link
Member

Sorry for the delay, LGTM!
/test

@emcastillo
Copy link
Contributor Author

/test

@kmaehashi kmaehashi merged commit a19ba08 into pfnet:master Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants