-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Not able to run without profiling master branch #322
Labels
High Priority
High priority items
Comments
@AkkiG2401 Can you have a look at this ASAP? |
A quickfix would be to explicitly add a check to the return value for the following snippet in def check_enabled_profilers(
f, pytorchProfile=False, energyProfile=False, *args, **kwargs
):
"""
Conditionally apply profiling based on the given boolean flags.
Args:
f (callable): The function to be potentially profiled.
pytorchProfile (bool): Whether to apply PyTorch profiling.
energyProfile (bool): Whether to apply energy profiling.
Returns:
result: The result of the function `f` execution.
"""
# Placeholder function to avoid nested conditions
def identity_func(fn, *a, **kw):
return fn(*a, **kw)
# Set the outer and inner functions based on the flags
inner_function = pytorch_profile if pytorchProfile else identity_func
outer_function = (
(
lambda fn: energy_profiling(
fn, project_name="baler_training", measure_power_secs=1
)
)
if energyProfile
else identity_func
)
# Suggestion
retval = outer_function(lambda: inner_function(f, *args, **kwargs))
retval = retval if retval else some_other_function
return retval()
# End suggestion
``` |
AkkiG2401
added a commit
to AkkiG2401/baler
that referenced
this issue
Nov 1, 2023
fritjof-b
pushed a commit
that referenced
this issue
Nov 2, 2023
OscarrrFuentes
pushed a commit
to OscarrrFuentes/baler
that referenced
this issue
Oct 15, 2024
…-collaboration#324) Clearer code as well, nice
OscarrrFuentes
pushed a commit
to OscarrrFuentes/baler
that referenced
this issue
Nov 21, 2024
…-collaboration#324) Clearer code as well, nice
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Describe the bug
Master branch can only run with profiling enabled.
To Reproduce
Expected behavior
After training completes you are presented with the following error:
System Information
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: