-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Buffer/Tensor allocation at device operation level - App navigation UX improvements - All buffers view for all operations (at a glance) - API for all buffers by operation - Add version rendered on FE - Fix for duplicate device operation names and CBs allocation - Fix for tensor buffers rendering incorrectly sometimes - Remote sync zip compression
- Loading branch information
Showing
48 changed files
with
3,814 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from functools import wraps | ||
from flask import request, abort | ||
from pathlib import Path | ||
|
||
|
||
def with_report_path(func): | ||
@wraps(func) | ||
def wrapper(*args, **kwargs): | ||
target_report_path = getattr(request, "report_path", None) | ||
if not target_report_path or not Path(target_report_path).exists(): | ||
# Raise 404 if report_path is missing or does not exist | ||
abort(404) | ||
|
||
# Add the report path to the view's arguments | ||
kwargs["report_path"] = target_report_path | ||
return func(*args, **kwargs) | ||
|
||
return wrapper | ||
|
||
|
||
|
||
|
||
def remote_exception_handler(func): | ||
def remote_handler(*args, **kwargs): | ||
from flask import current_app | ||
|
||
from paramiko.ssh_exception import AuthenticationException | ||
from paramiko.ssh_exception import NoValidConnectionsError | ||
from paramiko.ssh_exception import SSHException | ||
from ttnn_visualizer.exceptions import RemoteFolderException, NoProjectsException | ||
|
||
connection = args[0] | ||
|
||
try: | ||
return func(*args, **kwargs) | ||
except (AuthenticationException, NoValidConnectionsError, SSHException) as err: | ||
error_type = type(err).__name__ | ||
current_app.logger.error( | ||
f"{error_type} while connecting to {connection.host}: {str(err)}" | ||
) | ||
raise RemoteFolderException(status=500, message=f"{error_type}: {str(err)}") | ||
except (FileNotFoundError, IOError) as err: | ||
current_app.logger.error( | ||
f"Error accessing remote file at {connection.path}: {str(err)}" | ||
) | ||
raise RemoteFolderException(status=400, message=f"File error: {str(err)}") | ||
except NoProjectsException as err: | ||
current_app.logger.error( | ||
f"No projects found at {connection.path}: {str(err)}" | ||
) | ||
raise RemoteFolderException(status=400, message=f"No projects: {str(err)}") | ||
|
||
return remote_handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class RemoteFolderException(Exception): | ||
def __init__(self, message, status): | ||
super().__init__(message) | ||
self.message = message | ||
self.status = status | ||
|
||
|
||
class NoProjectsException(RemoteFolderException): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.