Skip to main content

DetessDequant.h File

DetessDequant Node — fused CVU kernel that detessellates and dequantizes INT8→FP32. More...

Included Headers

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

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

structDetessDequantOptions

Construction options for a DetessDequant Node. More...

classDetessDequant

Fused CVU kernel Node: Detess followed by Dequant (INT8→FP32). More...

Description

DetessDequant Node — fused CVU kernel that detessellates and dequantizes INT8→FP32.

Combines an MLA-layout untessellate with an INT8→FP32 dequantize in a single CVU pass. Inserted after MLA stages on the INT8 output path when downstream wants natural HWC/CHW float tensors — fusing saves a DDR round-trip versus running Detess then Dequant.

See Also

"The dtype contract" page in /concepts/dtype_contract

File Listing

The file content with the documentation metadata removed is:

1
12#pragma once
13
14#include "builder/Node.h"
15#include "builder/NodeContractConfigurable.h"
16#include "builder/NodeContractProvider.h"
17#include "builder/OutputSpec.h"
18
19#include <nlohmann/json.hpp>
20
21#include <memory>
22#include <optional>
23#include <string>
24#include <vector>
25
26namespace simaai::neat {
27class Model;
28struct CompiledProcessCvuContract;
29} // namespace simaai::neat
30
31namespace simaai::neat {
32
43
44 std::string config_path;
45 std::optional<nlohmann::json>
47 std::string upstream_name;
48 std::string element_name;
49 std::shared_ptr<const CompiledProcessCvuContract>
51 int num_buffers = 0;
53 bool num_buffers_locked = false;
54};
55
67class DetessDequant final : public Node,
68 public NodeContractProvider,
69 public NodeContractConfigurable,
70 public OutputSpecProvider {
71public:
74 struct ConfigHolder;
75
77 std::string kind() const override {
78 return "DetessDequant";
79 }
81 NodeCapsBehavior caps_behavior() const override {
82 return NodeCapsBehavior::Static;
83 }
87 bool compile_node_contract(const ContractCompileInput& input, CompiledNodeContract* out,
88 std::string* err) const override;
90 void apply_compiled_contract(const CompiledNodeContract& contract, std::string* err) override;
92 std::string backend_fragment(int node_index) const override;
94 std::vector<std::string> element_names(int node_index) const override;
96 OutputSpec output_spec(const OutputSpec& input) const override;
97
99 const nlohmann::json* config_json() const;
100
103 return opt_;
104 }
106 const std::string& config_path() const {
107 return config_path_;
108 }
109
110#ifdef SIMA_NEAT_INTERNAL
111 const std::optional<CompiledProcessCvuContract>& compiled_contract_internal() const;
112#endif
113
114private:
116 std::shared_ptr<ConfigHolder> config_holder_;
117 std::string config_path_;
118};
119
120} // namespace simaai::neat
121
122namespace simaai::neat::nodes {
124std::shared_ptr<simaai::neat::Node> DetessDequant(DetessDequantOptions opt = {});
125} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.