[mm] Accept per-item embedding lists from DataEmbeddingFunc - #31826
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/tag-and-rerun-ci |
97eaaf3 to
c2900e6
Compare
|
/rerun-failed-ci |
de12d75 to
4779ff5
Compare
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
CI recovery needed for the required The run was cancelled while jobs were queued/running; no executed test job failed. The PR-author Could a maintainer please use Re-run failed jobs on that run? This will retain the successful jobs and rerun only the cancelled/failed dependency chain. |
DataEmbeddingFunc may now return one tensor per input item, in addition to the existing combined [tokens, hidden] tensor or EVSEmbeddingResult. Encoders that naturally produce per-item outputs (e.g. looping over clips) can return the list directly and skip an encoder-side torch.cat that the per-item consumer (_get_chunked_embedding_by_item) would immediately split back apart. Each cached entry then owns its storage instead of being a torch.split view that pins the whole concatenated buffer for as long as any single item stays cached. _get_chunked_embedding_full flattens the per-item form (it caches the combined per-request embedding); _get_chunked_embedding_by_item keeps the per-item tensors as separate cache entries. Adds CPU-only unit tests asserting the per-item and combined forms produce bitwise-identical chunked-prefill embeddings, and that per-item cache entries own their storage while combined-tensor split views share it. Co-authored-by: Lu Fang <30275821+houseroad@users.noreply.github.com>
4779ff5 to
b36e7c0
Compare
The CI registry validator (collect_tests) rejects registered test files without an executable `if __name__ == "__main__":` block, since run_unittest_files invokes them as `python3 file.py -f`. This failed every base-a job at suite-collection time.
b36e7c0 to
518dce1
Compare
|
/rerun-test test/registered/vlm/test_vision_chunked_prefill.py test/registered/vlm/test_vlm_input_format.py |
|
Results for 🚀 |
|
@houseroad this pr failed xeon ci: as you can see here: https://github.com/sgl-project/sglang/actions/runs/30229696257/job/89886278479?pr=24959 and every pr-test-xeon workflow. Could you please fix this? Two things need to be updated:
|
Motivation
DataEmbeddingFunccurrently must return a single combined[tokens, hidden]tensor (or anEVSEmbeddingResult). Some encoders naturally produce per-item outputs — for example, an audio AutoEncoder that loops over clips. To satisfy the current contract they have totorch.cattheir per-item results, which the per-item consumer (_get_chunked_embedding_by_item) then immediately splits back apart viatorch.split. Those split views also pin the whole concatenated buffer for as long as any single item stays cached.Modifications
DataEmbeddingFuncmay now also returnList[torch.Tensor](one tensor per input item)._get_chunked_embedding_by_itemkeeps the per-item tensors as separate cache entries — no concat, no split, and each cache entry owns its storage._get_chunked_embedding_fullflattens the per-item form back to one tensor (it caches the combined per-request embedding) via a new_flatten_embedding_resulthelper.The per-item form is opt-in; existing encoders returning a single tensor or
EVSEmbeddingResultare unaffected.Tests
Adds CPU-only unit tests (
test/registered/chunked_prefill/test_mm_chunked_embedding_unit.py) that exercisemm_utilsinternals directly (no engine/GPU) and assert:_get_chunked_embedding_by_itemand_get_chunked_embedding_full;These tests could not be executed in the porting environment (no torch/pytest available); they run identically in the source environment.
Original commits
d4fd0560eCI States
Latest PR Test (Base): ✅ Run #30053812808
Latest PR Test (Extra): ❌ Run #30053812690