Skip to content

Add option to load reports directly from TT_METAL_HOME directory #746

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

Merged
merged 8 commits into from
Aug 13, 2025

Conversation

smountenay-tt
Copy link
Contributor

@smountenay-tt smountenay-tt commented Aug 13, 2025

This PR adds a new way of loading the report data into ttnn-visualizer, by loading the data directly from the TT-Metal generated directory.

The ordinary use case is for the Visualizer to run locally, say on a developer's laptop. The reports are typically being generated on remote machines or docker containers, that are running on Tenstorrent hardware. The main way of getting data into ttnn-visualizer has been to run ttnn-visualizer locally on the dev's local machine, and have them upload reports that they have downloaded from the remote machine/container, or to sync the reports from the remote machine/container using the remote sync feature, which downloads them to the machine where ttnn-visualizer is running.

This PR enables a new way of running ttnn-visualizer, which is directly on the remote machine/container TT-Metal is being used. If --tt-metal-home CLI arg is passed, or TT_METAL_HOME env var is set when ttnn-visualizer runs, then it switches to "TT Metal Mode", in which it loads the reports directly from the $TT_METAL_HOME/generated/ttnn/reports and $TT_METAL_HOME/generated/profiler/reports directories, as opposed to the Visualizer's own data/local and data/remote directories.

When "TT Metal Mode" is enabled, the upload report and remote sync features are disabled, and the Visualizer with only show the reports from $TT_METAL_HOME.

This is intended to be used when running the Visualizer on the Tenstorrent machines directly, and should not be used when running the Visualizer on local dev machines, such as Macbooks.

User's will need to make sure that they are able to access the Visualizer on the remote machine, such as by mapping ports from the dev containers to host ports and can access the remote machines from their local machine where they are running their browser.

[Closes #747]

@@ -15,6 +15,7 @@ function Home() {
useClearSelectedBuffer();

const isServerMode = !!getServerConfig()?.SERVER_MODE;
const isTtMetalMode = !!getServerConfig()?.TT_METAL_HOME;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inOnDeviceMode? i dont think ttmetal mode is representative

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about isLocalTtMetal @aidemsined ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and renamed isTtMetalMode to isLocalTtMetal, frontend and backend.

Copy link
Contributor

@aidemsined aidemsined left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per comments


generated_dir = tt_metal_base / "generated"
if not generated_dir.exists():
return False, f"TT-Metal generated directory not found: {generated_dir}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a fatal error? It's true it might not exist, but then there are no reports so the visualizer isn't useful anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it should not be fatal if the tt-metal/generated directory does not exist, because the visualizer could be running on the machine before any reports have been generated.

The direction we are going is that ideally the visualizer would be available in the containers automatically when the container is brought up. In the case that ttnn-visualizer is automatically installed when creating the container, the tt-metal directory may not exist yet. Additionally, the tt-metal/generated directory does not exist until pytest has actually been run. But the idea is we are making this tool an option when the containers are created so we should make sure the UI still comes up.

It's a good point though.

@smountenay-tt smountenay-tt merged commit d2738ba into dev Aug 13, 2025
9 checks passed
@smountenay-tt smountenay-tt deleted the feature/generated_dir branch August 13, 2025 18:32
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

Successfully merging this pull request may close these issues.

Add option to load reports directly from tt-metal generated directory
3 participants