ttnn-visualizer 0.41.0__py3-none-any.whl → 0.43.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/__init__.py +0 -1
- ttnn_visualizer/app.py +15 -4
- ttnn_visualizer/csv_queries.py +150 -40
- ttnn_visualizer/decorators.py +42 -16
- ttnn_visualizer/exceptions.py +45 -1
- ttnn_visualizer/file_uploads.py +1 -0
- ttnn_visualizer/instances.py +42 -15
- ttnn_visualizer/models.py +12 -7
- ttnn_visualizer/queries.py +3 -109
- ttnn_visualizer/remote_sqlite_setup.py +104 -19
- ttnn_visualizer/requirements.txt +2 -3
- ttnn_visualizer/serializers.py +1 -0
- ttnn_visualizer/settings.py +9 -5
- ttnn_visualizer/sftp_operations.py +657 -220
- ttnn_visualizer/sockets.py +9 -3
- ttnn_visualizer/static/assets/{allPaths-4_pFqSAW.js → allPaths-BQN_j7ek.js} +1 -1
- ttnn_visualizer/static/assets/{allPathsLoader-CpLPTLlt.js → allPathsLoader-BvkkQ77q.js} +2 -2
- ttnn_visualizer/static/assets/index-B-fsa5Ru.js +1 -0
- ttnn_visualizer/static/assets/{index-DFVwehlj.js → index-Bng0kcmi.js} +214 -214
- ttnn_visualizer/static/assets/{index-C1rJBrMl.css → index-C-t6jBt9.css} +1 -1
- ttnn_visualizer/static/assets/index-DLOviMB1.js +1 -0
- ttnn_visualizer/static/assets/{splitPathsBySizeLoader-D-RvsTqO.js → splitPathsBySizeLoader-Cl0NRdfL.js} +1 -1
- ttnn_visualizer/static/index.html +2 -2
- ttnn_visualizer/tests/__init__.py +0 -1
- ttnn_visualizer/tests/test_queries.py +0 -69
- ttnn_visualizer/tests/test_serializers.py +2 -2
- ttnn_visualizer/utils.py +7 -3
- ttnn_visualizer/views.py +315 -52
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/LICENSE +0 -1
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/METADATA +6 -3
- ttnn_visualizer-0.43.0.dist-info/RECORD +45 -0
- ttnn_visualizer/ssh_client.py +0 -85
- ttnn_visualizer/static/assets/index-BKzgFDAn.js +0 -1
- ttnn_visualizer/static/assets/index-BvSuWPlB.js +0 -1
- ttnn_visualizer-0.41.0.dist-info/RECORD +0 -46
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/LICENSE_understanding.txt +0 -0
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/WHEEL +0 -0
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/entry_points.txt +0 -0
- {ttnn_visualizer-0.41.0.dist-info → ttnn_visualizer-0.43.0.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{_ as o,a as _,b as i,p as c,I as u}from"./index-
|
1
|
+
import{_ as o,a as _,b as i,p as c,I as u}from"./index-Bng0kcmi.js";var p=function(n,s){return o(void 0,void 0,void 0,function(){var a,r;return _(this,function(e){switch(e.label){case 0:return a=c(n),s!==u.STANDARD?[3,2]:[4,i(()=>import("./index-DLOviMB1.js").then(t=>t.I),[])];case 1:return r=e.sent(),[3,4];case 2:return[4,i(()=>import("./index-B-fsa5Ru.js").then(t=>t.I),[])];case 3:r=e.sent(),e.label=4;case 4:return[2,r[a]]}})})};export{p as splitPathsBySizeLoader};
|
@@ -34,8 +34,8 @@
|
|
34
34
|
/* SERVER_CONFIG */
|
35
35
|
</script>
|
36
36
|
|
37
|
-
<script type="module" crossorigin src="/static/assets/index-
|
38
|
-
<link rel="stylesheet" crossorigin href="/static/assets/index-
|
37
|
+
<script type="module" crossorigin src="/static/assets/index-Bng0kcmi.js"></script>
|
38
|
+
<link rel="stylesheet" crossorigin href="/static/assets/index-C-t6jBt9.css">
|
39
39
|
</head>
|
40
40
|
<body>
|
41
41
|
|
@@ -16,7 +16,6 @@ from ttnn_visualizer.models import (
|
|
16
16
|
)
|
17
17
|
from ttnn_visualizer.queries import DatabaseQueries
|
18
18
|
from ttnn_visualizer.queries import LocalQueryRunner
|
19
|
-
from ttnn_visualizer.queries import RemoteQueryRunner
|
20
19
|
|
21
20
|
|
22
21
|
class TestQueryTable(unittest.TestCase):
|
@@ -222,15 +221,6 @@ class TestDatabaseQueries(unittest.TestCase):
|
|
222
221
|
str(context.exception),
|
223
222
|
)
|
224
223
|
|
225
|
-
@patch("ttnn_visualizer.queries.get_client")
|
226
|
-
def test_init_with_valid_remote_instance(self, _mock_client):
|
227
|
-
mock_instance = Mock()
|
228
|
-
mock_instance.remote_connection = Mock(useRemoteQuerying=True)
|
229
|
-
mock_instance.remote_connection.sqliteBinaryPath = "/usr/bin/sqlite3"
|
230
|
-
mock_instance.remote_profiler_folder = Mock(remotePath="/remote/path")
|
231
|
-
db_queries = DatabaseQueries(instance=mock_instance)
|
232
|
-
self.assertIsInstance(db_queries.query_runner, RemoteQueryRunner)
|
233
|
-
|
234
224
|
def test_init_with_valid_local_instance(self):
|
235
225
|
with tempfile.NamedTemporaryFile(suffix=".sqlite") as temp_db_file:
|
236
226
|
connection = sqlite3.connect(temp_db_file.name)
|
@@ -381,64 +371,5 @@ class TestDatabaseQueries(unittest.TestCase):
|
|
381
371
|
self.assertEqual(result.operation_id, 2)
|
382
372
|
|
383
373
|
|
384
|
-
class TestRemoteQueryRunner(unittest.TestCase):
|
385
|
-
|
386
|
-
def setUp(self):
|
387
|
-
self.mock_instance = Mock()
|
388
|
-
self.mock_instance.remote_connection.sqliteBinaryPath = "/usr/bin/sqlite3"
|
389
|
-
self.mock_instance.remote_connection.host = "mockhost"
|
390
|
-
self.mock_instance.remote_connection.user = "mockuser"
|
391
|
-
self.mock_instance.remote_profiler_folder.remotePath = "/remote/db"
|
392
|
-
|
393
|
-
@patch("ttnn_visualizer.queries.get_client")
|
394
|
-
def test_init_with_mock_get_client(self, mock_get_client):
|
395
|
-
# Mock the SSHClient returned by get_client
|
396
|
-
mock_ssh_client = Mock()
|
397
|
-
mock_get_client.return_value = mock_ssh_client
|
398
|
-
|
399
|
-
runner = RemoteQueryRunner(instance=self.mock_instance)
|
400
|
-
self.assertEqual(runner.ssh_client, mock_ssh_client)
|
401
|
-
mock_get_client.assert_called_once_with(
|
402
|
-
remote_connection=self.mock_instance.remote_connection
|
403
|
-
)
|
404
|
-
|
405
|
-
@patch("ttnn_visualizer.queries.get_client")
|
406
|
-
def test_execute_query(self, mock_get_client):
|
407
|
-
# Mock the SSH client
|
408
|
-
mock_ssh_client = Mock()
|
409
|
-
mock_get_client.return_value = mock_ssh_client
|
410
|
-
|
411
|
-
mock_stdout = Mock()
|
412
|
-
mock_stdout.read.return_value = b'[{"col1": "value1", "col2": "value2"}]'
|
413
|
-
mock_stderr = Mock()
|
414
|
-
mock_stderr.read.return_value = b""
|
415
|
-
mock_ssh_client.exec_command.return_value = (None, mock_stdout, mock_stderr)
|
416
|
-
|
417
|
-
runner = RemoteQueryRunner(instance=self.mock_instance)
|
418
|
-
|
419
|
-
query = "SELECT * FROM table WHERE id = ?"
|
420
|
-
params = [1]
|
421
|
-
results = runner.execute_query(query, params)
|
422
|
-
|
423
|
-
# Validate results
|
424
|
-
self.assertEqual(results, [("value1", "value2")])
|
425
|
-
mock_get_client.assert_called_once()
|
426
|
-
mock_ssh_client.exec_command.assert_called_once()
|
427
|
-
|
428
|
-
@patch("ttnn_visualizer.queries.get_client")
|
429
|
-
def test_close(self, mock_get_client):
|
430
|
-
# Mock the SSH client
|
431
|
-
mock_ssh_client = Mock()
|
432
|
-
mock_get_client.return_value = mock_ssh_client
|
433
|
-
|
434
|
-
runner = RemoteQueryRunner(instance=self.mock_instance)
|
435
|
-
|
436
|
-
runner.close()
|
437
|
-
mock_ssh_client.close.assert_called_once()
|
438
|
-
|
439
|
-
def tearDown(self):
|
440
|
-
pass
|
441
|
-
|
442
|
-
|
443
374
|
if __name__ == "__main__":
|
444
375
|
unittest.main()
|
@@ -361,7 +361,7 @@ class TestSerializers(unittest.TestCase):
|
|
361
361
|
1,
|
362
362
|
1000,
|
363
363
|
BufferType.DRAM,
|
364
|
-
[200, 300]
|
364
|
+
[200, 300],
|
365
365
|
)
|
366
366
|
]
|
367
367
|
devices = [
|
@@ -415,7 +415,7 @@ class TestSerializers(unittest.TestCase):
|
|
415
415
|
"operation_id": 1,
|
416
416
|
"producers": [2],
|
417
417
|
"shape": "shape1",
|
418
|
-
"device_addresses": [200, 300]
|
418
|
+
"device_addresses": [200, 300],
|
419
419
|
}
|
420
420
|
],
|
421
421
|
"l1_sizes": [256],
|
ttnn_visualizer/utils.py
CHANGED
@@ -88,13 +88,16 @@ def get_profiler_path(profiler_name, current_app, remote_connection=None):
|
|
88
88
|
else:
|
89
89
|
base_dir = local_dir
|
90
90
|
|
91
|
-
profiler_path =
|
91
|
+
profiler_path = (
|
92
|
+
base_dir / current_app.config["PROFILER_DIRECTORY_NAME"] / profiler_name
|
93
|
+
)
|
92
94
|
target_path = profiler_path / database_file_name
|
93
95
|
|
94
96
|
return str(target_path)
|
95
97
|
else:
|
96
98
|
return ""
|
97
99
|
|
100
|
+
|
98
101
|
def get_npe_path(npe_name, current_app):
|
99
102
|
local_dir = Path(current_app.config["LOCAL_DATA_DIRECTORY"])
|
100
103
|
|
@@ -107,7 +110,9 @@ def get_cluster_descriptor_path(instance):
|
|
107
110
|
if not instance.profiler_path:
|
108
111
|
return None
|
109
112
|
|
110
|
-
cluster_descriptor_path = Path(instance.profiler_path).parent / Path(
|
113
|
+
cluster_descriptor_path = Path(instance.profiler_path).parent / Path(
|
114
|
+
"cluster_descriptor.yaml"
|
115
|
+
)
|
111
116
|
|
112
117
|
if not cluster_descriptor_path.exists():
|
113
118
|
return None
|
@@ -191,4 +196,3 @@ def read_version_from_package_json() -> str:
|
|
191
196
|
raise FileNotFoundError(f"The file {file_path} was not found.")
|
192
197
|
except KeyError:
|
193
198
|
raise KeyError("The 'version' key was not found in the package.json file.")
|
194
|
-
|