Skip to content

Build optimizations#4056

Draft
atobiszei wants to merge 8 commits intomainfrom
atobisze_build_opt
Draft

Build optimizations#4056
atobiszei wants to merge 8 commits intomainfrom
atobisze_build_opt

Conversation

@atobiszei
Copy link
Collaborator

No description provided.

- Remove unused #include "logging.hpp" from status.hpp (50+ files no longer
  transitively pull in spdlog). Add minimal #include <fmt/format.h> for
  fmt::formatter<StatusCode> specialization, with @fmtlib dep in BUILD.
- Remove #include <fmt/ranges.h> from logging.hpp; add it only to the 4
  files that actually format containers (imagegen_init.cpp,
  openai_completions.cpp, assisted_decoding_test.cpp, llmnode_test.cpp).
- Move <spdlog/sinks/basic_file_sink.h> and <spdlog/sinks/stdout_sinks.h>
  from logging.hpp to logging.cpp (sinks only needed in configure_logger()).
- Add explicit #include "logging.hpp" to color_format_configuration.cpp and
  precision_configuration.cpp that relied on the transitive include.

Verified: //src:ovms and //src:ovms_test build with mp_on_py_on,
mp_on_py_off, and mp_off_py_off configs.
Removed #include logging.hpp from 12 headers that had zero logging
symbol usage. Added explicit #include <fmt/format.h> to 3 headers that
have fmt::formatter specializations (grpc_utils.hpp, modelversionstatus.hpp,
nodeinfo.hpp). Added explicit #include logging.hpp to 2 files that lost
transitive include (tensor_conversion.hpp, tensor_conversion_common.cpp).
Updated BUILD deps: replaced libovmslogging with @fmtlib where only
fmt was needed.
…odel.hpp

- Removed #include <openvino/openvino.hpp>, replaced with forward
  declaration of ov::Core (only used as unique_ptr member)
- Removed #include <spdlog/spdlog.h> (unused in header)
- Removed #include <sys/stat.h> (unused in header)
- Replaced #include model.hpp with modelconfig.hpp + forward decl of
  Model. Moved modelFactory() body to modelmanager.cpp.
- Added #include <openvino/openvino.hpp> to modelmanager.cpp
- Added #include model.hpp to 4 .cpp files and 4 test files that
  used Model via shared_ptr through the transitive include.

This eliminates the entire OpenVINO umbrella header and spdlog from
the 17 translation units that include modelmanager.hpp.
…name

- Removed #include <fstream> (unused in header, added to .cpp)
- Removed #include <set> and dead static member configAllowedLayouts
  (declared but never defined or used anywhere)
- Removed #include anonymous_input_name.hpp, moved isShapeAuto(),
  isShapeAnonymous(), isShapeAnonymousFixed(), anyShapeSetToAuto()
  bodies from inline in header to modelconfig.cpp
- Added #include <fstream> and anonymous_input_name.hpp to .cpp
…to decouple mediapipe from ModelManager

- Create ServableNameChecker interface (servableExists) and MetricProvider
  interface (getMetricRegistry, getMetricConfig)
- ModelManager inherits both interfaces
- MediapipeFactory uses unique_ptr, forward-declared in modelmanager.hpp
- mediapipegraphdefinition.hpp/cpp depend on ServableNameChecker, not ModelManager
- mediapipefactory.hpp/cpp depend on interfaces, not ModelManager
- Remove dead parameters: retire(), create(), retireOtherThan(), revalidatePipelines()
- Add explicit mediapipefactory.hpp includes where needed (4 src + 3 test files)
…hecking

- Add ServableType enum (Model, Pipeline, Mediapipe) with bitmask operators
- servableExists() accepts ServableType check param to specify which types to check
- Mediapipe validate: checks Model | Pipeline (skips self)
- DAG validate: checks Model | Mediapipe (skips self), removes mediapipefactory.hpp include
- Model loading: checks Pipeline | Mediapipe (skips self), removes #if MEDIAPIPE_DISABLE guards
- All three servable types now use the same unified servableExists() function
…apper

- Change PipelineFactory member from value to unique_ptr in ModelManager
- Forward-declare PipelineFactory, Pipeline, ModelInstance, ModelInstanceUnloadGuard in modelmanager.hpp
- Move pipeline_factory.hpp include from modelmanager.hpp to modelmanager.cpp
- Remove template createPipeline wrapper from ModelManager
- Callers now use getPipelineFactory().create() directly
- Add explicit pipeline_factory.hpp includes to files that need it
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.

1 participant