handler
error.handler
KNOWN_ERRORS
module-attribute
KNOWN_ERRORS = {'torch.cuda.OutOfMemoryError': CudaOutOfMemoryError, 'numpy.core._exceptions._ArrayMemoryError': CpuOutOfMemoryError}
SaigeError
Bases: Exception, ABC
Saige Research 6-digit error code
Info
notion.so/843e85df4fb7469c927170f66251da4c
Torch dataloader에서 작업 중 exception 발생 시 torch가 message를 넣어서 reraise하는 경우가 있음. 참고: https://teams.microsoft.com/l/message/19:874deea9bde44c2f9c2c43d4bc002a58@thread.tacv2/1688547469317?tenantId=4098be5f-d82a-474c-b4b6-a95727b671eb&groupId=3f51c33d-7ce9-4b2c-bf75-6d1032c4183b&parentMessageId=1688547469317&teamName=%EC%97%B0%EA%B5%AC%ED%8C%80&channelName=%5BPR%5D%20SaigeToolkit&createdTime=1688547469317&allowXTenantAccess=false
Source code in SaigeToolkit/error/base.py
__init_subclass__
Register a child class that inherits SaigeError with "repo", "code", and "message" attributes to ERROR_CODE_BOOK.
Source code in SaigeToolkit/error/base.py
CpuOutOfMemoryError
Bases: SaigeToolkitError
Torch dataloader에서 작업 중 exception 발생 시 torch가 message를 넣어서 reraise하는 경우가 있음. 참고: https://teams.microsoft.com/l/message/19:874deea9bde44c2f9c2c43d4bc002a58@thread.tacv2/1688547469317?tenantId=4098be5f-d82a-474c-b4b6-a95727b671eb&groupId=3f51c33d-7ce9-4b2c-bf75-6d1032c4183b&parentMessageId=1688547469317&teamName=%EC%97%B0%EA%B5%AC%ED%8C%80&channelName=%5BPR%5D%20SaigeToolkit&createdTime=1688547469317&allowXTenantAccess=false
Source code in SaigeToolkit/error/base.py
CudaOutOfMemoryError
Bases: SaigeToolkitError
Torch dataloader에서 작업 중 exception 발생 시 torch가 message를 넣어서 reraise하는 경우가 있음. 참고: https://teams.microsoft.com/l/message/19:874deea9bde44c2f9c2c43d4bc002a58@thread.tacv2/1688547469317?tenantId=4098be5f-d82a-474c-b4b6-a95727b671eb&groupId=3f51c33d-7ce9-4b2c-bf75-6d1032c4183b&parentMessageId=1688547469317&teamName=%EC%97%B0%EA%B5%AC%ED%8C%80&channelName=%5BPR%5D%20SaigeToolkit&createdTime=1688547469317&allowXTenantAccess=false
Source code in SaigeToolkit/error/base.py
get_error_handler
get_error_handler(head_error: Type[SaigeError])
Returns error handling decorator The handler wraps the original return value into (error_code, return_value) tuple.
Parameters:
-
head_error(Type[SaigeError]) –head error