KEMBAR78
[profiler] Show shapes for lists of tensors in chrome traces · Issue #109263 · pytorch/pytorch · GitHub
Skip to content

[profiler] Show shapes for lists of tensors in chrome traces #109263

@davidberard98

Description

@davidberard98

🚀 The feature, motivation and pitch

When profiling with record_shapes=True, chrome traces show shapes for tensors; but not for lists of tensors. It would be helpful if we also saw shape info for lists of tensors.

Suggestions:

  • Build a local script that you can use for testing. It can be basic - just run a few basic pytorch ops, and then run with the profiler with the record_shapes=True option turned on. Then export the chrome trace, and view it in chrome://tracing. Example script https://gist.github.com/davidberard98/a9711961a78f50b1b0eff530322848df - note that torch.cat takes a list of tensors, so it's a good op for testing here. Verify that when you click on the op, it shows some shape information.
  • See [profiler] When record_inputs=True, record scalar lists of length <= 30 #100593 for a similar change (focus on the changes in profiler_kineto.cpp). Note that the referenced PR adds support for both collecting and displaying the information; in this case, collection is already done; you'll just need to display the info
  • To avoid making traces too much larger, you should probably limit to, say, the first 30 elements if list of tensors has >30 elements.
  • For now you can probably just display the information in the chrome trace, and not add it into the KinetoEvent. (You could do that too, if you want)
  • Add a test

Alternatives

No response

Additional context

No response

cc @robieta @chaekit @aaronenyeshi @nbcsm @guotuofeng @guyang3532 @gaoteng-git @tiffzhaofb @dzhulgakov

Metadata

Metadata

Assignees

Labels

oncall: profilerprofiler-related issues (cpu, gpu, kineto)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions