Skip to content

[Fix] Enforce exact multimodal embedding rows at final placement - #43

Open
rchalamala wants to merge 1 commit into
integration/kimi-k3-v0.5.20from
fix/mm-embedding-length
Open

rchalamala wants to merge 1 commit into
integration/kimi-k3-v0.5.20from
fix/mm-embedding-length

Conversation

@rchalamala

@rchalamala rchalamala commented Sep 25, 2026 •

Copy link
Copy Markdown

Motivation

The final multimodal placement check silently keeps a suffix when an embedding has too many rows. That can shift image rows onto different placeholder tokens. It also counts only the first dimension for higher-rank encoder outputs.

Modifications

Require an exact flattened token-row count at final placement, preserving the feature dimension and returning matching tensors unchanged. Report mismatches with both counts and chunked-prefill context. Model-owned padding/trimming and EVS placeholder redistribution retain their existing behavior.

This check runs after chunk extraction; it does not validate producer rows that earlier slicing already removed or provide request-level failure isolation.

Accuracy Tests

CPU tests exercise 2D–4D row counts, exact/short/excess outputs, chunked-prefill boundaries, cache reuse, list/tensor encode results, precomputed embeddings, actual input embedding placement, and EVS redistribution. Registered direct runners and neighboring chunked-embedding tests pass. Source-only regression controls fail with the original helper and pass with the change.

Registered-test validation, Ruff 0.15.1, isort 7.0.0, codespell 2.4.1, and formatting pass. No model accuracy or GPU execution was measured.

Speed Tests and Profiling

No performance benchmark. The check reuses the existing flattened-row counting helper and preserves the offset-count and EVS readback behavior.

Checklist

  • Format code and run lint checks.
  • Add focused unit tests with executable registered runners.
  • Follow SGLang code style guidance.
  • Model accuracy and speed benchmarks were not run.

CI States

Latest PR Test (Base): ❌ Run #36108884616
Latest PR Test (Extra): ❌ Run #36108884198
Latest PR Test (AMD ROCm 10): ❌ Run #36108884604

@rchalamala
rchalamala marked this pull request as ready for review September 25, 2026 07:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T08:01:30.067992Z e2c7212 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@rchalamala rchalamala changed the title [Multimodal] Enforce exact embedding rows at final placement [Fix] Enforce exact multimodal embedding rows at final placement Sep 25, 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.

1 participant