-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug mode for ignite #1992
Comments
We could also think of different levels of debugging:
|
Hi @sdesrozis and @vfdev-5, I think this is a great idea and much needed tool. I am interested in implementing it. I agree with @vfdev-5's idea of having it in levels. We can pass the level in
Doing this is start forward, we just need to set the logger level in The level 2 would be logging information during training like loss, LR, scheduler. For this we need to make changes to the Then level 3 would be gradients. (can use PyTorch hooks) What do you think? |
@Ishan-Kumar2 I totally agree. Doing it by level is a smart way to provide a good API to users and schedule the team's work. Yesterday, we discussed with @Priyansi another debug feature which could be great. We thought we would provide a visual description of the workflow. It would be generated statically by the engine, similar to what could be considered at the first level. We could generate a dot file to describe the links between the handlers through what is added to the state. @Ishan-Kumar2 I will be busy very soon because of a change in job. I can't contribute the way I would like to. If you are interested to contribute on this feature, I would be happy to discuss this with you, and help in any way I can. |
Hello, @sdesrozis @vfdev-5. Is this feature request still on the cards? I would love to discuss further and contribute. |
@DevPranjal yes, it is still open issue that we would like to have. |
Great, so if I can compile the previous discussions, we need level wise debugging modes:
@vfdev-5 The debug level API will be accessed through |
I was thinking about |
Ok. Can we just have default
|
Yes, you are right maybe a binary flag would be better option: # to enable
engine.debug(level=Engine.DEBUG_EVENTS | Engine.DEBUG_OUTPUT | Engine.DEBUG_GRADS)
# to disable
engine.debug(level=0) Provided flag names are just examples and can be renamed if a better naming can be found |
Sure. def debug(self, level: int = 0):
self.debug_level = level
def _print_debug_mode(self, string: str, level: int):
if level > self.debug_level:
print(string)
def _fire_event(...):
...
self._print_debug_mode(f'firing handler: {func.__name__}', level=1)
... |
@DevPranjal there is also ignite/ignite/engine/engine.py Line 125 in 3a286b1
|
Yes. Can I change the approach to have custom log levels, using or do I simply change the above to: def _log_debug_mode(self, string: str, level: int):
if level > self.debug_level:
self.logger.debug(string) or anything else? |
Update engine.py to resolve pytorch#1992
Does @puhuk 's PR solve this issue, or is this open yet? |
Hi, @sawradip I’m working on it :) |
@puhuk @sawradip the fact that someone is working on this issue does not mean that produced PR will be certainly merged. It can happen that contributor stops working on the PR and PR is suspended or PR's code does not meet requirement or has poor quality... Also, you can both collaborate together and send 2 PR to solve the issue |
🚀 Feature
The idea is to provide a debug mode as discussed here: #1989 (comment).
All the possible options can be discussed here. We could add an helper to track the workflow of handlers from the engine run. On the other hand, some specific debug tools are needed to track the values of PyTorch objects (LR, loss, grads, etc.). Note that the preferred way to extend ignite is handlers' design so let's create a new set of tools for the debugging.
The text was updated successfully, but these errors were encountered: