Repository navigation
Conversation
|
AI-assisted acceptance checks for e8494bf: I generated an isolated Twenty CPU cases pass: actual SingleDeviceStrategy, DDPStrategy, and custom subclasses from the opposite namespace get the descriptive error in both directions; same-namespace instances are accepted in both directions; Fabric strategies, unrelated objects and an invalid string keep the generic error. A real two-step fit with a same-namespace SingleDeviceStrategy succeeds from each namespace. With only the accelerator connector reverted to 84df182 in both the source and mirror, the fourteen acceptance/generic-error/fit controls still pass, while the six opposite-namespace cases fail the message assertion because they receive the old generic error. Both versions correctly reject the mixed instances; this validates diagnosis, not new cross-package interoperability. The same final accelerator-connector suite has 165 passed / 31 skipped on head and 164 passed / 31 skipped / 1 expected message-test failure on base. Python 3.10 / PyTorch 2.14.1, Linux CPU. DDP strategy construction was checked, not a distributed launch. The isolated mirror needed the usual version metadata copied beside it before importing; that setup failure was not counted as a product failure. |
Fixes #20526
Summary
Detect strategy instances imported from the other PyTorch Lightning namespace.
Raise a descriptive error explaining that the Trainer and Strategy must come from the same package.
Add regression coverage for the namespace-specific error and generic rejection of unrelated/Fabric strategies.
Testing
\git diff --check\ passes.
The focused pytest suite could not be run because \lightning_utilities\ is missing from the current environment. End-to-end behavior has not been verified locally.