Download SAM3 models at build time instead of vendoring them (v10.1) - #965
Draft
JWhitleyWork wants to merge 1 commit into
Draft
JWhitleyWork wants to merge 1 commit into
JWhitleyWork wants to merge 1 commit into
Conversation
moveit_pro_sam3 was a submodule whose repository committed Meta's SAM3 ONNX exports, so every clone of this workspace redistributed them. The package now lives in-tree and its CMakeLists.txt downloads the four q4f16 assets from jamjamjon/assets release sam3 at configure time, checks each against a pinned SHA-256, and installs them to share/moveit_pro_sam3/models. A file already present with the expected hash is not fetched again, and SAM3_MODEL_URL accepts a file:// directory for offline builds. The package's .gitignore ignores the COLCON_IGNORE that `moveit_pro` writes when the SAM License is declined, so a declined workspace no longer reads as dirty. Meta's license text is excluded from codespell, which otherwise rewrites it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
|
Consider whether the change should land upstream in Overlapping files
|
|
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.
[written by AI]
Motivation
src/moveit_pro_sam3is a submodule of PickNikRobotics/moveit_pro_sam3, which commits Meta's SAM 3 ONNX exports, so every clone of this workspace redistributes them. This PR stops that: the package moves in-tree and its build downloads the model from the upstream release instead.Paired with the moveit_pro backport of the SAM License prompt: PickNikRobotics/moveit_pro#22703. The two PRs do not depend on each other to build or pass CI.
Brief description
main(d307e95) without the.onnxfiles or the LFS.gitattributes.CMakeLists.txtdownloads the four*-q4f16.onnxassets from jamjamjon/assets releasesam3at configure time intobuild/moveit_pro_sam3/models, verifies each pinned SHA-256, renames them to the existingsam3_*.onnxnames, and installs them toshare/moveit_pro_sam3/models. A file already present with the right hash is not fetched again. A failed download or a hash mismatch stops the build with the URL, the cause, and the offline and decline options.-DSAM3_MODEL_URL=file:///<dir>builds offline.models/model.yaml.inbecomes the bundle manifest, which CMake fills with the pinned digests and writes beside the downloaded files. MoveIt Pro's loader (src/ml/src/model_bundle.cpp,resolvesOutsideBundle) follows symlinks and rejects artifacts that do not sit beside the manifest's real location, so installingmodel.yamlfromsrc/next to ONNX files frombuild/would fail every load..gitignoreignoresCOLCON_IGNORE(written bymoveit_proon a license decline) and*.onnx. Because the models live in the package's build directory, the CLI's decline, which deletesbuild/moveit_pro_sam3andinstall/moveit_pro_sam3, also deletes the downloaded model.src/moveit_pro_sam3/models/LICENSE: its--write-changesrewrote "THEREFROM" in Meta's license text.Needs review: download source
licensing-privacy-botflagged the download source for sign-off (@davetcoleman). The four pinned digests match the release's own digests, and PickNik no longer distributes the weights. But:jamjamjon/assetsis a personal account whose repository declares GPL-3.0, and thesam3release (53 assets, empty body) includes no copy of the SAM License, which the license requires of redistributors. The old submodule redistributed these same files; this PR points users at that copy instead.moveit_pro_sam3stops building on every tag carrying this CMakeLists. The hash pin catches a replaced file, not a missing one.SAM3_MODEL_URL), or our own export from Meta's gated checkpoint.Not addressed here: PickNikRobotics/moveit_pro_sam3 and earlier tags of this repository still serve the model files.
How it was tested
ament_cmakeon CMake 4.2.3 and 3.22.6:file://source, re-configure with no downloads, a corrupted file re-fetched, an unreachable URL (fails with the message above, no partial file left), and a hash mismatch (fails, no file kept).sha256summatches the pins.moveit_proworkspace upgrade sequence (submodule deinit --all --force,checkout --recurse-submodules=no,submodule update --init --recursive) from a tag with the submodule to one with the in-tree package and back, with a declined user'sCOLCON_IGNOREpresent: both directions leavegit statusclean.pre-commit run -apasses;models/LICENSEis byte-identical to moveit_pro_sam3's copy.Agent checks
code-reviewer: no required changes. Applied:INACTIVITY_TIMEOUTon the download so a stalled connection fails instead of hanging configure, and the error prints the status message rather than CMake's raw list.licensing-privacy-bot: privacy none; licensing review-needed item above.set(CMAKE_INSTALL_MODE ABS_SYMLINK), which CMake only reads from the environment, so it never did anything. Not applied: a 900 s total download timeout, which the 277 MB and 288 MB assets can legitimately exceed on slow links;INACTIVITY_TIMEOUTalready ends a stalled download.🤖 Generated with Claude Code