Repository navigation
Conversation
16 sam3_hparams fields were read from the .ggml header and never used
again: ddec_ffn_dim, n_presence_tokens, n_geom_queries, n_amb_experts,
the SAM2 memory/tracking flags use_high_res_features,
use_obj_ptrs_in_encoder, directly_add_no_mem_embed,
non_overlap_masks_for_mem_enc, binarize_mask_from_pts,
multimask_output_for_tracking, multimask_{min,max}_pt_num,
iou_prediction_use_sigmoid, use_mask_input_as_output, and EdgeTAM's
mem_attn_ca_{q,k}_size. Seek past them instead, and keep their names
in comments so the file layout stays documented. The file format
itself doesn't change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq
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.
The three hparams loaders (
sam3_load_hparams,sam2_load_hparams,edgetam_load_extra_hparams) read 16 header fields intosam3_hparamsthat nothing reads again. The code hard-codes the behaviour those flags describe.ddec_ffn_dim,n_presence_tokens,n_geom_queries,n_amb_expertsuse_high_res_features,use_obj_ptrs_in_encoder,directly_add_no_mem_embed,non_overlap_masks_for_mem_enc,binarize_mask_from_pts,multimask_output_for_tracking,multimask_min_pt_num,multimask_max_pt_num,iou_prediction_use_sigmoid,use_mask_input_as_outputmem_attn_ca_q_size,mem_attn_ca_k_sizeThese fields are removed from the struct. Each loader gets a
skip(n)lambda (fin.seekg(4 * n, cur)), with the skipped field names in a trailing comment so the on-disk layout stays readable. The.ggmlformat doesn't change; converters still write every field.Verification: a parity tool loads models through both SAM2 paths (SAM2.1 Hiera and EdgeTAM extra hparams), then compares encode, PVS point + box, and a 3-frame visual track byte for byte with
origin/main:The SAM3 loader only has a compile check, because no full SAM3 checkpoint is available locally. Its change is three
rd→skipswaps in the same positions.git diff --shortstat: 1 file changed, 11 insertions(+), 32 deletions(-).Part of an over-engineering cleanup series.
🤖 Generated with Claude Code
https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq