Skip to main content

QuantTess.h File

QuantTess Node — fused CVU kernel that quantizes FP32→INT8 then tessellates. More...

Included Headers

#include "builder/NodeContractConfigurable.h" #include "builder/NodeContractProvider.h" #include "builder/Node.h" #include <nlohmann/json.hpp> #include <memory> #include <optional> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

structQuantTessOptions

Construction options for a QuantTess Node. More...

classQuantTess

Fused CVU kernel Node: Quant (FP32→INT8) followed by Tess. More...

Description

QuantTess Node — fused CVU kernel that quantizes FP32→INT8 then tessellates.

Combines an INT8 quantize and a tessellate layout shuffle into a single CVU pass. Inserted by the route planner before the MLA when the model expects INT8 input and MLA-side tessellation is not part of the compiled MLA kernel — fusing the two stages saves a DDR round-trip versus running Quant and Tess back to back.

See Also

"The dtype contract" page in /concepts/dtype_contract

File Listing

The file content with the documentation metadata removed is:

1
13#pragma once
14
15#include "builder/NodeContractConfigurable.h"
16#include "builder/NodeContractProvider.h"
17#include "builder/Node.h"
18#ifdef SIMA_NEAT_INTERNAL
19#include "model/internal/ModelRouteRetarget.h"
20#endif
21
22#include <nlohmann/json.hpp>
23
24#include <memory>
25#include <optional>
26#include <string>
27#include <vector>
28
29namespace simaai::neat {
30class Model;
31struct CompiledProcessCvuContract;
32
40 QuantTessOptions() = default;
42 explicit QuantTessOptions(const simaai::neat::Model& model);
43
44 std::string config_path;
45 std::optional<nlohmann::json>
47 std::string element_name;
48 std::shared_ptr<const CompiledProcessCvuContract>
50 int num_buffers = 0;
52 bool num_buffers_locked = false;
53#ifdef SIMA_NEAT_INTERNAL
54 std::shared_ptr<const simaai::neat::internal::ModelLineageBinding> model_lineage;
55#endif
56};
57
69class QuantTess final : public Node, public NodeContractProvider, public NodeContractConfigurable {
70public:
72 explicit QuantTess(QuantTessOptions opt = {});
73 struct ConfigHolder;
74
76 std::string kind() const override {
77 return "QuantTess";
78 }
80 NodeCapsBehavior caps_behavior() const override {
81 return NodeCapsBehavior::Static;
82 }
86 bool compile_node_contract(const ContractCompileInput& input, CompiledNodeContract* out,
87 std::string* err) const override;
89 void apply_compiled_contract(const CompiledNodeContract& contract, std::string* err) override;
91 std::string backend_fragment(int node_index) const override;
93 std::vector<std::string> element_names(int node_index) const override;
94
96 const nlohmann::json* config_json() const;
97
99 const QuantTessOptions& options() const {
100 return opt_;
101 }
103 const std::string& config_path() const {
104 return config_path_;
105 }
106
107#ifdef SIMA_NEAT_INTERNAL
108 const std::optional<CompiledProcessCvuContract>& compiled_contract_internal() const;
109#endif
110
111private:
113 std::shared_ptr<ConfigHolder> config_holder_;
114 std::string config_path_;
115};
116
117} // namespace simaai::neat
118
119namespace simaai::neat::nodes {
121std::shared_ptr<simaai::neat::Node> QuantTess(QuantTessOptions opt = {});
122} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.