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

GPU traces fail when using PyTorch lightning due to square braces in traceName #888

Open
agkphysics opened this issue Mar 8, 2024 · 2 comments
Labels
bug Something isn't working plugin PyTorch Profiler TensorBoard Plugin related

Comments

@agkphysics
Copy link

PyTorch Lightning saves traces in the format fit-profiler-[Strategy]SingleDeviceStrategy-ts.pt.trace.json, and thus the traceName key contains a square brace ]. Since the traceName key is the final key in the JSON file, it fails to load in the TensorBoard viewer when GPU ops are present due to this line, which cuts off the string and creates invalid JSON:

raw_data_without_tail = raw_data[: raw_data.rfind(b']')]

This results in the error Uncaught (in promise) SyntaxError: JSON.parse, ... in the web browser.

@aaronenyeshi aaronenyeshi added the bug Something isn't working label Mar 8, 2024
@briancoutinho
Copy link
Contributor

@agkphysics would this catch this issue
51fd6e6

@agkphysics
Copy link
Author

@briancoutinho No I don't think this would help because this just seems to replace forward slashes and remove newlines from JSON strings. The issue is how the GPU stats are appended to the file before being passed to the trace viewer.

@sraikund16 sraikund16 added the plugin PyTorch Profiler TensorBoard Plugin related label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin PyTorch Profiler TensorBoard Plugin related
Projects
None yet
Development

No branches or pull requests

4 participants