Skip to content

Complete Wan overnight optimization pack - #6

Merged
aryan5v merged 3 commits into
mainfrom
feat/wan-overnight-runner
Jul 31, 2026
Merged

Complete Wan overnight optimization pack#6
aryan5v merged 3 commits into
mainfrom
feat/wan-overnight-runner

Conversation

@aryan5v

@aryan5v aryan5v commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Wan modulated LayerNorm and post-MLP gated residual specs, production corpora, and Triton starters
  • add a one-command, time-bounded and resumable overnight campaign runner with durable logs, receipts, and morning report
  • complete the first three-target Wan optimization pack and cross-repository capture contract

Validation

  • CPU: 387 passed, 10 deselected
  • FastVideo three-target capture validates, ranks, and prepares through campaign.py run --dry-run
  • GB200 GPU smoke: all three Wan starters pass
  • GB200 full production corpora:
    • modulated LayerNorm: all five correctness stages pass, 10.449x weighted isolated speedup
    • post-MLP gated residual: all five correctness stages pass, 10.628x weighted isolated speedup
    • post-attention gated residual + LayerNorm: previously validated at 8.638x weighted isolated speedup

Detailed results are in docs/WAN_KERNEL_RESULTS.md.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aryan5v, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f695e5c-9093-45e1-b9fd-9cfbe403d000

📥 Commits

Reviewing files that changed from the base of the PR and between 58e09c9 and a3e5de6.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • README.md
  • autokernel/campaign/runner.py
  • campaign.py
  • docs/WAN_KERNEL_RESULTS.md
  • tests/test_campaign.py
📝 Walkthrough

Walkthrough

Adds an unattended, resumable campaign runner with CLI controls and durable reports, plus Wan gated-residual and modulated LayerNorm specifications, corpora, Triton starters, and expanded correctness tests.

Changes

Overnight campaign runner

Layer / File(s) Summary
Campaign execution and persistence
autokernel/campaign/runner.py
Generates prompts, runs an agent within a time budget, tracks progress, persists logs and receipts, runs orchestration reporting, and writes a morning report.
CLI and campaign preparation wiring
campaign.py, autokernel/campaign/__init__.py, autokernel/campaign/types.py
Adds the run command and public runner exports, parses custom agent commands, and supports rooted spec locators during preparation.
Runner validation and usage documentation
tests/test_campaign.py, README.md, CHANGELOG.md
Tests dry-run, placeholder substitution, and report generation while documenting the unattended workflow.

Wan fusion pack

Layer / File(s) Summary
Wan specifications and production corpora
models/wan_gated_residual.py, models/wan_modulated_layer_norm.py, models/*_corpus.json
Defines references, deterministic generators, KernelSpec metadata, starter paths, and five-case corpora for both operations.
Triton starter implementations
kernels/wan_gated_residual.py, kernels/wan_modulated_layer_norm.py
Adds fused CUDA kernels and launch wrappers with shape, dtype, device, contiguity, and hidden-size validation.
Wan correctness coverage and status documentation
tests/test_gpu_smoke.py, tests/test_wan_additional_targets.py, README.md, CHANGELOG.md
Expands GPU smoke tests to three Wan operations and validates corpora plus FP32-to-target-dtype reference behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI as campaign.py
  participant Runner as run_campaign
  participant Agent
  participant Orchestrator as orchestrate.py
  participant Workspace as workspace/
  CLI->>Runner: run campaign with budget and resume options
  Runner->>Workspace: write prompt and initial receipt
  Runner->>Agent: execute campaign prompt with timeout
  Agent->>Workspace: write overnight_agent.log and summary
  Runner->>Orchestrator: collect campaign report
  Orchestrator->>Workspace: update orchestration_state.json
  Runner->>Workspace: write morning_report.md and final receipt
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a completed Wan overnight optimization pack.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wan-overnight-runner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
autokernel/campaign/runner.py (1)

259-296: 🩺 Stability & Availability | 🔵 Trivial

Consider a lock/guard against concurrent run_campaign invocations.

Two overnight runs launched against the same repo_root/workspace (e.g. a stray cron plus a manual retry) would race on campaign_receipt.json, the log file, and the agent's workspace, since there is no lock file or PID guard. Worth a lightweight safeguard (e.g. a PID lock file checked before _reset_runtime_files).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autokernel/campaign/runner.py` around lines 259 - 296, The run_campaign
workflow needs a lightweight per-workspace concurrency guard before any reset or
preparation occurs. Add a PID lock for workspace around the existing
fresh_run/_reset_runtime_files flow, reject concurrent invocations with a clear
CampaignError, and ensure the lock is released when run_campaign exits while
preserving normal resume and cleanup behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autokernel/campaign/runner.py`:
- Around line 277-286: Require explicit spec trust before campaign execution:
update run_campaign() in autokernel/campaign/runner.py to accept and propagate a
trust_specs value instead of hardcoding True; add a --trust-specs flag to the
run subparser in campaign.py and pass it to run_campaign(), failing closed when
absent; update README.md to document the run command’s Python spec-locator trust
and code-execution requirement alongside prepare.
- Around line 337-355: Guard the subprocess.Popen call in run_campaign with
handling for OSError, including FileNotFoundError, so launch failures do not
escape after the receipt is marked running. On failure, record the clean
terminal failure status and associated error/report through the existing receipt
and morning-report mechanisms, then return using the established run_campaign
failure path.

In `@campaign.py`:
- Around line 121-137: Update the CLI flow surrounding run_campaign and the
receipt["status"] handling so terminal non-success statuses, especially
"agent_failed", print a failure verdict and return a nonzero exit code instead
of always printing CAMPAIGN_RUN: PASS and returning 0. Preserve the existing
success behavior for completed campaigns and the CampaignError handling, and use
the receipt status to distinguish the outcomes.

---

Nitpick comments:
In `@autokernel/campaign/runner.py`:
- Around line 259-296: The run_campaign workflow needs a lightweight
per-workspace concurrency guard before any reset or preparation occurs. Add a
PID lock for workspace around the existing fresh_run/_reset_runtime_files flow,
reject concurrent invocations with a clear CampaignError, and ensure the lock is
released when run_campaign exits while preserving normal resume and cleanup
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: db972da0-cda3-46b6-8e58-8b9efe5c88e2

📥 Commits

Reviewing files that changed from the base of the PR and between 5af8841 and 58e09c9.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • README.md
  • autokernel/campaign/__init__.py
  • autokernel/campaign/runner.py
  • autokernel/campaign/types.py
  • campaign.py
  • kernels/wan_gated_residual.py
  • kernels/wan_modulated_layer_norm.py
  • models/wan_gated_residual.py
  • models/wan_gated_residual_corpus.json
  • models/wan_modulated_layer_norm.py
  • models/wan_modulated_layer_norm_corpus.json
  • tests/test_campaign.py
  • tests/test_gpu_smoke.py
  • tests/test_wan_additional_targets.py

Comment thread autokernel/campaign/runner.py
Comment thread autokernel/campaign/runner.py Outdated
Comment thread campaign.py
- Require explicit --trust-specs before campaign.py run loads Python
  spec locators, matching the prepare gate
- Record a terminal agent_launch_failed receipt and morning report when
  the agent process cannot be spawned
- Map non-success terminal statuses to CAMPAIGN_RUN: FAIL with a
  non-zero exit code so unattended callers can gate on the CLI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dGTVqeg1AohwtT6PN1nYe
@aryan5v
aryan5v merged commit 47a170f into main Jul 31, 2026
4 checks passed
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