Skip to content

[AINode] Replace DiT-derived Sundial conditioning head - #18616

Merged
CRZbulabula merged 1 commit into
apache:masterfrom
CRZbulabula:yongzao/replace-dit-sundial-head
Sep 10, 2026
Merged

[AINode] Replace DiT-derived Sundial conditioning head#18616
CRZbulabula merged 1 commit into
apache:masterfrom
CRZbulabula:yongzao/replace-dit-sundial-head

Conversation

@CRZbulabula

Copy link
Copy Markdown
Contributor

Description

This PR resolves the Sundial provenance issue identified in the review of #18611. The prior conditioning head was explicitly identified as adopted from DiT, whose CC-BY-NC-4.0 license is not suitable for Apache source distributions.

The DiT-derived residual and output-layer implementation is replaced with an independently written PyTorch implementation based on Sundial's required tensor and checkpoint contract. The replacement:

  • keeps the existing conditional residual and output-projection behavior;
  • preserves all published checkpoint parameter names and tensor shapes;
  • preserves zero initialization and strict state-dict loading; and
  • removes the DiT-derived implementation and attribution from the source tree.

No user-facing behavior change is intended. Class names and computation are expressed independently, while nested module names remain stable solely for checkpoint compatibility.

Focused tests cover the checkpoint key/shape contract, strict state-dict loading, output shapes, gradient propagation, zero-initialized output, and sampling shape. A random-weight comparison against the previous implementation also produced identical output with a maximum absolute delta of 0.0.

Verification

  • PYTHONPATH=. python3 -m unittest discover -s tests -p "test_*.py" -v (7 tests passed)
  • black --check . with Black 25.1.0
  • isort --check-only --profile black . with isort 6.0.1
  • python3 -m compileall -q iotdb-core/ainode/iotdb iotdb-core/ainode/tests
  • mvn -q -P with-ainode apache-rat:check -pl iotdb-core/ainode -DskipTests

This PR has:

  • been self-reviewed.
  • added unit tests to cover the replacement implementation.
  • added comments/docstrings where the compatibility intent is not obvious.

Key changed/added classes (or packages if there are too many classes) in this PR
  • iotdb.ainode.core.model.sundial.flow_loss
  • tests.test_sundial_flow_loss

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 replacement preserves the existing computation and checkpoint contract with focused automated coverage.

Pull request overview

Replaces DiT-derived Sundial conditioning components with independently implemented, checkpoint-compatible PyTorch modules.

Changes:

  • Reimplements conditional residual and output projection layers.
  • Preserves parameter names, initialization, shapes, and behavior.
  • Adds focused compatibility and behavior tests.
File summaries
File Description
iotdb-core/ainode/iotdb/ainode/core/model/sundial/flow_loss.py Replaces DiT-derived conditioning layers.
iotdb-core/ainode/tests/test_sundial_flow_loss.py Tests checkpoint compatibility, gradients, initialization, and sampling.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@CRZbulabula
CRZbulabula merged commit b1a0462 into apache:master Sep 10, 2026
40 checks passed
@CRZbulabula
CRZbulabula deleted the yongzao/replace-dit-sundial-head branch September 10, 2026 13:28
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.

3 participants