forked from pfnet/pfio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support PPE profiling for
Local
(pfnet#340)
* Profiling with PPE * Profiling with PPE * Make mypy happy * Make flake8 happy * Make isort and mypy even happier * Support all methods * Align tag naming rule with PPE (module.Klass:method) * Support PPE tracing * Local: Support io class method * Add trace switching Can be specified in the `trace` argument when creating a Local() instance. * Split PPE methods * mypy: ignore ppe * add trace test * setup: add trace context * doc: add output tracer results tips --------- Co-authored-by: UENISHI Kota <[email protected]>
- Loading branch information
1 parent
2583e62
commit e884bd4
Showing
7 changed files
with
174 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
try: | ||
from pytorch_pfn_extras.profiler import record, record_iterable | ||
|
||
except ImportError: | ||
|
||
class _DummyRecord: | ||
def __init__(self): | ||
pass | ||
|
||
def __enter__(self): | ||
pass | ||
|
||
def __exit__(self, exc_type, exc_value, traceback): | ||
pass | ||
|
||
# IF PPE is not available, wrap with noop | ||
def record(tag, trace, *args): # type: ignore # NOQA | ||
return _DummyRecord() | ||
|
||
def record_iterable(tag, iter, trace, *args): # type: ignore # NOQA | ||
yield from iter |
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
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