-
Notifications
You must be signed in to change notification settings - Fork 487
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
Export debug information to StableHLO #7014
Comments
cc @JackCaoG |
@JackCaoG I see, the stack trace can also be found in metadata of the fx node, e.g. ipdb> nodes = list(ep.graph.nodes)
ipdb> nodes[2].meta
{'stack_trace': ' File "/home/thonle/ai/data/stablehlo/add/add.py", line 7, in forward\n a += 1\n', 'nn_module_stack': {'L__self__': ('', <class '__main__.Test'>)}, 'source_fn_stack': [('iadd', <built-in function iadd>)], 'original_aten': <OpOverload(op='aten.add', overload='Tensor')>, 'from_node': [('a', <built-in function iadd>)], 'seq_nr': -1, 'val': FakeTensor(..., size=(1, 5)), 'tensor_meta': TensorMetadata(shape=torch.Size([1, 5]), dtype=torch.float32, requires_grad=False, stride=(5, 1), memory_format=torch.contiguous_format, is_quantized=False, qparams={})} two follow-up questions,
|
thanks @JackCaoG, are you aware of existing tool for (2)? |
There is this #5461 but I never used it myself. |
@thong3le If you turn on the env var |
@lsy323 thanks, is there any plan to propagate |
I also have a similar feature request and wonder if there is a plan to propagate any metadata in |
I'm curious what bits of the metadata are important? File-line-col info? |
The support is added in #7046 |
❓ Questions and Help
Hi team, the debugging information is lost during
exported_program_to_stablehlo
, is there a way to export this information?For example,
torch.export
generates file and line number for each op,however, when we export to stablehlo, we couldn't find this information in
StableHLOModelBundle
.The text was updated successfully, but these errors were encountered: