-
Notifications
You must be signed in to change notification settings - Fork 3.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
[RFC] Deprecate on_configure_sharded_model
callback hook
#11560
Comments
on_configure_sharded_model
callback/LM hookson_configure_sharded_model
callback/LM hooks
@SeanNaren I believe it has never been properly advertised. I think it would be fair to remove it as I don't really find a real use case for it. |
I agree with removal, the hook is really specific. Using it doesn't paint a good picture design-wise so I think it'll be good to clean up, now that it's not necessary. |
For anyone picking up this issue, you can follow #10940 as an example |
I will try to do this. |
Yes! |
I don't know how to write the test for this. |
on_configure_sharded_model
callback/LM hookson_configure_sharded_model
callback hook
hey @Piyush-97 |
`def test_v1_8_0_on_configure_sharded_model(tmpdir):
I don't have GPU and I am not sure if this is right. |
@Piyush-97 - you don't have to specify def test_v1_8_0_on_configure_sharded_model(tmpdir):
class TestCallback(Callback):
def on_configure_sharded_model(self, trainer, model):
print("Configuring sharded model")
model = BoringModel()
trainer = Trainer(
callbacks=[TestCallback()],
max_epochs=1,
fast_dev_run=True,
enable_progress_bar=False,
logger=False,
default_root_dir=tmpdir,
)
with pytest.deprecated_call(
match="The `on_configure_sharded_model` callback hook was deprecated in v1.6 and will be removed in v1.8."
):
trainer.fit(model)` |
I have written a test but it is failing with two more tests. |
Hi @Piyush-97 those failures are due to a known issue affecting multiple PRs, not just yours: #11633 |
Proposed refactor
Deprecate
on_configure_sharded_model
callback/LM hooks in v1.6 for removal in v1.8https://github.com/PyTorchLightning/pytorch-lightning/blob/5ad5ba54c0c477546d21daf75ac7b4748d7963a7/pytorch_lightning/callbacks/base.py#L60-L61
Motivation
I see no uses of this hook either externally or internally: https://www.grep.app/search?q=on_configure_sharded_model
Additional context
This hook was originally added in #6679
cc @justusschock @awaelchli @akihironitta @rohitgr7 @tchaton @carmocca @Borda @ninginthecloud @daniellepintz
The text was updated successfully, but these errors were encountered: