"dockerfile/rocm5.1.x.dockerfile" did not exist on "e08b6d3a1cc32ac978182acd0be0ce197ca18e0d"
graph_compiler.hpp 680 Bytes
Newer Older
1
2
3
#pragma once

#include "../../models/infinilm_model.hpp"
4
#include "../rank_barrier.hpp"
5
6
7
8
9
10
11
12
13

namespace infinilm::engine {

class GraphCompiler {
public:
    using Compiled = std::tuple<
        std::shared_ptr<infinicore::graph::Graph>,
        std::shared_ptr<InfinilmModel::Output>>;

14
    explicit GraphCompiler(const std::shared_ptr<InfinilmModel> &model, RankBarrier *barrier) : model_(model), barrier_(barrier) {}
15
16
17
18
19
20
21
    virtual ~GraphCompiler() = default;

    virtual void compile() = 0;
    virtual Compiled get_compiled(const InfinilmModel::Input &input) = 0;

protected:
    std::shared_ptr<InfinilmModel> model_;
22
    RankBarrier *barrier_;
23
24
25
};

} // namespace infinilm::engine