Skip to content

fix(diffusion_gemma): init preempt-rebuild runtime fields in init_multi_block#46

Merged
drewjin merged 1 commit into
SJTU-DENG-Lab:mainfrom
Osc-7:fix/dgemma-resume-prefill-init
Jul 13, 2026
Merged

fix(diffusion_gemma): init preempt-rebuild runtime fields in init_multi_block#46
drewjin merged 1 commit into
SJTU-DENG-Lab:mainfrom
Osc-7:fix/dgemma-resume-prefill-init

Conversation

@Osc-7

@Osc-7 Osc-7 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Initialize _resume_prefill_until and _terminal_context_block_id in DiffusionGemmaReq.init_multi_block().
  • DiffusionGemmaReq overrides init_multi_block without calling super(), so after the preempt-rebuild changes in base DllmReq (609b593), these runtime fields were never set.
  • This caused AttributeError on the first step()lazy_activate() when running the DiffusionGemma GSM8K benchmark.

Fixes #45

Summary by CodeRabbit

  • Bug Fixes
    • Improved request initialization to better support ongoing diffusion workflows and context handling, helping reduce unexpected interruptions during processing.

…ti_block

DiffusionGemmaReq overrides init_multi_block without calling super(), so
base DllmReq fields _resume_prefill_until and _terminal_context_block_id
were never set. lazy_activate() then raised AttributeError on the first
step(), breaking diffusion_gemma_gsm8k benchmark runs.

Fixes SJTU-DENG-Lab#45
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d4cf0db-53ea-4611-b13b-3627242b312c

📥 Commits

Reviewing files that changed from the base of the PR and between 184ba97 and 300f77e.

📒 Files selected for processing (1)
  • diffulex/strategy/diffusion_gemma/engine/request.py

📝 Walkthrough

Walkthrough

Two instance fields, _resume_prefill_until (initialized to 0) and _terminal_context_block_id (initialized to None), are added to DiffusionGemmaReq.init_multi_block() to fix a missing-attribute error during benchmark execution.

Changes

Bug Fix: Missing fields in init_multi_block

Layer / File(s) Summary
New instance fields
diffulex/strategy/diffusion_gemma/engine/request.py
init_multi_block() now initializes _resume_prefill_until = 0 and _terminal_context_block_id = None, fixing the AttributeError reported when running benchmarks.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 Two fields were missing, the benchmark would fall,
_resume_prefill_until now answers the call,
_terminal_context_block_id set to None,
A tiny fix made, and the error is gone!
Hop hop, the bunny patches on~ 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: initializing Diffusion Gemma preempt-rebuild runtime fields in init_multi_block.
Linked Issues check ✅ Passed The change matches issue #45 by initializing the missing runtime fields that caused the Diffusion Gemma benchmark step failure.
Out of Scope Changes check ✅ Passed The PR only adds the two missing request fields needed for the reported bug and contains no unrelated changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@drewjin
drewjin merged commit 37b1f7f into SJTU-DENG-Lab:main Jul 13, 2026
2 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.

[BUG] Diffusion Gemma run benchmark error

2 participants