Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion src/aiu_trace_analyzer/core/acelyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def run(self) -> int:
sys.exit(1)

# create event processor
profile = StageProfile.from_json(self.args.profile)
profile = StageProfile.from_json(self.args.profile, self.args.verification_mode)
intermediate_file = self.args.output if self.args.intermediate else None
process = processor.EventProcessor(profile=profile,
intermediate=intermediate_file)
Expand Down Expand Up @@ -750,6 +750,10 @@ def register_verification_functions(self,
args,
exporter: output.AbstractTraceExporter):
verification_ctx = event_pipe.VerificationContext()
kernel_parent_ctx = event_pipe.KernelParentVerificationContext()

process.register_stage(callback=event_pipe.verify, context=verification_ctx)
process.register_stage(callback=event_pipe.kernel_parent_collect, context=kernel_parent_ctx)
process.register_stage(callback=event_pipe.pipeline_barrier, context=event_pipe._main_barrier_context)
process.register_stage(callback=event_pipe.kernel_parent_verify, context=kernel_parent_ctx)
process.register_stage(callback=event_pipe.verify_cleanup)
11 changes: 8 additions & 3 deletions src/aiu_trace_analyzer/core/stage_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@

class StageProfile:
_everything_profile = os.path.join(os.path.dirname(__file__), "../profiles/everything.json")
_verification_profile = os.path.join(os.path.dirname(__file__), "../profiles/verification.json")

def __init__(self, profile_data: dict, all_stages: dict):
self.profile = self._ingest_profile_data(profile_data, all_stages)

@classmethod
def from_json(cls, file: Path):
def from_json(cls, file: Path, verification_mode: bool = False):
everything = cls._everything_profile
if verification_mode:
everything = cls._verification_profile

if not os.path.isfile(file):
# try find profile file in default install location
file = os.path.join(os.path.dirname(__file__), "../profiles/", file)
file = Path(os.path.join(os.path.dirname(__file__), "../profiles/", file))
with open(file, 'r') as config_fd:
profile_data = json.load(config_fd)
with open(cls._everything_profile, 'r') as all_fd:
with open(everything, 'r') as all_fd:
all_stages = json.load(all_fd)

# if a profile is empty, then assume all stages to be enabled
Expand Down
5 changes: 5 additions & 0 deletions src/aiu_trace_analyzer/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@

from aiu_trace_analyzer.verification.verify import verify, verify_cleanup
from aiu_trace_analyzer.verification.verify import VerificationContext
from aiu_trace_analyzer.verification.kernel_parent_verify import (
KernelParentVerificationContext,
kernel_parent_collect,
kernel_parent_verify
)
4 changes: 1 addition & 3 deletions src/aiu_trace_analyzer/profiles/everything.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
{"tb_refinement_lightweight": true},
{"cycle_count_conversion_cleanup": true},
{"calculate_stats_v2": true},
{"sort_events": true},
{"verify": true},
{"verify_cleanup": true}
{"sort_events": true}
]
}
4 changes: 3 additions & 1 deletion src/aiu_trace_analyzer/profiles/verification.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"stages": [
{"verify": true},
{"kernel_parent_collect": true},
{"pipeline_barrier": true},
{"kernel_parent_verify": true},
{"verify_cleanup": true}
]
}
Loading