other: improve optimum-compile#591
Open
rebel-seinpark wants to merge 76 commits into
Open
Conversation
_config to name
Co-authored-by: rebel-seinpark <seinpark@rebellions.ai>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
rebel-eunji
reviewed
May 8, 2026
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 |
Collaborator
There was a problem hiding this comment.
What is this test for?
rebel-eunji
reviewed
May 8, 2026
| user_specified_block_size=False, | ||
| additional_config={}, | ||
| ) | ||
| with pytest.raises(ValueError, match="block_size"): |
Collaborator
There was a problem hiding this comment.
Could you add more details about match so the purpose of the test is clearer at a glance?
rebel-eunji
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Summary of Changes
📌 Related Issues / Tickets
✅ Type of Change
release)feature)model)core)fix)perf)refactor)docs)other): please describe🧪 How to Test
.........📸 Screenshots / Logs (if applicable)
📋 Checklist
💬 Notes