Skip to content

other: fix circular import error#556

Open
rebel-seinpark wants to merge 2 commits intomainfrom
fix/circular-import
Open

other: fix circular import error#556
rebel-seinpark wants to merge 2 commits intomainfrom
fix/circular-import

Conversation

@rebel-seinpark
Copy link
Copy Markdown
Contributor

Pull Request Description

Fix circular import in modeling_attention_utils

Importing constants like DEFAULT_FLASH_ATTN_PARTITION_LENGTH from modeling_attention_utils as the first entry point triggers a circular import error. This happens because the module unconditionally imports RBLNDecoderOnlyModelForCausalLMConfig at the top level, which kicks off a cycle back to this module before it finishes initializing.
Since RBLNDecoderOnlyModelForCausalLMConfig is only used in type annotations, move the import under TYPE_CHECKING and quote the annotation strings.

⚠️ Important: Branch Target

  • New features, enhancements, and non-critical fixes: Merge to dev branch
  • Critical hotfixes only: Merge to main branch (must also merge to dev)

Please ensure you've selected the correct base branch before submitting!

Type of Change

  • Release (dev → main merge for production release)
  • New Model Support
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please describe):

Changes Overview

Motivation and Context

Related Issues


Conventional commit

type(optional scope): description

Type candidate

  • Model Updates
    • model: Adding New models or Bugfix for existing models
      • ex) Add LlavaNext
      • ex) Bugfix Whisper
  • Enhancements
    • performance: Optimizing some models or this library itself
      • ex) Loading RBLNModel faster
      • ex) Optimizing Memory Usage of DecoderOnlyModel
  • Code Refactor
    • refactor: Re-arrange class architecture, or more.
      • ex) Refactor Seq2Seq
  • Documentation
    • doc: Update docstring only
  • Library Dependencies
    • dependency: Update requirements, something like that.
  • Release
    • release: Merging dev to main for production release
      • ex) Release v1.2.0
  • Other
    • other: None of above.
      • ex) ci update
      • ex) pdm update

@rebel-seinpark rebel-seinpark changed the title fix: circular import error other: fix circular import error May 4, 2026
@rebel-seinpark rebel-seinpark requested a review from a team May 4, 2026 10:43
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.

1 participant