Skip to content
Merged
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ options:
Use -d flag to specify device.
--dump-aie-status <output_file_name>
Write AIE status to a file and exit.
--no_header Assume raw core dump without header. Use with -c.
-d DEV, --device DEV AIE device [phx,stx,telluride]. Default: telluride
-o <cxr>, --overlay <cxr>
Overlay used by design. Default: 4x4
Expand Down
1 change: 0 additions & 1 deletion src/mldebug/backend/core_dump_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

try:
from .xrt_backend import MlDebug

HAS_XRT_BACKEND = True
except ImportError:
HAS_XRT_BACKEND = False
Expand Down
22 changes: 16 additions & 6 deletions src/mldebug/input_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,28 @@ def set_device(args) -> None:
None
"""
endmsg = "\n"

# Core-dump device comes from the file header. Peek to detect it and to see
# if the file even has a header; a headerless dump needs an explicit -d.
header_variant = None
if getattr(args, "core_dump", None):
header_variant = CoreDumpFallbackReader.peek_device(args.core_dump)
args.no_header = header_variant is None
if args.no_header and not args.device:
print(
"[ERROR] Core dump file has no readable header. Re-run with -d/--device "
"to specify the device (e.g. -d telluride) so the raw dump can be parsed."
)
cleanup_and_exit(args)

if args.device:
# User-specified device; honor it as the variant and derive the base.
args.sub_device = args.device
args.device = get_base_device(args.device)
else:
endmsg = " Use -d to specify a diferent device.\n"
variant = None

# For core dumps, the device is baked into the file header. Detect it now
# so the overlay (built before the backend) uses the correct aie_iface.
if getattr(args, "core_dump", None) and not getattr(args, "no_header", False):
variant = CoreDumpFallbackReader.peek_device(args.core_dump)
# Prefer the header-detected device.
variant = header_variant

if variant is None:
variant = _detect_vaiml_variant(args.aie_dir)
Expand Down
12 changes: 5 additions & 7 deletions src/mldebug/mldebug_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ def app():
help="Write AIE status to a file and exit.\n",
default=None,
)
p.add_argument(
"--no_header", action="store_true", help="Assume raw core dump without header. Use with -c."
)
# Hidden Argument
# 'AIE Device type'
p.add_argument(
Expand Down Expand Up @@ -311,8 +308,9 @@ def app():
dest="load_script",
default=None,
metavar="<filename>",
help="Execute a Python script in the advanced shell namespace.\n"
"Exits after the script unless -i or -s is also specified.\n",
help=_dev_cli_help(
"Execute a Python script in the advanced shell namespace.\n"
),
)
p.add_argument(
"-e",
Expand Down Expand Up @@ -366,7 +364,7 @@ def app():
"mock_hang",
"l2_ifm_dump",
"text_dump",
"l1_ofm_dump",
#"l1_ofm_dump",
"skip_iter",
"dump_temps",
"multistamp",
Expand All @@ -378,7 +376,7 @@ def app():
# "layer_status : Dump AIE status at start of each layer\n"
# "l2_dump_only : Dump only L2 buffers\n"
"l2_ifm_dump : Dump only L2 IFM buffers\n"
"l1_ofm_dump : Dump L1 ofm buffers in addition to others\n"
#"l1_ofm_dump : Dump L1 ofm buffers in addition to others\n"
"text_dump : Dump in text format\n"
"skip_iter : Skip iterations in batch mode when possible\n"
"skip_iter2 : skip_iter using lcp lock.(Telluride only)\n"
Expand Down
Loading