Skip to content

[Request Help] I refer the Delegate Debugging document to debug the QLoRA_LLama 3.2-1B model, and want to get the pipeline of linear operation delegation and determine the underlying kernel in XNNPACK #9034

@liye0626

Description

@liye0626

Refer the Delegate Debugging document, I have following preparation:

  • add the ETDump Buffer after llama model generation, refer then document (https://github.com/pytorch/executorch/blob/main/docs/source/etdump.md)
  • use --generate_etrecord option to generate .pte file and also generate ETRecord file.
  • use Debug mode (-DCMAKE_BUILD_TYPE=Debug, --config Debug) and event tracer (-DET_EVENT_TRACER_ENABLED) to compile the llama_main.
  • run llama_main in mobile device and generate ETDump file
  • use Inspector method to analyze the contents of ETRecord and ETDump

I can get the debug_handle_map in ETRecord file, such as

But current results only are the debug mapping, and I try to use Runtime Logging(event_tracer_start_profiling_delegate, event_tracer_log_profiling_delegate, or ETDumpGen::start_profiling_delegate, ETDumpGen::log_profiling_delegate), it only modified the specific event name in ETDump, for example in XNNExecutor.cpp

  • EventTracerEntry entry = (context.event_tracer())->start_profiling_delegate(nullptr, static_casttorch::executor::DebugHandle(149));
  • (context.event_tracer())->end_profiling_delegate(entry, "xxxxx", strlen("xxxx")+1);
  • the inspector analyzed result is event name 149 event debug_handles None event debug_identifier 149 event op type []

So, am I using ExecuTorch delegate debugging incorrectly?
I want to trace a linear operation(such as delegate_debug_identifier=149), get its execution flow in the XNNPACK backend, and determine the underlying XNNPACK execution kernel

cc @digantdesai @mcr229 @cbilgin @Jack-Khuu

Metadata

Metadata

Assignees

Labels

module: devtoolsIssues related to developer tools and code under devtools/module: xnnpackIssues related to xnnpack delegation and the code under backends/xnnpack/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions