Closed yhna940 closed 1 hour ago
Thanks for this PR. I wonder if we could not check the PyTorch version and pass the argument only if it's supported? Alternatively, we could check the signature for this argument, but I'm not a big fan of that.
Thanks for your review :) It looks like the minimum torch version that supports the target argument is 2.2.0, so I added logic to check for a specific version.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Hi there,
I wanted to kindly ask about the status of this PR. I don't mean to rush, but this PR is crucial for resolving a bug in my project. Your review and approval would be greatly appreciated :)
Thank you for your time and assistance!
What does this PR do?
This PR addresses an issue with the
notebook_launcher
in theaccelerate
library, where the inclusion of thelog_line_prefix_template
argument in theLaunchConfig
instantiation leads to aTypeError
in certain PyTorch versions. By making this argument optional, we ensure compatibility across all supported PyTorch versions.Description
The
notebook_launcher
function in theaccelerate
library currently includes alog_line_prefix_template
argument when creating aLaunchConfig
instance. However, this argument is not supported in some versions of PyTorch, resulting in aTypeError
. To maintain compatibility with all supported versions of PyTorch, this PR makes the inclusion of thelog_line_prefix_template
argument conditional.Changes Made:
log_line_prefix_template
parameter to the notebook_launcher function.notebook_launcher
function to conditionally include thelog_line_prefix_template
argument in theLaunchConfig
instantiation based on the PyTorch version.Motivation and Context
Ensuring compatibility with a wider range of PyTorch versions is crucial for users who may not be able to upgrade to the latest versions. This change will allow users with different PyTorch versions to use the
notebook_launcher
without encountering errors.Log / Env
Torch Version Comparison
Torch Version 1.10
Torch Version 2.24
Before submitting