Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for GetStableHloQuantConstraints (0.42 sec)

  1. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.h

    std::unique_ptr<OpQuantSpec> GetStableHloOpQuantSpec(Operation* op);
    
    // Returns quantization constraints (ex: fixed output, same scale) given
    // a StableHLO op.
    std::unique_ptr<OpQuantScaleSpec> GetStableHloQuantConstraints(Operation* op);
    
    // Checks if an op is quantizable in StableHLO quantizer. Argument op is not
    // necessarily a StableHLO op.
    bool IsOpQuantizableStableHlo(Operation* op);
    
    }  // namespace mlir::quant::stablehlo
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 05:11:03 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.cc

        for (const auto [operand_idx, per_channel_dim] : spec->coeff_op_quant_dim) {
          spec->quantizable_operands.insert(operand_idx);
        }
      }
      return spec;
    }
    
    std::unique_ptr<OpQuantScaleSpec> GetStableHloQuantConstraints(Operation* op) {
      auto scale_spec = std::make_unique<OpQuantScaleSpec>();
      if (llvm::isa<mlir::stablehlo::BroadcastInDimOp,
                    mlir::stablehlo::ConcatenateOp,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.cc

        // For ops that require same operand and result types, use explicit
        // requantize op rather than using `entry_func_op`'s result as op result.
        auto spec = GetStableHloQuantConstraints(singular_op);
        const bool has_same_operand_and_result_type =
            spec->has_same_operand_and_result_type_requirement;
        if (has_same_operand_and_result_type) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 06:04:36 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/stablehlo/passes/prepare_quantize.cc

      ModuleOp module_op = getOperation();
      MLIRContext* ctx = module_op.getContext();
    
      auto func_op_quant_spec = GetStableHloOpQuantSpec;
      auto func_op_quant_scale_spec = GetStableHloQuantConstraints;
    
      for (auto func_op : module_op.getOps<func::FuncOp>()) {
        // The function might contain more stats ops than required, and it will
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 05:11:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.h

          if (candidate_op->hasTrait<OpTrait::IsTerminator>()) {
            return failure();
          }
    
          if (!IsOpQuantizableStableHlo(candidate_op)) {
            return failure();
          }
    
          if (GetStableHloQuantConstraints(candidate_op)
                  ->has_same_scale_requirement &&
              !IsConnectedWithQuantizedCompsiteFunction(candidate_op)) {
            return failure();
          }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec_test.cc

      ASSERT_TRUE(module_op);
    
      func::FuncOp main_fn = FindMainFuncOp(*module_op);
      ASSERT_THAT(main_fn, NotNull());
    
      Operation* gather_op = FindOperationOfType<GatherOp>(main_fn);
      const auto spec = GetStableHloQuantConstraints(gather_op);
    
      EXPECT_THAT(spec, NotNull());
      EXPECT_THAT(spec->has_same_operand_and_result_type_requirement, IsTrue());
    }
    
    }  // namespace
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 04 07:19:09 UTC 2024
    - 14.8K bytes
    - Viewed (0)
Back to top