ttnn-visualizer 0.45.0__py3-none-any.whl → 0.47.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ttnn_visualizer/app.py +36 -1
- ttnn_visualizer/csv_queries.py +2 -1
- ttnn_visualizer/decorators.py +3 -3
- ttnn_visualizer/file_uploads.py +1 -1
- ttnn_visualizer/settings.py +1 -0
- ttnn_visualizer/sftp_operations.py +23 -8
- ttnn_visualizer/static/assets/allPaths-OR2-IW-_.js +1 -0
- ttnn_visualizer/static/assets/allPathsLoader-xRXweacG.js +2 -0
- ttnn_visualizer/static/assets/index-03c8d4Gh.js +1 -0
- ttnn_visualizer/static/assets/{index-BgTcwiDZ.js → index-CmA3KkTi.js} +390 -390
- ttnn_visualizer/static/assets/index-DJA68-a6.css +7 -0
- ttnn_visualizer/static/assets/index-PKNBViIU.js +1 -0
- ttnn_visualizer/static/assets/splitPathsBySizeLoader-P9sdNg6R.js +1 -0
- ttnn_visualizer/static/index.html +2 -2
- ttnn_visualizer/utils.py +190 -28
- ttnn_visualizer/views.py +32 -30
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/METADATA +4 -3
- ttnn_visualizer-0.47.0.dist-info/RECORD +43 -0
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/licenses/LICENSE +95 -45
- ttnn_visualizer/static/assets/allPaths-CWDYwlGf.js +0 -1
- ttnn_visualizer/static/assets/allPathsLoader-CWMmYjN2.js +0 -2
- ttnn_visualizer/static/assets/index-B-fsa5Ru.js +0 -1
- ttnn_visualizer/static/assets/index-DLOviMB1.js +0 -1
- ttnn_visualizer/static/assets/index-cjyfcubn.css +0 -7
- ttnn_visualizer/static/assets/splitPathsBySizeLoader-BHSjwVae.js +0 -1
- ttnn_visualizer-0.45.0.dist-info/RECORD +0 -43
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/WHEEL +0 -0
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/entry_points.txt +0 -0
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/licenses/LICENSE_understanding.txt +0 -0
- {ttnn_visualizer-0.45.0.dist-info → ttnn_visualizer-0.47.0.dist-info}/top_level.txt +0 -0
ttnn_visualizer/app.py
CHANGED
@@ -25,6 +25,7 @@ from ttnn_visualizer.exceptions import (
|
|
25
25
|
)
|
26
26
|
from ttnn_visualizer.instances import create_instance_from_local_paths
|
27
27
|
from ttnn_visualizer.settings import Config, DefaultConfig
|
28
|
+
from ttnn_visualizer.utils import create_path_resolver
|
28
29
|
from werkzeug.debug import DebuggedApplication
|
29
30
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
30
31
|
|
@@ -78,6 +79,7 @@ def create_app(settings_override=None):
|
|
78
79
|
js_config = {
|
79
80
|
"SERVER_MODE": app.config["SERVER_MODE"],
|
80
81
|
"BASE_PATH": app.config["BASE_PATH"],
|
82
|
+
"TT_METAL_HOME": app.config["TT_METAL_HOME"],
|
81
83
|
}
|
82
84
|
js = f"window.TTNN_VISUALIZER_CONFIG = {json.dumps(js_config)};"
|
83
85
|
|
@@ -192,6 +194,9 @@ def parse_args():
|
|
192
194
|
parser.add_argument(
|
193
195
|
"--performance-path", help="Specify a performance path", default=None
|
194
196
|
)
|
197
|
+
parser.add_argument(
|
198
|
+
"--tt-metal-home", help="Specify a TT-Metal home path", default=None
|
199
|
+
)
|
195
200
|
return parser.parse_args()
|
196
201
|
|
197
202
|
|
@@ -220,10 +225,40 @@ def main():
|
|
220
225
|
|
221
226
|
instance_id = session.instance_id
|
222
227
|
|
228
|
+
if args.tt_metal_home:
|
229
|
+
config.TT_METAL_HOME = args.tt_metal_home
|
230
|
+
|
231
|
+
# Display mode information
|
232
|
+
app = create_app()
|
233
|
+
with app.app_context():
|
234
|
+
resolver = create_path_resolver(app)
|
235
|
+
mode_info = resolver.get_mode_info()
|
236
|
+
|
237
|
+
if mode_info["mode"] == "tt_metal":
|
238
|
+
print(
|
239
|
+
"🚀 TT-METAL MODE: Working directly with tt-metal generated directory"
|
240
|
+
)
|
241
|
+
print(f" TT_METAL_HOME: {mode_info['tt_metal_home']}")
|
242
|
+
print(f" Profiler reports: {mode_info['profiler_base']}")
|
243
|
+
print(f" Performance reports: {mode_info['performance_base']}")
|
244
|
+
|
245
|
+
# Validate setup
|
246
|
+
is_valid, message = resolver.validate_tt_metal_setup()
|
247
|
+
if is_valid:
|
248
|
+
print(f" ✓ {message}")
|
249
|
+
else:
|
250
|
+
print(f" ⚠️ Warning: {message}")
|
251
|
+
else:
|
252
|
+
print(
|
253
|
+
"📁 UPLOAD/SYNC MODE: Using local data directory for uploaded/synced reports"
|
254
|
+
)
|
255
|
+
print(f" Local directory: {mode_info['local_dir']}")
|
256
|
+
print(f" Remote directory: {mode_info['remote_dir']}")
|
257
|
+
|
223
258
|
# Check if DEBUG environment variable is set
|
224
259
|
debug_mode = os.environ.get("DEBUG", "false").lower() == "true"
|
225
260
|
if config.PRINT_ENV:
|
226
|
-
print("
|
261
|
+
print("\nENVIRONMENT:")
|
227
262
|
for key, value in config.to_dict().items():
|
228
263
|
print(f"{key}={value}")
|
229
264
|
|
ttnn_visualizer/csv_queries.py
CHANGED
ttnn_visualizer/decorators.py
CHANGED
@@ -90,13 +90,13 @@ def remote_exception_handler(func):
|
|
90
90
|
current_app.logger.error(f"File not found: {str(err)}")
|
91
91
|
raise RemoteConnectionException(
|
92
92
|
status=ConnectionTestStates.FAILED,
|
93
|
-
message=f"Unable to open path
|
93
|
+
message=f"Unable to open path: {str(err)}",
|
94
94
|
)
|
95
95
|
except NoProjectsException as err:
|
96
96
|
current_app.logger.error(f"No projects: {str(err)}")
|
97
97
|
raise RemoteConnectionException(
|
98
98
|
status=ConnectionTestStates.FAILED,
|
99
|
-
message=f"No projects found at remote location: {
|
99
|
+
message=f"No projects found at remote location: {str(err)}",
|
100
100
|
)
|
101
101
|
except NoValidConnectionsError as err:
|
102
102
|
current_app.logger.warning(
|
@@ -124,7 +124,7 @@ def remote_exception_handler(func):
|
|
124
124
|
status=ConnectionTestStates.FAILED, message=message
|
125
125
|
)
|
126
126
|
except IOError as err:
|
127
|
-
message = f"Error opening remote folder
|
127
|
+
message = f"Error opening remote folder: {str(err)}"
|
128
128
|
if "Name or service not known" in str(err):
|
129
129
|
message = f"Unable to connect to {connection.host} - check hostname"
|
130
130
|
raise RemoteConnectionException(
|
ttnn_visualizer/file_uploads.py
CHANGED
ttnn_visualizer/settings.py
CHANGED
@@ -42,6 +42,7 @@ class DefaultConfig(object):
|
|
42
42
|
APPLICATION_DIR = os.path.abspath(os.path.join(__file__, "..", os.pardir))
|
43
43
|
APP_DATA_DIRECTORY = os.getenv("APP_DATA_DIRECTORY", APPLICATION_DIR)
|
44
44
|
STATIC_ASSETS_DIR = Path(APPLICATION_DIR).joinpath("ttnn_visualizer", "static")
|
45
|
+
TT_METAL_HOME = os.getenv("TT_METAL_HOME", None)
|
45
46
|
SEND_FILE_MAX_AGE_DEFAULT = 0
|
46
47
|
|
47
48
|
LAUNCH_BROWSER_ON_START = str_to_bool(os.getenv("LAUNCH_BROWSER_ON_START", "true"))
|
@@ -4,7 +4,6 @@
|
|
4
4
|
|
5
5
|
import json
|
6
6
|
import logging
|
7
|
-
import re
|
8
7
|
import subprocess
|
9
8
|
import time
|
10
9
|
from pathlib import Path
|
@@ -16,9 +15,7 @@ from flask import current_app
|
|
16
15
|
from ttnn_visualizer.decorators import remote_exception_handler
|
17
16
|
from ttnn_visualizer.enums import ConnectionTestStates
|
18
17
|
from ttnn_visualizer.exceptions import (
|
19
|
-
AuthenticationException,
|
20
18
|
NoProjectsException,
|
21
|
-
NoValidConnectionsError,
|
22
19
|
RemoteConnectionException,
|
23
20
|
SSHException,
|
24
21
|
)
|
@@ -623,14 +620,30 @@ def read_remote_file(
|
|
623
620
|
|
624
621
|
@remote_exception_handler
|
625
622
|
def check_remote_path_for_reports(remote_connection):
|
626
|
-
|
627
|
-
remote_config_paths = find_folders_by_files(
|
623
|
+
remote_profiler_paths = find_folders_by_files(
|
628
624
|
remote_connection, remote_connection.profilerPath, [TEST_CONFIG_FILE]
|
629
625
|
)
|
630
|
-
|
626
|
+
|
627
|
+
remote_performance_paths = find_folders_by_files(
|
628
|
+
remote_connection, remote_connection.performancePath, [TEST_PROFILER_FILE]
|
629
|
+
)
|
630
|
+
|
631
|
+
errors = []
|
632
|
+
if not remote_profiler_paths and remote_connection.profilerPath:
|
633
|
+
errors.append(
|
634
|
+
f"No matching profiler projects found: {remote_connection.profilerPath}"
|
635
|
+
)
|
636
|
+
if not remote_performance_paths and remote_connection.performancePath:
|
637
|
+
errors.append(
|
638
|
+
f"No matching performance projects found: {remote_connection.performancePath}"
|
639
|
+
)
|
640
|
+
|
641
|
+
if errors:
|
631
642
|
raise NoProjectsException(
|
632
|
-
message="
|
643
|
+
message="; ".join(errors),
|
644
|
+
status=ConnectionTestStates.FAILED,
|
633
645
|
)
|
646
|
+
|
634
647
|
return True
|
635
648
|
|
636
649
|
|
@@ -648,8 +661,10 @@ def check_remote_path_exists(remote_connection: RemoteConnection, path_key: str)
|
|
648
661
|
# Directory does not exist or is inaccessible
|
649
662
|
if path_key == "performancePath":
|
650
663
|
message = "Performance directory does not exist or cannot be accessed"
|
651
|
-
|
664
|
+
if path_key == "profilerPath":
|
652
665
|
message = "Profiler directory does not exist or cannot be accessed"
|
666
|
+
else:
|
667
|
+
message = f"Remote path '{path}' does not exist or cannot be accessed"
|
653
668
|
|
654
669
|
logger.error(message)
|
655
670
|
raise RemoteConnectionException(
|
@@ -0,0 +1 @@
|
|
1
|
+
import{I as s}from"./index-03c8d4Gh.js";import{I as r}from"./index-PKNBViIU.js";import{p as n,I as c}from"./index-CmA3KkTi.js";function p(t,a){const o=n(t);return a===c.STANDARD?s[o]:r[o]}export{s as IconSvgPaths16,r as IconSvgPaths20,p as getIconPaths};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/allPaths-OR2-IW-_.js","assets/index-03c8d4Gh.js","assets/index-PKNBViIU.js","assets/index-CmA3KkTi.js","assets/index-DJA68-a6.css"])))=>i.map(i=>d[i]);
|
2
|
+
import{_ as e}from"./index-CmA3KkTi.js";const s=async(t,a)=>{const{getIconPaths:o}=await e(async()=>{const{getIconPaths:r}=await import("./allPaths-OR2-IW-_.js");return{getIconPaths:r}},__vite__mapDeps([0,1,2,3,4]));return o(t,a)};export{s as allPathsLoader};
|