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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liye0626 opened this issue Mar 7, 2025 · 4 comments
Assignees
Labels
module: devtools Issues related to developer tools and code under devtools/ module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@liye0626
Copy link

liye0626 commented Mar 7, 2025

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

@iseeyuan iseeyuan added module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ module: devtools Issues related to developer tools and code under devtools/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Mar 7, 2025
@Jack-Khuu
Copy link
Contributor

cc: @Gasoonjia @tarun292 for delegate debugging

@Gasoonjia
Copy link
Contributor

Hi @liye0626, can you share me more details about how you try to log the delegation intermediate outputs for xnnpack backend?

@Gasoonjia
Copy link
Contributor

Have you bundled any input along with your program?

@Gasoonjia
Copy link
Contributor

You can always restart the issue if it is still unsolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: devtools Issues related to developer tools and code under devtools/ module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
Development

No branches or pull requests

4 participants