Skip to content

Commit

Permalink
fix exception (#1124)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved error handling and logging for graph file management
processes.
- Adjusted logging severity from info to warning for graph file
operations.

- **New Features**
	- Introduced dedicated functions for handling graph loading and saving.
	- Added processing for state dictionaries before saving.

- **Refactor**
	- Simplified the control flow in the exception handling decorator.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
strint authored Oct 30, 2024
1 parent 9231f55 commit 177dfc0
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/onediff/infer_compiler/backends/oneflow/deployable_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,7 @@ def _(mod: DualModule, verbose=False):
def handle_deployable_exception(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
if transform_mgr.debug_mode:
return func(self, *args, **kwargs)
else:
try:
return func(self, *args, **kwargs)
except Exception as e:
logger.error(f"Exception in {func.__name__}: {e=}")
logger.warning("Recompile oneflow module ...")
del self._deployable_module_model.oneflow_module
self._deployable_module_dpl_graph = None
return func(self, *args, **kwargs)
return func(self, *args, **kwargs)

return wrapper

Expand Down

0 comments on commit 177dfc0

Please sign in to comment.