Skip to content

Conversation

@deepcharm
Copy link
Contributor

Compiled Autograd is an extension to torch.compile which enhances the autograd engine by capturing a larger backward computation graph at runtime. This allows a more comprehensive optimization of the backward pass during training.

Overall, 5-20% speedup is expected in backward-heavy workloads with stable graphs.

Disabled by default, the feature can be enabled from a user script by setting compiled_autograd_enabled=True when invoking the engine's compile method.

Compiled Autograd is an extension to torch.compile which enhances
the autograd engine by capturing a larger backward computation
graph at runtime. This allows a more comprehensive optimization
of the backward pass during training.

Overall, 5-20% speedup is expected in backward-heavy workloads
with stable graphs.

Disabled by default, the feature can be enabled from a user
script by setting 'compiled_autograd_enabled=True' when invoking
the engine's 'compile' method.

Signed-off-by: Max Kovalenko <[email protected]>
@eternalNight
Copy link
Contributor

@deepcharm Thanks for the patch!

Compiled autograd is not compatible with DeepCompile today as it will override the backward graph to which DeepCompile has inserted ZeRO ops. Having both enabled causes a torch._dynamo.exc.InternalTorchDynamoError (IndexError: list index out of range) exception in my local test.

Would you please warn the user and unset self._is_compiled_autograd_enabled if deepcompile and compiled_autograd_enabled?

@deepcharm
Copy link
Contributor Author

@eternalNight Thank you for the good catch! Updated the code per your request. Please let me know if that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants