Quant.h File
Quant Node — CVU kernel that quantizes FP32 to INT8 (scale + zero-point). 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
| namespace | simaai |
| namespace | neat |
| namespace | nodes |
Classes Index
| struct | QuantOptions |
| class | Quant |
|
CVU kernel Node that quantizes FP32 tensors to INT8 using scale + zero-point. More... | |
Description
Quant Node — CVU kernel that quantizes FP32 to INT8 (scale + zero-point).
Reads FP32 tensors and emits INT8 using the per-tensor scale and zero-point bound to the model. Inserted at the MLA boundary on the INT8 path before the MLA when the upstream stage emits FP32.
- See Also
"The dtype contract" page in /concepts/dtype_contract
File Listing
The file content with the documentation metadata removed is:
28namespace simaai::neat {
37struct QuantOptions {
39 QuantOptions() = default;
41 explicit QuantOptions(const simaai::neat::Model& model);
43 std::string config_path;
46 std::string element_name;
49 int num_buffers = 0;
50 int num_buffers_model = 0;
51 bool num_buffers_locked = false;
71 explicit Quant(QuantOptions opt = {});
79 NodeCapsBehavior caps_behavior() const override {
83 NodeContractDefinition contract_definition() const override;
85 bool compile_node_contract(const ContractCompileInput& input, CompiledNodeContract* out,
88 void apply_compiled_contract(const CompiledNodeContract& contract, std::string* err) override;
90 std::string backend_fragment(int node_index) const override;
92 std::vector<std::string> element_names(int node_index) const override;
95 const nlohmann::json* config_json() const;
98 const QuantOptions& options() const {
102 const std::string& config_path() const {
111 QuantOptions opt_;
118namespace simaai::neat::nodes {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.