Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
23 changes: 23 additions & 0 deletions hta/common/trace_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def infer_gpu_type(
return "AMD GPU"
if "runFunction - job_prep_and_submit_for_execution" in name_set:
return "MTIA"
if "urEnqueueKernelLaunch" in name_set:
return "INTEL XPU"
return "UNKNOWN GPU"


Expand Down Expand Up @@ -455,6 +457,20 @@ def _parse_trace_dataframe_ijson(
df, local_symbol_table = _compress_df(df, cfg)
return meta, df, local_symbol_table

def _remove_syclqueue_column(df: pd.DataFrame):
if "syclqueue" in df.columns:
df.drop(columns=["syclqueue"], inplace=True)

def _transform_column_syclqueue_to_stream(df: pd.DataFrame):
"""
Remove stream column and rename syclqueue column to stream.

Args:
df (pd.DataFrame): The trace events DataFrame.
"""
if "syclqueue" in df.columns and "stream" in df.columns:
df.drop(columns=["stream"], inplace=True)
df.rename(columns={"syclqueue": "stream"}, inplace=True)

def parse_trace_dataframe(
trace_file_path: str,
Expand Down Expand Up @@ -509,6 +525,13 @@ def parse_trace_dataframe(
device_type = infer_gpu_type(meta, local_symbol_table.get_sym_id_map())
meta[str(MetaDataKey.DEVICE_TYPE)] = device_type

# Intel traces do not have stream argument in the traces.
# The equivalent of stream argument in traces from Intel XPU is syclqueue.
if device_type == "INTEL XPU":
_transform_column_syclqueue_to_stream(df)
else:
_remove_syclqueue_column(df)

t_end = time.perf_counter()
logger.warning(
f"Parsed {trace_file_path} backend={parser_backend} in {(t_end - t_start):.2f} seconds; current PID:{os. getpid()}"
Expand Down
5 changes: 5 additions & 0 deletions hta/configs/event_args_formats/event_args_1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,8 @@ AVAILABLE_ARGS:
raw_name: batchId
value_type: String
default_value: ""
xpu::stream:
name: syclqueue
raw_name: sycl queue
value_type: Int
default_value: -1
2 changes: 1 addition & 1 deletion hta/configs/event_args_yaml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)
ARGS_MINIMUM_FUNC: Callable[[Dict[str, AttributeSpec]], List[AttributeSpec]] = (
lambda available_args: [
available_args[k] for k in ["cuda::stream", "correlation::cpu_gpu"]
available_args[k] for k in ["cuda::stream", "correlation::cpu_gpu", "xpu::stream"]
]
)
ARGS_COMPLETE_FUNC: Callable[[Dict[str, AttributeSpec]], List[AttributeSpec]] = (
Expand Down