Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1aeb274
perf(multimodal): decode sampled video frames sequentially, not per-f…
yechank-nvidia Jun 23, 2026
34023a5
perf(multimodal): reduce vision preprocessing overhead
yechank-nvidia Jun 25, 2026
c3e7bf2
perf(tokenspeed): optimize multimodal tensor handoff
yechank-nvidia Jun 25, 2026
1557dba
fix(multimodal): address review validation gaps
yechank-nvidia Jun 26, 2026
bca3c04
fix(multimodal): address follow-up review gaps
yechank-nvidia Jun 26, 2026
2b215d1
style(tokenspeed): apply ruff formatting
yechank-nvidia Jun 26, 2026
7611aaf
test(tokenspeed): skip shm tests without torch
yechank-nvidia Jun 26, 2026
7e68ea6
fix(multimodal): satisfy clippy in qwen tests
yechank-nvidia Jun 26, 2026
9ce64ed
test(tokenspeed): clean shm file on failure
yechank-nvidia Jun 26, 2026
fb864c4
fix(tokenspeed): satisfy clippy in multimodal assembly
yechank-nvidia Jun 26, 2026
2003572
fix(responses): sanitize mcp replay errors
yechank-nvidia Jun 26, 2026
93683aa
Revert "fix(responses): sanitize mcp replay errors"
yechank-nvidia Jun 29, 2026
32e8f70
style(multimodal): apply rustfmt
yechank-nvidia Jun 29, 2026
87a09ca
fix(multimodal): address review feedback
yechank-nvidia Jun 30, 2026
53e5238
style(tokenspeed): apply ruff formatting
yechank-nvidia Jun 30, 2026
56a6f20
perf(multimodal): adapt OpenCV decoder threads
yechank-nvidia Jun 30, 2026
41dd682
perf(multimodal): tune decoder threads across CPU quotas
yechank-nvidia Jun 30, 2026
671d34f
refactor(multimodal): clarify adaptive decoder budgeting
yechank-nvidia Jun 30, 2026
ee5facd
perf(multimodal): reuse preprocessing worker pool
yechank-nvidia Jun 30, 2026
d74b216
perf(multimodal): parallelize encoder tensor serialization
yechank-nvidia Jun 30, 2026
68207d9
perf(multimodal): serialize encoder tensors into mapped shm
yechank-nvidia Jul 1, 2026
f086ed0
perf(multimodal): skip identity bicubic resize passes
yechank-nvidia Jul 1, 2026
61a3e8b
perf(multimodal): defer Qwen video normalization for TokenSpeed
yechank-nvidia Jul 1, 2026
6e8466b
perf(tokenspeed): use worker vision encoder dtype
yechank-nvidia Jul 1, 2026
beae33f
perf(multimodal): defer Qwen image normalization
yechank-nvidia Jul 1, 2026
256ee99
perf(multimodal): precompute deferred BF16 normalization
yechank-nvidia Jul 1, 2026
9c44bbf
perf(multimodal): decode buffered videos without tempfiles
yechank-nvidia Jul 1, 2026
c36f075
fix(multimodal): propagate OpenCV probe errors
yechank-nvidia Jul 1, 2026
61eab84
perf(multimodal): patchify resized Qwen video directly
yechank-nvidia Jul 1, 2026
58e5a76
Overlap video decode and Qwen preprocessing
yechank-nvidia Jul 1, 2026
349528e
Enable adaptive video preprocessing overlap
yechank-nvidia Jul 1, 2026
5d82941
Avoid RGB conversion in streamed video preprocessing
yechank-nvidia Jul 1, 2026
876f639
Remove multimodal performance environment knobs
yechank-nvidia Jul 1, 2026
32a5419
Own multimodal execution resources explicitly
yechank-nvidia Jul 1, 2026
4028d63
Model multimodal payload representations explicitly
yechank-nvidia Jul 1, 2026
b2a4935
Unify multimodal preprocessing dispatch
yechank-nvidia Jul 1, 2026
3b98743
Separate multimodal backend assembly
yechank-nvidia Jul 1, 2026
ae75181
Separate multimodal assembly responsibilities
yechank-nvidia Jul 1, 2026
bdbe1fb
Isolate TokenSpeed transport policy
yechank-nvidia Jul 1, 2026
19b2215
Make prepared media modality exhaustive
yechank-nvidia Jul 1, 2026
5ffa5cc
Simplify multimodal assembly intermediate
yechank-nvidia Jul 1, 2026
8cd337c
Generalize multimodal processor registry
yechank-nvidia Jul 1, 2026
6c84189
Carry prepared media through preprocessing
yechank-nvidia Jul 1, 2026
02d18b4
Use neutral multimodal assembly metadata
yechank-nvidia Jul 1, 2026
4b5504a
Type multimodal preprocessing requests
yechank-nvidia Jul 1, 2026
7285463
Make processor matching deterministic
yechank-nvidia Jul 1, 2026
d4756df
Address multimodal review findings
yechank-nvidia Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ axum = { version = "0.8.9" }
blake3 = "1.8"
lz4_flex = "0.13"
bytemuck = { version = "1.25" }
memmap2 = "0.9"
chrono = { version = "0.4" }
dashmap = "6.2.1"
http = "1.4.2"
lru = "0.18.0"
libc = "0.2"
num-traits = "0.2"
parking_lot = "0.12.5"
rand = "0.10.1"
Expand Down
15 changes: 14 additions & 1 deletion crates/multimodal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@ image = { version = "0.25.10", default-features = false, features = ["png", "jpe
libloading = "0.8"
ndarray = "0.17"
once_cell = "1.21.4"
rayon = "1.12"
opencv = { version = "0.99.0", default-features = false, features = ["clang-runtime", "imgproc", "videoio"], optional = true }
reqwest = { workspace = true, features = ["stream"] }
serde = { workspace = true, features = ["derive"] }
serde_bytes = "0.11"
serde_json.workspace = true
tempfile = "3.27"
thiserror.workspace = true
tokio = { workspace = true, features = ["sync", "fs", "rt-multi-thread", "process", "time"] }
tokio = { workspace = true, features = [
"sync",
"fs",
"io-util",
"macros",
"rt-multi-thread",
"process",
"time",
Comment thread
yechank-nvidia marked this conversation as resolved.
] }
Comment thread
coderabbitai[bot] marked this conversation as resolved.
tracing.workspace = true
url = "2.5.8"

Expand All @@ -49,6 +58,10 @@ criterion = { version = "0.8", features = ["html_reports"] }
npyz = { version = "0.9", features = ["npz"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

[build-dependencies]
cc = "1"
pkg-config = "0.3"

[[bench]]
name = "image_preprocess"
harness = false
Expand Down
31 changes: 31 additions & 0 deletions crates/multimodal/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use std::env;

fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=src/opencv_buffer_capture.cpp");
println!("cargo:rerun-if-env-changed=OPENCV_INCLUDE_PATHS");
if env::var_os("CARGO_FEATURE_OPENCV_VIDEO").is_none() {
return Ok(());
}

let mut build = cc::Build::new();
build
.cpp(true)
.file("src/opencv_buffer_capture.cpp")
.flag_if_supported("-std=c++17");

if let Some(paths) = env::var_os("OPENCV_INCLUDE_PATHS") {
for path in env::split_paths(&paths) {
build.include(path);
}
} else {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
let opencv = pkg_config::Config::new()
.cargo_metadata(false)
.probe("opencv4")?;
for path in opencv.include_paths {
build.include(path);
}
}

build.compile("smg_opencv_buffer_capture");
Ok(())
}
2 changes: 2 additions & 0 deletions crates/multimodal/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub enum MediaConnectorError {
DataUrl(String),
#[error("media decode task failed: {0}")]
Blocking(#[from] tokio::task::JoinError),
#[error("failed to initialize multimodal runtime: {0}")]
Runtime(String),
#[error("image decode error: {0}")]
Image(#[from] image::ImageError),
#[error("video decode error: {0}")]
Expand Down
10 changes: 8 additions & 2 deletions crates/multimodal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ pub mod hasher;
pub mod hub;
pub mod jpeg_turbo;
pub mod media;
#[cfg(feature = "opencv-video")]
mod opencv_buffer;
pub mod registry;
pub mod runtime;
pub mod tracker;
pub mod types;
pub mod vision;
Expand All @@ -13,6 +16,7 @@ pub use media::{
ImageFetchConfig, MediaConnector, MediaConnectorConfig, MediaSource, VideoFetchConfig,
};
pub use registry::{ModelMetadata, ModelProcessorSpec, ModelRegistry};
pub use runtime::MultimodalRuntime;
pub use tracker::{AsyncMultiModalTracker, TrackerOutput};
pub use types::{
FieldLayout, ImageDetail, ImageFrame, ImageSize, ImageSource, MediaContentPart, Modality,
Expand All @@ -21,6 +25,8 @@ pub use types::{
};
// Re-export vision processing components
pub use vision::{
LlavaNextProcessor, LlavaProcessor, ModelSpecificValue, PreProcessorConfig,
PreprocessedEncoderInputs, TransformError, VisionPreProcessor, VisionProcessorRegistry,
DeferredNormalizedEncoderInput, EncoderInput, LlavaNextProcessor, LlavaProcessor,
ModalityPreProcessor, ModalityProcessorRegistry, ModelSpecificValue, OutputPreference,
PreProcessorConfig, PreprocessRequest, PreprocessedEncoderInputs, TransformError, VideoInput,
VisionInput, VisionPreProcessor, VisionPreprocessRequest, VisionProcessorRegistry,
};
Loading
Loading