Cast.h File
Cast Node — CVU kernel that converts between FP32 and BF16 element-wise. More...
Included Headers
#include "builder/Node.h"
#include "builder/NodeContractConfigurable.h"
#include "builder/NodeContractProvider.h"
#include "builder/OutputSpec.h"
#include <memory>
#include <string>
#include <vector>
Namespaces Index
| namespace | simaai |
| namespace | neat |
| namespace | nodes |
Classes Index
| struct | CastOptions |
| class | Cast |
|
CVU kernel Node that casts a tensor between FP32 and BF16 (no scale/zero-point). More... | |
Description
Cast Node — CVU kernel that converts between FP32 and BF16 element-wise.
Pure dtype conversion with no scale/zero-point — distinct from Quant/Dequant. Inserted at the MLA boundary on the BF16 path: before the MLA when the model expects BF16 input but the upstream stage emits FP32, or after the MLA on the BF16 output path.
- See Also
"The dtype contract" page in /concepts/dtype_contract
File Listing
The file content with the documentation metadata removed is:
26namespace simaai::neat {
30enum class CastDirection {
31 Bf16ToFp32 = 0,
32 Fp32ToBf16 = 1,
40struct CastOptions {
42 std::string element_name;
46 int num_buffers = 0;
70 explicit Cast(CastOptions opt = {});
77 NodeCapsBehavior caps_behavior() const override {
81 std::string backend_fragment(int node_index) const override;
83 std::vector<std::string> element_names(int node_index) const override;
85 OutputSpec output_spec(const OutputSpec& input) const override;
87 NodeContractDefinition contract_definition() const override;
89 bool compile_node_contract(const ContractCompileInput& input, CompiledNodeContract* out,
92 void apply_compiled_contract(const CompiledNodeContract& contract, std::string* err) override;
95 const CastOptions& options() const {
100 CastOptions opt_;
105namespace simaai::neat::nodes {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.