Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
hg-misc-tools
Commits
ead299ec
Commit
ead299ec
authored
Mar 24, 2026
by
one
Browse files
[xcl-lens] Support pcie mem channel
parent
f6b27906
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
5 deletions
+46
-5
projects/xcl-lens/src/xcl_lens/parser/rccl.py
projects/xcl-lens/src/xcl_lens/parser/rccl.py
+46
-5
No files found.
projects/xcl-lens/src/xcl_lens/parser/rccl.py
View file @
ead299ec
...
...
@@ -31,6 +31,7 @@ class RcclLogParser:
self
.
_report_channel_transport_info
()
self
.
_report_collective_transfers
()
self
.
_report_p2p_transfers
()
self
.
_report_pcie_mem_channel_info
()
print
(
" End of Report "
.
center
(
80
,
"="
))
...
...
@@ -206,6 +207,9 @@ class RcclLogParser:
- pattern: Regex pattern to match the field key (e.g., r"protocol")
- col_name: Name of the DataFrame column
- value_pattern: Regex pattern to validate/extract the field value
A 3-item tuple (col_name, value_pattern, literal_value) is also
supported for literal/default columns. If value_pattern is None,
literal_value is assigned directly.
mandatory: List of column names that must not be NaN (drop rows missing these)
verbose_cols: List of column names to keep when not verbose
sort_cols: List of column names to sort by (in order)
...
...
@@ -221,11 +225,29 @@ class RcclLogParser:
# Create DataFrame and extract all fields using regex with validation
df
=
pd
.
DataFrame
(
data
,
columns
=
[
"host"
,
"rank"
,
"raw_log"
])
for
pattern
,
(
col_name
,
val_pattern
)
in
fields
.
items
():
for
pattern
,
field_spec
in
fields
.
items
():
if
len
(
field_spec
)
==
2
:
col_name
,
val_pattern
=
field_spec
# Extract field with strict value validation using word boundary
df
[
col_name
]
=
df
[
"raw_log"
].
str
.
extract
(
rf
"\b
{
pattern
}
\s+(
{
val_pattern
}
)"
,
expand
=
False
)
elif
len
(
field_spec
)
==
3
:
col_name
,
val_pattern
,
literal_value
=
field_spec
if
val_pattern
is
None
:
matched
=
df
[
"raw_log"
].
str
.
contains
(
rf
"\b
{
pattern
}
\b"
,
regex
=
True
)
df
[
col_name
]
=
pd
.
Series
(
pd
.
NA
,
index
=
df
.
index
,
dtype
=
"object"
)
df
.
loc
[
matched
,
col_name
]
=
literal_value
else
:
df
[
col_name
]
=
(
df
[
"raw_log"
]
.
str
.
extract
(
rf
"\b
{
pattern
}
\s+(
{
val_pattern
}
)"
,
expand
=
False
)
.
fillna
(
literal_value
)
)
else
:
raise
ValueError
(
f
"Invalid field spec for pattern
{
pattern
!
r
}
: expected 2 or 3 items"
)
# Drop verbose columns if not verbose
if
not
self
.
_verbose
:
...
...
@@ -249,6 +271,9 @@ class RcclLogParser:
"nloops"
,
"nsteps"
,
"chunksize"
,
"connIndex"
,
"collXhclNum"
,
"p2pXhclNum"
,
]
for
col
in
numeric_columns
:
if
col
in
df
.
columns
:
...
...
@@ -307,6 +332,22 @@ class RcclLogParser:
sort_cols
=
[
"host"
,
"rank"
,
"Pattern"
],
)
def
_report_pcie_mem_channel_info
(
self
):
pcie_mem_fields
=
{
r
"enable pcie mem channel"
:
(
"pcie_mem"
,
None
,
"enabled"
),
r
"connIndex"
:
(
"connIndex"
,
r
"\d+"
),
r
"collXhclNum"
:
(
"collXhclNum"
,
r
"\d+"
),
r
"p2pXhclNum"
:
(
"p2pXhclNum"
,
r
"\d+"
),
}
self
.
_extract_and_print
(
title
=
"PCIe Mem Channel Info"
,
filter_func
=
lambda
c
:
"enable pcie mem channel"
in
c
.
lower
(),
fields
=
pcie_mem_fields
,
mandatory
=
[
"pcie_mem"
,
"connIndex"
,
"collXhclNum"
,
"p2pXhclNum"
],
verbose_cols
=
[],
sort_cols
=
[
"host"
,
"rank"
,
"connIndex"
,
"collXhclNum"
,
"p2pXhclNum"
],
)
def
_report_collective_transfers
(
self
):
# Pattern -> column with strict validation
cl_transfer_fields
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment