Skip to content

Complete VLM processor TODOs - #301

Merged
davidkoski merged 5 commits into
ml-explore:mainfrom
RNT56:upstream-pr/vlm-processor-completions
Oct 12, 2026
Merged

davidkoski merged 5 commits into
ml-explore:mainfrom
RNT56:upstream-pr/vlm-processor-completions

Conversation

@RNT56

@RNT56 RNT56 commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Complete the FastVLM and SmolVLM2 processor TODOs so their processor configuration paths are implemented instead of placeholder behavior.

Changes

  • Wire FastVLM multimodal token splitting through tokenizer_model_max_length, tokenizer padding side, and explicit missing-image-token validation.
  • Complete SmolVLM2 processor configuration handling for image sequence-length aliases, validation, media ordering, tokenizer image-token lookup, and bounded video-frame settings.
  • Fix in-memory UserInput.Video.frames processing so maxFrames is honored consistently with asset-backed videos.
  • Add focused VLM processor regression coverage for the completed behavior.

Validation

  • pre-commit run --all-files
  • swift build --target MLXVLM
  • swift test --filter VLMProcessorTests
  • swift test --filter SmolVLM2TilingTests
  • swift test --filter UserInputTests
  • xcodebuild build-for-testing -scheme mlx-swift-lm-Package -destination 'platform=macOS'
  • xcrun xctest ~/Library/Developer/Xcode/DerivedData/mlx-swift-lm-vlm-processors-*/Build/Products/Debug/MLXLMTests.xctest

@davidkoski

Copy link
Copy Markdown
Member

Is this ready for review? Still in draft.

@RNT56
RNT56 force-pushed the upstream-pr/vlm-processor-completions branch from 0c92cf0 to 1ad570a Compare June 20, 2026 15:35
@RNT56
RNT56 marked this pull request as ready for review June 20, 2026 15:35
@RNT56

RNT56 commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Ready for review now.

I refreshed the branch onto current main and completed the VLM processor patch at 1ad570a:

  • FastVLM now validates the required image token and trims text around the image block using tokenizer_model_max_length plus tokenizer padding side.
  • SmolVLM2 processor configuration handles image sequence-length aliases/validation, media ordering, tokenizer image-token lookup, and bounded video-frame settings.
  • In-memory UserInput.Video.frames processing now honors maxFrames, matching the asset-backed video path.
  • Added focused regression coverage for these processor contracts.

Validation passed locally:

  • pre-commit run --all-files
  • swift build --target MLXVLM
  • swift test --filter VLMProcessorTests
  • swift test --filter SmolVLM2TilingTests
  • swift test --filter UserInputTests
  • xcodebuild build-for-testing -scheme mlx-swift-lm-Package -destination 'platform=macOS'
  • xcrun xctest ~/Library/Developer/Xcode/DerivedData/mlx-swift-lm-vlm-processors-*/Build/Products/Debug/MLXLMTests.xctest

I also marked the PR ready for review.

Comment thread Libraries/MLXVLM/Models/SmolVLM2.swift Resolved
Comment thread Libraries/MLXVLM/MediaProcessing.swift Resolved

@davidkoski davidkoski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. See what you think of the comments -- the unknown one might be worth fixing or we can do a follow up PR. Thank you!

@RNT56

RNT56 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

I rechecked the failed macOS job on the latest head (301233ad41afcbd5c95abca0bdcfd85026787faf).

The workflow shows the build, documentation verification, and Xcode tests all completed successfully. The job was then marked failed with:

The self-hosted runner lost communication with the server.

gh run view --job 83329633822 also reports no failed command-step log for the job. I do not see evidence of a patch failure here. Could you rerun mac_build_and_test when the runner is healthy? I will avoid changing the PR unless a rerun exposes a real build or test failure.

@davidkoski

Copy link
Copy Markdown
Member

Working on this, see #690.

@davidkoski
davidkoski merged commit 648693c into ml-explore:main Oct 12, 2026
5 checks passed
div0-space pushed a commit to LibraxisAI/mlx-swift-lm that referenced this pull request Nov 29, 2026
…tage-seam

test(nemotron): check the Nemotron-H stage seam against the complete model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants