Skip to content

other: improve optimum-compile#591

Open
rebel-seinpark wants to merge 76 commits into
devfrom
add-pytest
Open

other: improve optimum-compile#591
rebel-seinpark wants to merge 76 commits into
devfrom
add-pytest

Conversation

@rebel-seinpark

Copy link
Copy Markdown
Collaborator

🚀 Summary of Changes

What does this PR do? What feature, fix, or improvement does it bring?


📌 Related Issues / Tickets

  • Resolves #
  • Related to #

✅ Type of Change

  • 🚀 Release (release)
  • ✨ Feature (feature)
  • 🧠 Model support (model)
  • 🧬 Core engine changes (core)
  • 🛠 Bug fix (fix)
  • ⚙️ Performance improvement (perf)
  • 🔁 Refactor or code cleanup (refactor)
  • 📄 Documentation (docs)
  • ❓ Other (other): please describe

🧪 How to Test

  1. Run ...
  2. Verify output: ...
  3. Edge case tested: ...

📸 Screenshots / Logs (if applicable)


📋 Checklist

  • PR title follows Conventional Commits format
  • This PR is linked to an existing issue
  • The test method is described, and the expected result is clearly stated
  • Relevant documentation has been updated (if applicable)

💬 Notes


@rebel-seinpark rebel-seinpark requested a review from rebel-eunji May 7, 2026 09:42
@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rebel-seinpark rebel-seinpark marked this pull request as ready for review May 7, 2026 10:17
Comment on lines +259 to +283
def test_dispatches_to_compile_fn_with_forwarded_args(self, monkeypatch):
captured = {}

def fake_compile_fn(batch_size, max_model_len, block_size, tp_size):
captured["args"] = (batch_size, max_model_len, block_size, tp_size)
return {"sentinel": True}

# Patch the dispatch table on the imported module so the real fn
# doesn't run (and so the assertion can compare without aliasing).
monkeypatch.setitem(
compilation._COMPILE_MULTIMODAL_FNS, "llava", fake_compile_fn
)

spec = RBLNCompileSpec._for_multimodal(
_hf("LlavaForConditionalGeneration"),
batch_size=2,
block_size=128,
max_model_len=2048,
tp_size=4,
)
# Note the unusual argument order in `_for_multimodal`:
# (batch_size, max_model_len, block_size, tp_size).
assert captured["args"] == (2, 2048, 128, 4)
assert spec.rbln_config == {"sentinel": True}
assert spec.model_cls is RBLNAutoModelForVision2Seq

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is this test for?

user_specified_block_size=False,
additional_config={},
)
with pytest.raises(ValueError, match="block_size"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you add more details about match so the purpose of the test is clearer at a glance?

Base automatically changed from update/compile-model-optimum to dev May 8, 2026 04:27
@rebel-seinpark rebel-seinpark changed the title other: add pytest to optimum-compile other: improve optimum-compile May 8, 2026
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