Skip to content

testintel: add missing test for AvgDown3D.forward (created by linxwang) - #1096

Draft
jiagaoxiang wants to merge 3 commits into
mainfrom
testintel/test/cand-9cf47afdeacb6b6d0378129eb4bf01c2
Draft

testintel: add missing test for AvgDown3D.forward (created by linxwang)#1096
jiagaoxiang wants to merge 3 commits into
mainfrom
testintel/test/cand-9cf47afdeacb6b6d0378129eb4bf01c2

Conversation

@jiagaoxiang

Copy link
Copy Markdown
Collaborator

Same-repo refile of #1083 so Primus-CI-TAS runs against AMD-AGI/Primus (fork PRs do not receive Docker Hub credentials, so build-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.

TestIntel and others added 3 commits September 3, 2026 01:38
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 AvgDown3D and validates output shape/value semantics.
  • Covers both the temporal left-padding branch (pad_t > 0) and the grouped-channel averaging path (group_size behavior).
  • Adds a negative test to confirm incompatible (in_channels * factor) % out_channels != 0 is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants