Skip to content
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

Do something with describe_tensor/describe_storage outputs #69

Open
ezyang opened this issue Oct 1, 2024 · 0 comments
Open

Do something with describe_tensor/describe_storage outputs #69

ezyang opened this issue Oct 1, 2024 · 0 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Oct 1, 2024

Sample:

V0925 13:05:39.630000 713625 /data/users/grigorysizov/fbsource/fbcode/caffe2/torch/_subclasses/meta_utils.py:204] {"describe_storage": {"id": 1, "describer_id": 0, "size": 40}, "rank": 0, "frame_id": 0, "frame_compile_id": 0, "attempt": 0}
V0925 13:05:39.631000 713625 /data/users/grigorysizov/fbsource/fbcode/caffe2/torch/_subclasses/meta_utils.py:417] {"describe_tensor": {"id": 1, "ndim": 2, "dtype": "torch.int64", "device": "device(type='cuda', index=0)", "size": [1, 4], "dynamo_dynamic_indices": [0], "is_inference": true, "is_leaf": true, "stride": [5, 1], "storage_offset": 1, "storage": 1, "view_func": "<built-in method _view_func_unsafe of Tensor object at 0x7ecbb75a1080>", "describer_id": 0}, "rank": 0, "frame_id": 0, "frame_compile_id": 0, "attempt": 0}
V0925 13:05:39.631000 713625 /data/users/grigorysizov/fbsource/fbcode/caffe2/torch/_subclasses/meta_utils.py:1640] {"describe_source": {"describer_id": 0, "id": 1, "source": "L['draft_tokens']"}, "rank": 0, "frame_id": 0, "frame_compile_id": 0, "attempt": 0}V0925 13:05:39.660000 713625 /data/users/grigorysizov/fbsource/fbcode/caffe2/torch/_subclasses/meta_utils.py:204] {"describe_storage": {"id": 2, "describer_id": 0, "size": 2052096}, "rank": 0, "frame_id": 0, "frame_compile_id": 0, "attempt": 0}

These give a detailed description of all the input tensors into compile. I recently used this to aid me in constructing a minimal test case where input size/stride details were important. Maybe a good way to render these is to transform them into equivalent PyTorch code that would construct them, perhaps by using MetaConverter directly (which is what these are fed into). Note that view_func was not successfully serialized, so you need to do something funny instead for that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant