ttnn-visualizer 0.52.1__py3-none-any.whl → 0.53.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 CHANGED
@@ -265,6 +265,8 @@ def main():
265
265
 
266
266
  gunicorn_args = [
267
267
  "gunicorn",
268
+ "-t",
269
+ config.GUNICORN_TIMEOUT,
268
270
  "-k",
269
271
  config.GUNICORN_WORKER_CLASS,
270
272
  "-w",
@@ -437,6 +437,10 @@ class OpsPerformanceReportQueries:
437
437
  DEFAULT_ID_RANGE = None
438
438
  DEFAULT_NO_ADVICE = False
439
439
  DEFAULT_TRACING_MODE = False
440
+ DEFAULT_RAW_OP_CODES = True
441
+ DEFAULT_NO_HOST_OPS = False
442
+ DEFAULT_NO_STACKED_REPORT = False
443
+ DEFAULT_NO_STACK_BY_IN0 = True
440
444
 
441
445
  @classmethod
442
446
  def generate_report(cls, instance):
@@ -457,10 +461,10 @@ class OpsPerformanceReportQueries:
457
461
  csv_output_file,
458
462
  cls.DEFAULT_NO_ADVICE,
459
463
  cls.DEFAULT_TRACING_MODE,
460
- True,
461
- True,
462
- False,
463
- True, # no_stack_by_in0 - need to ask what this is
464
+ cls.DEFAULT_RAW_OP_CODES,
465
+ cls.DEFAULT_NO_HOST_OPS,
466
+ cls.DEFAULT_NO_STACKED_REPORT,
467
+ cls.DEFAULT_NO_STACK_BY_IN0,
464
468
  csv_stacked_output_file,
465
469
  )
466
470
  except Exception as e:
@@ -190,14 +190,25 @@ def serialize_operation(
190
190
 
191
191
 
192
192
  def serialize_operation_buffers(operation: Operation, operation_buffers):
193
- buffer_data = [b.to_dict() for b in operation_buffers]
194
- for b in buffer_data:
195
- b.pop("operation_id")
196
- b.update({"size": b.pop("max_size_per_bank")})
193
+ buffer_data = []
194
+ for b in operation_buffers:
195
+ buffer_dict = {
196
+ "device_id": b.device_id,
197
+ "address": b.address,
198
+ "buffer_type": (
199
+ b.buffer_type.value
200
+ if hasattr(b.buffer_type, "value")
201
+ else b.buffer_type
202
+ ),
203
+ "buffer_layout": b.buffer_layout,
204
+ "size": b.max_size_per_bank,
205
+ }
206
+ buffer_data.append(buffer_dict)
207
+
197
208
  return {
198
209
  "id": operation.operation_id,
199
210
  "name": operation.name,
200
- "buffers": list(buffer_data),
211
+ "buffers": buffer_data,
201
212
  }
202
213
 
203
214
 
@@ -206,14 +217,33 @@ def serialize_devices(devices):
206
217
 
207
218
 
208
219
  def serialize_operations_buffers(operations, buffers):
209
- buffer_dict = defaultdict(list)
220
+ # Pre-serialize all buffers once using optimized method with defaultdict
221
+ serialized_buffers = defaultdict(list)
210
222
  for b in buffers:
211
- buffer_dict[b.operation_id].append(b)
223
+ buffer_dict = {
224
+ "device_id": b.device_id,
225
+ "address": b.address,
226
+ "buffer_type": (
227
+ b.buffer_type.value
228
+ if hasattr(b.buffer_type, "value")
229
+ else b.buffer_type
230
+ ),
231
+ "buffer_layout": b.buffer_layout,
232
+ "size": b.max_size_per_bank,
233
+ }
234
+ serialized_buffers[b.operation_id].append(buffer_dict)
212
235
 
213
236
  results = []
214
237
  for operation in operations:
215
- operation_buffers = buffer_dict.get(operation.operation_id, [])
216
- results.append(serialize_operation_buffers(operation, operation_buffers))
238
+ operation_buffers = serialized_buffers[operation.operation_id]
239
+ results.append(
240
+ {
241
+ "id": operation.operation_id,
242
+ "name": operation.name,
243
+ "buffers": operation_buffers,
244
+ }
245
+ )
246
+
217
247
  return results
218
248
 
219
249
 
@@ -68,6 +68,7 @@ class DefaultConfig(object):
68
68
  # Gunicorn settings
69
69
  GUNICORN_WORKER_CLASS = os.getenv("GUNICORN_WORKER_CLASS", "gevent")
70
70
  GUNICORN_WORKERS = os.getenv("GUNICORN_WORKERS", "1")
71
+ GUNICORN_TIMEOUT = os.getenv("GUNICORN_TIMEOUT", "60")
71
72
  PORT = os.getenv("PORT", "8000")
72
73
  HOST = os.getenv("HOST", "localhost")
73
74
  DEV_SERVER_PORT = "5173"
@@ -1 +1 @@
1
- import{I as s}from"./index-CnPrfHYh.js";import{I as r}from"./index-Cnc1EkDo.js";import{p as n,I as c}from"./index-WayH7MCF.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};
1
+ import{I as s}from"./index-CnPrfHYh.js";import{I as r}from"./index-Cnc1EkDo.js";import{p as n,I as c}from"./index-ASyuPW18.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-BlkeJGrc.js","assets/index-CnPrfHYh.js","assets/index-Cnc1EkDo.js","assets/index-ASyuPW18.js","assets/index-7VC6vzqu.css"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-ASyuPW18.js";const s=async(t,a)=>{const{getIconPaths:o}=await e(async()=>{const{getIconPaths:r}=await import("./allPaths-BlkeJGrc.js");return{getIconPaths:r}},__vite__mapDeps([0,1,2,3,4]));return o(t,a)};export{s as allPathsLoader};