testintel: add missing test for AvgDown3D.forward (created by linxwang) - #1096
Draft
jiagaoxiang wants to merge 3 commits into
Draft
testintel: add missing test for AvgDown3D.forward (created by linxwang)#1096jiagaoxiang wants to merge 3 commits into
jiagaoxiang wants to merge 3 commits into
Conversation
Candidate cand:9cf47afdeacb6b6d0378129eb4bf01c2 at 2f01706.
…rence Address review: compare full output against a hand-computed reference for factor_s=2 with in_channels != out_channels (deterministic torch.arange input), verifying spatial block grouping and channel/group mapping instead of only asserting output shape.
pre-commit's black hook wraps the AvgDown3D(...) constructor call in test_forward_downsamples_spatial_and_channel_dims onto multiple lines (line was too long). No behavior change.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is isolated to a new unit test file and the assertions align with the current AvgDown3D implementation behavior.
Pull request overview
Adds targeted unit-test coverage for the WAN VAE AvgDown3D downsampling module to ensure its grouped channel averaging and temporal/spatial downsampling behaviors are exercised in CI.
Changes:
- Introduces a new unit test module that instantiates
AvgDown3Dand validates output shape/value semantics. - Covers both the temporal left-padding branch (
pad_t > 0) and the grouped-channel averaging path (group_sizebehavior). - Adds a negative test to confirm incompatible
(in_channels * factor) % out_channels != 0is rejected.
File summaries
| File | Description |
|---|---|
| tests/unit_tests/backends/diffusion/test_wan_vae_avgdown3d.py | New focused tests validating AvgDown3D.forward behavior (padding, reshape/permute mapping, averaging) plus init assertion. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same-repo refile of #1083 so Primus-CI-TAS runs against
AMD-AGI/Primus(fork PRs do not receive Docker Hub credentials, sobuild-docker/ torch unit tests never ran).This PR was created by linxwang via Test Gap Resolver.
No existing test in tests/unit_tests/backends/diffusion (or anywhere else in the repo) instantiates AvgDown3D or imports vae2_2.py at all; the pad->view->permute->view->view->mean sequence that implements grouped spatiotemporal average-downsampling, including the temporal padding branch (pad_t>0) and the group_size averaging when in_channelsfactor != out_channelsgroup_size trivially, is completely unexercised.
This PR adds a focused unit test for
AvgDown3D.forward; it does not change production code.