model_factory.hpp 1.52 KB
Newer Older
1
2
#pragma once

3
#include "../config/model_config.hpp"
4
5
#include "infinilm_model.hpp"

6
#include "../backends/attention_backends.hpp"
7
8
9
10
11
#include "../engine/distributed/distributed.hpp"

namespace infinilm {
class InfinilmModelFactory {
public:
12
13
14
15
16
17
18
19
20
21
22
23
    /**
     * @deprecated This function is deprecated and will be REMOVED in the next major release (v0.2.0).
     *
     * ⚠️ DEVELOPMENT POLICY:
     *   - NO new development or feature additions permitted on this interface
     *   - Only critical bug fixes (security/stability) allowed until removal
     *   - All new code MUST migrate to the polymorphic overload below
     *
     * Replacement: Use the polymorphic overload of this same function name with updated signature
     * Reason: Legacy signature lacks support for dynamic quantization modes.
     * Removal target: v0.2.0 (Q2 2026)
     */
PanZezhong's avatar
PanZezhong committed
24
25
26
    static std::shared_ptr<InfinilmModel> createModel(
        const InfinilmModel::Config &config,
        engine::distributed::RankInfo rank_info = engine::distributed::RankInfo(),
27
28
        const cache::CacheConfig *cache = nullptr,
        backends::AttentionBackend attention_backend = backends::AttentionBackend::Default);
29
30
31
32

    static std::shared_ptr<InfinilmModel> createModel(
        std::shared_ptr<infinilm::config::ModelConfig> model_config,
        engine::distributed::RankInfo rank_info = engine::distributed::RankInfo(),
33
34
        const cache::CacheConfig *cache = nullptr,
        backends::AttentionBackend attention_backend = backends::AttentionBackend::Default);
35
36
};
} // namespace infinilm