Skip to content

UPSTREAM PR #17946: mtmd: explicitly forbidden inclusion of private header and libcommon#528

Open
loci-dev wants to merge 1 commit intomainfrom
upstream-PR17946-branch_ngxson-xsn/mtmd_no_internal
Open

UPSTREAM PR #17946: mtmd: explicitly forbidden inclusion of private header and libcommon#528
loci-dev wants to merge 1 commit intomainfrom
upstream-PR17946-branch_ngxson-xsn/mtmd_no_internal

Conversation

@loci-dev
Copy link

Mirrored from ggml-org/llama.cpp#17946

This is a foolproof solution against misuse of internal mtmd headers and libcommon

These changes can potentially be overlooked on some PRs when there are a lot of code changing. Notably ggml-org/llama.cpp#16910 ; other examples can be: ggml-org/llama.cpp#17223, ggml-org/llama.cpp#17914

@loci-review
Copy link

loci-review bot commented Dec 11, 2025

Explore the complete analysis inside the Version Insights

Performance Analysis Summary - PR #528

Overview

This PR introduces compile-time architectural enforcement mechanisms for the mtmd (multimodal) library with zero runtime performance impact. The changes add preprocessor guards and CMake validation to prevent misuse of internal headers and accidental linking against the common library.

Performance Impact Assessment

No performance changes detected. All modifications are build-time only:

  • CMakeLists.txt: Added dependency validation check (executes during CMake configuration)
  • clip.h, clip-impl.h, mtmd-audio.h: Added MTMD_INTERNAL_HEADER preprocessor defines
  • mtmd-helper.cpp: Added compile-time guard using #error directive

Binary Analysis:

  • libmtmd.so: 131,638 nJ (0.000% change, -1 nJ measurement noise)
  • libllama.so: 195,496 nJ (0.000% change, +1 nJ measurement noise)
  • All other binaries: 0.000% change

Function-Level Analysis:
No functions show measurable response time or throughput changes. The summary report confirms no comparable function data exists between versions, indicating identical performance characteristics.

Tokens Per Second Impact:
None. Inference functions (llama_decode, llama_encode, llama_tokenize) remain completely unmodified. No changes to execution paths, instruction counts, or memory access patterns in the inference pipeline.

3 similar comments
@loci-review
Copy link

loci-review bot commented Dec 11, 2025

Explore the complete analysis inside the Version Insights

Performance Analysis Summary - PR #528

Overview

This PR introduces compile-time architectural enforcement mechanisms for the mtmd (multimodal) library with zero runtime performance impact. The changes add preprocessor guards and CMake validation to prevent misuse of internal headers and accidental linking against the common library.

Performance Impact Assessment

No performance changes detected. All modifications are build-time only:

  • CMakeLists.txt: Added dependency validation check (executes during CMake configuration)
  • clip.h, clip-impl.h, mtmd-audio.h: Added MTMD_INTERNAL_HEADER preprocessor defines
  • mtmd-helper.cpp: Added compile-time guard using #error directive

Binary Analysis:

  • libmtmd.so: 131,638 nJ (0.000% change, -1 nJ measurement noise)
  • libllama.so: 195,496 nJ (0.000% change, +1 nJ measurement noise)
  • All other binaries: 0.000% change

Function-Level Analysis:
No functions show measurable response time or throughput changes. The summary report confirms no comparable function data exists between versions, indicating identical performance characteristics.

Tokens Per Second Impact:
None. Inference functions (llama_decode, llama_encode, llama_tokenize) remain completely unmodified. No changes to execution paths, instruction counts, or memory access patterns in the inference pipeline.

@loci-review
Copy link

loci-review bot commented Dec 11, 2025

Explore the complete analysis inside the Version Insights

Performance Analysis Summary - PR #528

Overview

This PR introduces compile-time architectural enforcement mechanisms for the mtmd (multimodal) library with zero runtime performance impact. The changes add preprocessor guards and CMake validation to prevent misuse of internal headers and accidental linking against the common library.

Performance Impact Assessment

No performance changes detected. All modifications are build-time only:

  • CMakeLists.txt: Added dependency validation check (executes during CMake configuration)
  • clip.h, clip-impl.h, mtmd-audio.h: Added MTMD_INTERNAL_HEADER preprocessor defines
  • mtmd-helper.cpp: Added compile-time guard using #error directive

Binary Analysis:

  • libmtmd.so: 131,638 nJ (0.000% change, -1 nJ measurement noise)
  • libllama.so: 195,496 nJ (0.000% change, +1 nJ measurement noise)
  • All other binaries: 0.000% change

Function-Level Analysis:
No functions show measurable response time or throughput changes. The summary report confirms no comparable function data exists between versions, indicating identical performance characteristics.

Tokens Per Second Impact:
None. Inference functions (llama_decode, llama_encode, llama_tokenize) remain completely unmodified. No changes to execution paths, instruction counts, or memory access patterns in the inference pipeline.

@loci-review
Copy link

loci-review bot commented Dec 11, 2025

Explore the complete analysis inside the Version Insights

Performance Analysis Summary - PR #528

Overview

This PR introduces compile-time architectural enforcement mechanisms for the mtmd (multimodal) library with zero runtime performance impact. The changes add preprocessor guards and CMake validation to prevent misuse of internal headers and accidental linking against the common library.

Performance Impact Assessment

No performance changes detected. All modifications are build-time only:

  • CMakeLists.txt: Added dependency validation check (executes during CMake configuration)
  • clip.h, clip-impl.h, mtmd-audio.h: Added MTMD_INTERNAL_HEADER preprocessor defines
  • mtmd-helper.cpp: Added compile-time guard using #error directive

Binary Analysis:

  • libmtmd.so: 131,638 nJ (0.000% change, -1 nJ measurement noise)
  • libllama.so: 195,496 nJ (0.000% change, +1 nJ measurement noise)
  • All other binaries: 0.000% change

Function-Level Analysis:
No functions show measurable response time or throughput changes. The summary report confirms no comparable function data exists between versions, indicating identical performance characteristics.

Tokens Per Second Impact:
None. Inference functions (llama_decode, llama_encode, llama_tokenize) remain completely unmodified. No changes to execution paths, instruction counts, or memory access patterns in the inference pipeline.

@loci-dev loci-dev force-pushed the main branch 24 times, most recently from f70847d to 45e0e28 Compare December 14, 2025 22:08
@loci-dev loci-dev force-pushed the main branch 30 times, most recently from ec69147 to 883e4ba Compare December 19, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants