[tests] port final set of model tests and others#13974
Conversation
|
Failing tests are also exist on |
|
Hi @sayakpaul, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. |
| class SanaVideoTransformerCompileTests(TorchCompileTesterMixin, unittest.TestCase): | ||
| model_class = SanaVideoTransformer3DModel |
There was a problem hiding this comment.
It looks like SanaVideoTransformer3DModel previously had a TorchCompileTesterMixin test subclass that got removed, would it be possible to add it back?
There was a problem hiding this comment.
I intentionally didn't add it because it's not used much.
| pass | ||
|
|
||
|
|
||
| class TestConsisIDTransformerTraining(ConsisIDTransformerTesterConfig, TrainingTesterMixin): |
There was a problem hiding this comment.
I think ConsisIDTransformer3DModel is the only model that didn't get an AttentionTesterMixin test subclass, is this intentional?
There was a problem hiding this comment.
ConsisIDTransformer3DModel uses a custom attention processor and in the old suite it had uses_custom_attn_processor = True, which exempted it from the attention-processor tests.
| def output_shape(self) -> tuple: | ||
| return (2, 4, 8, 8) | ||
|
|
||
| @property | ||
| def output_shape(self): | ||
| return (1, 4, 8, 8) |
There was a problem hiding this comment.
It looks like the CogVideoX-1.5 test output_shape was changed from (1, 4, 8, 8) to (2, 4, 8, 8), is this intentional?
There was a problem hiding this comment.
1.5 config's dummy input uses num_frames=2 (vs num_frames=1 for base CogVideoX), and the transformer outputs the same frame count, so the true per-sample output is (2, 4, 8, 8).
The old (1, 4, 8, 8) was actually inconsistent with its own num_frames=2 input and it never tripped a test because the old test_output checked output.shape against the input tensor, not the declared output_shape; the declared value was only used to build the training-loss noise, where (2,1,4,8,8) happened to broadcast against the (2,2,4,8,8) output. I set it to the model's actual output shape so the loss target is built correctly instead of relying on broadcasting.
| def test_missing_key_loading_warning_message(self): | ||
| with self.assertLogs("diffusers.models.modeling_utils", level="WARNING") as logs: | ||
| logger = logging.getLogger("diffusers.models.modeling_utils") | ||
| with CaptureLogger(logger) as cap_logger: | ||
| UNet2DConditionModel.from_pretrained("hf-internal-testing/stable-diffusion-broken", subfolder="unet") |
There was a problem hiding this comment.
Would it be better to use pytest's caplog fixture here?
dg845
left a comment
There was a problem hiding this comment.
Thanks for the PR! Left some comments :).
What does this PR do?
ModelTesterMixinclass.pytest.I have run all the GPU tests, too (and they pass).