-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Pytorch and Lightning 2.0 fixes #8072
Conversation
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Jagadeesh J <jagadeeshj@ideas2it.com>
fix bert exmaple
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Documentation preview for 3ade269 will be available here when this CircleCI job completes successfully. More info
|
@shrinath-suresh thanks for the PR, ping me when it's ready for review! |
sure @harupy . We are working on the GPU tests. Will let you know once the PR is ready for review |
…ing older versions Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
@harupy The PR is ready for review |
@harupy Observing the following error message in CI - And the cross version tests are failing.. When i check the failure logs.. it has failed in For running autolog test, |
Where did you see this error? Can you share the URL?
No, it's not mandatory. See #7627 for more details. |
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
I was getting the Space error in this run - . But in the latest run i am not seeing it. Thanks for the reference. Cross functional tests (for pytorch flavor) failed due to the import error.. i fixed it supporting all three options (lightning, pytorch lightning <=1.9.4 and pytorch flavor)
|
@shrinath-suresh What happens if we patch both |
I haven't tested the case where we patch both of it. Can you please explain a bit more on the context. As of now, the logic is to patch |
Sure. If patching both Trainer is fine, we can simplify the code as I suggested. try:
import pytorch_lightning as pl
except ImportError:
pass
else:
from mlflow.pytorch._lightning_autolog import patched_fit
safe_patch(FLAVOR_NAME, pl.Trainer, "fit", patched_fit, manage_run=True)
try:
import lightning as L
except ImportError:
pass
else:
from mlflow.pytorch._lightning_autolog import patched_fit
safe_patch(FLAVOR_NAME, L.Trainer, "fit", patched_fit, manage_run=True) Just because |
Signed-off-by: Shrinath Suresh <shrinath@ideas2it.com>
Thanks for the update, let's see what happens. |
Thanks for the suggestion @harupy . I added both and tested it in cpu and gpu. Until |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Pytorch 2.0 and Lightning 2.0 has been released recently.
Lightning 2.0 changes are published here
Following are the impacts on mlflow pytorch library
pytorch_lightning
tolightning
validation_epoch_end
andtest_epoch_end
has been removedpl.Trainer.add_argparse_args(parent_parser=parser)
has been removed. This line of code combines all the pytorch lightning command line arguments with the user's ArgumentParser. Instead we have to use LightningCLI as mentioned in the release link--max_epochs
. Now, its--trainer.max_epochs
lightning
package,pytorch_lightning
gets installed as well. Hence, we dont have to change everything inmllfow.pytorch.autolog
library. But, we may need to remove older version checks.How is this patch tested?
MNIST
mnist_cpu_conda.txt
mnist_cpu_virtualenv.txt
mnist_gpu_conda.txt
BERT
bert_cpu_conda .txt
bert_gpu_conda.txt
Captum
captum_cpu_virtual_env.txt
AX
ax_hyper_param_tuning_cpu_conda.txt
Iterative Pruning
iterative_pruning_cpu_conda.txt
Observation:
In multi gpu tests, the lightning throws
_thread.lock
object error while pickling the model and the model is not getting logged into mlflow. However, the issue has been fixed in lightning master branch. Attaching screenshot for referencescreenshots.zip
Does this PR change the documentation?
Release Notes
Is this a user-facing change?
(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/recipes
: Recipes, Recipe APIs, Recipe configs, Recipe Templatesarea/projects
: MLproject format, project running backendsarea/scoring
: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra
: MLflow Tracking server backendarea/tracking
: Tracking Service, tracking client APIs, autologgingInterface
area/uiux
: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportLanguage
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesIntegrations
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsHow should the PR be classified in the release notes? Choose one:
rn/breaking-change
- The PR will be mentioned in the "Breaking Changes" sectionrn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/feature
- A new user-facing feature worth mentioning in the release notesrn/bug-fix
- A user-facing bug fix worth mentioning in the release notesrn/documentation
- A user-facing documentation change worth mentioning in the release notes