Skip to content

Commit

Permalink
repo-sync-2024-07-16T11:27:49+0800
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinxc committed Jul 16, 2024
1 parent f329677 commit 59b6657
Show file tree
Hide file tree
Showing 187 changed files with 1,197 additions and 994 deletions.
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Checks: "abseil-cleanup-ctad,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-magic-numbers,
-readability-named-parameter"
-readability-named-parameter,
-readability-convert-member-functions-to-static"

CheckOptions:
- key: bugprone-argument-comment.StrictMode
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
>
> please add your unreleased change here.
## TBD
## 20240716

- [SPU] 0.9.2b0 release
- [Feature] Support jax.numpy.bitwise_count
- [Bugfix] Fix jax.numpy.signbit wrong answer with very large input

Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def _bazel_skylib():
)

def _com_github_openxla_xla():
OPENXLA_COMMIT = "9b0dd58c9b625a2e958f4fc7787a1ff5c95dbb40"
OPENXLA_SHA256 = "f150c5b49e4d4497aae2c79232f1efe2baccaa72223b21dc8715be73eab74417"
OPENXLA_COMMIT = "8533a6869ae02fb3b15a8a12739a982fc3c9f6e7"
OPENXLA_SHA256 = "d5b076825c992f59542f6b94e5480c7e7c6c627cd18c80ec60b6d5b295c160d4"

# We need openxla to handle xla/mhlo/stablehlo
maybe(
Expand Down
2 changes: 1 addition & 1 deletion docs/development/add_protocols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ When kernels are implemented and registered, a new protocol is finally added.
auto* prg_state = ctx->getState<PrgState>();

// dispatch the real implementation to different fields
return DISPATCH_ALL_FIELDS(field, "aby3.mulAA", [&]() {
return DISPATCH_ALL_FIELDS(field, [&]() {
// the real protocol implementation
...
});
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ml/jax_lr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example demonstrates how to use SPU to train a logistic regression model pr
1. Launch SPU backend runtime

```sh
bazel run -c opt //examples/python/utils:nodectl -- up
bazel run -c opt //examples/python/utils:nodectl -- -c examples/python/conf/2pc_semi2k.json up
```

2. Run `jax_lr` example
Expand Down
4 changes: 2 additions & 2 deletions experimental/squirrel/bin_matvec_prot_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TEST_P(BinMatVecProtTest, Basic) {
});
NdArrayRef reveal = ring_add(out_shr[0], out_shr[1]);

DISPATCH_ALL_FIELDS(field, "", [&]() {
DISPATCH_ALL_FIELDS(field, [&]() {
NdArrayView<ring2k_t> _vec(vec);
auto expected = BinAccumuate<ring2k_t>(_vec, mat);
NdArrayView<ring2k_t> got(reveal);
Expand Down Expand Up @@ -160,7 +160,7 @@ TEST_P(BinMatVecProtTest, WithIndicator) {
});
NdArrayRef reveal = ring_add(out_shr[0], out_shr[1]);

DISPATCH_ALL_FIELDS(field, "", [&]() {
DISPATCH_ALL_FIELDS(field, [&]() {
NdArrayView<ring2k_t> _vec(vec);
auto expected =
BinAccumuate<ring2k_t>(_vec, mat, absl::MakeConstSpan(indicator));
Expand Down
6 changes: 3 additions & 3 deletions experimental/squirrel/objectives.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ namespace {
res = NdArrayRef(makeType<mpc::cheetah::AShrTy>(ftype), in.shape());
}

return DISPATCH_ALL_FIELDS(field, "cheetah.ring_cast", [&]() {
return DISPATCH_ALL_FIELDS(field, [&]() {
using from_ring2k_t = ring2k_t;
return DISPATCH_ALL_FIELDS(ftype, "cheetah.ring_cast", [&]() {
return DISPATCH_ALL_FIELDS(ftype, [&]() {
using to_ring2k_t = ring2k_t;
NdArrayView<const from_ring2k_t> _in(in);
NdArrayView<to_ring2k_t> _res(res);
Expand Down Expand Up @@ -383,7 +383,7 @@ spu::Value Logistic(spu::SPUContext* ctx, const spu::Value& x) {
spu::Value Sigmoid(spu::SPUContext* ctx, const spu::Value& x) {
namespace sk = spu::kernel;
auto c05 = sk::hlo::Constant(ctx, 0.5F, x.shape());
auto half = sk::hal::right_shift_arithmetic(ctx, x, 1);
auto half = sk::hal::right_shift_arithmetic(ctx, x, {1});
auto divisor = sk::hlo::Add(ctx, sk::hlo::Constant(ctx, 1, x.shape()),
sk::hal::f_square(ctx, x));
return sk::hlo::Add(ctx, c05,
Expand Down
2 changes: 1 addition & 1 deletion experimental/squirrel/tree_build_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void AccumulateHistogram(spu::NdArrayRef buckets_share, size_t nfeatures,
// The buckets belong to the i-th feature is
// `buckets[i*bucket_size:(i+1)*bucket_size]`
auto field = buckets_share.eltype().as<RingTy>()->field();
DISPATCH_ALL_FIELDS(field, "AccumulateHistogram", [&]() {
DISPATCH_ALL_FIELDS(field, [&]() {
NdArrayView<ring2k_t> histogram(buckets_share);
for (size_t j = 0; j < nfeatures; ++j) {
size_t start = j * bucket_size;
Expand Down
6 changes: 3 additions & 3 deletions experimental/squirrel/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ spu::Value MulPrivateArithWithPrivateBoolean(spu::SPUContext* ctx,
&kctx, arith.data(),
[&](const NdArrayRef& input,
const std::shared_ptr<spu::mpc::cheetah::BasicOTProtocols>& base_ot) {
return DISPATCH_ALL_FIELDS(ft, "ot", [&]() {
return DISPATCH_ALL_FIELDS(ft, [&]() {
NdArrayRef ot_out = spu::mpc::ring_zeros(ft, input.shape());
auto inp = absl::MakeConstSpan(&input.at<ring2k_t>(0), input.numel());
auto oup = absl::MakeSpan(&ot_out.at<ring2k_t>(0), ot_out.numel());
Expand All @@ -193,7 +193,7 @@ spu::Value MulPrivateArithWithPrivateBoolean(spu::SPUContext* ctx,
&kctx, boolean,
[&](absl::Span<const uint8_t> input,
const std::shared_ptr<spu::mpc::cheetah::BasicOTProtocols>& base_ot) {
return DISPATCH_ALL_FIELDS(ft, "ot", [&]() {
return DISPATCH_ALL_FIELDS(ft, [&]() {
NdArrayRef ot_out = spu::mpc::ring_zeros(ft, {(int64_t)input.size()});
auto oup = absl::MakeSpan(&ot_out.at<ring2k_t>(0), input.size());
base_ot->GetReceiverCOT()->RecvCAMCC(input, oup);
Expand Down Expand Up @@ -222,7 +222,7 @@ spu::Value MulArithShareWithANDBoolShare(spu::SPUContext* ctx,
std::shared_ptr<spu::mpc::cheetah::BasicOTProtocols> base_ot) {
NdArrayRef out(x.eltype(), x.shape());

DISPATCH_ALL_FIELDS(ft, "camcc", [&]() {
DISPATCH_ALL_FIELDS(ft, [&]() {
spu::NdArrayView<const ring2k_t> _ashr(x);
auto oup = absl::MakeSpan(&out.at<ring2k_t>(0), y.size());
std::vector<ring2k_t> corr(y.size());
Expand Down
4 changes: 2 additions & 2 deletions experimental/squirrel/utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST_F(UtilsTest, ReduceSum) {
const double fxp = std::pow(2., rt_config.fxp_fraction_bits());
auto flatten = got.data().reshape({got.numel()});

DISPATCH_ALL_FIELDS(field, "check", [&]() {
DISPATCH_ALL_FIELDS(field, [&]() {
using s2k = std::make_signed<ring2k_t>::type;
NdArrayView<s2k> got(flatten);
for (int64_t i = 0; i < expected.numel(); ++i) {
Expand Down Expand Up @@ -136,7 +136,7 @@ TEST_F(UtilsTest, ArgMax) {
if (lctx->Rank() == 0) {
auto flatten = got.data().reshape({got.numel()});

DISPATCH_ALL_FIELDS(field, "check", [&]() {
DISPATCH_ALL_FIELDS(field, [&]() {
NdArrayView<ring2k_t> got(flatten);
for (size_t i = 0; i < expected.size(); ++i) {
ASSERT_EQ(expected(i), got[i]);
Expand Down
1 change: 0 additions & 1 deletion libspu/compiler/common/compilation_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <filesystem>
#include <memory>
#include <string>

#include "mlir/IR/MLIRContext.h"
#include "mlir/Pass/PassManager.h"
Expand Down
2 changes: 0 additions & 2 deletions libspu/compiler/compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#include "libspu/compiler/compile.h"

#include "mlir/IR/BuiltinOps.h"

#include "libspu/compiler/codegen/codegen.h"
#include "libspu/compiler/common/compilation_context.h"
#include "libspu/compiler/core/core.h"
Expand Down
1 change: 0 additions & 1 deletion libspu/compiler/core/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/Passes.h"

Expand Down
1 change: 0 additions & 1 deletion libspu/compiler/front_end/fe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/Passes.h"
#include "spdlog/spdlog.h"
#include "stablehlo/dialect/StablehloOps.h"
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
#include "xla/mlir_hlo/mhlo/transforms/passes.h"
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/abs.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @abs_op_test_i64_i64_p() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/add.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @add_op_test_i8_i8_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/and.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @and_op_test_i8_i8_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/atan2.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @atan2_op_test_f64_f64_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/broadcast.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @broadcast_in_dim() {
%operand = pphlo.constant dense<[[1], [2], [3]]> : tensor<3x1xi64>
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/case.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @case_negative_index_default() {
%index = pphlo.constant dense<-1> : tensor<i32>
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/ceil.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @ceil_op_test_f16_f16_p() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/clamp.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @clamp_op_test_si64() {
%min = pphlo.constant dense<[1, 5, -5]> : tensor<3xi64>
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/concatenate.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @concatenate() {
%input0 = pphlo.constant dense<[[1, 2], [3, 4], [5, 6]]> : tensor<3x2xi64>
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/convert.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @convert_op_test_1() {
%0 = pphlo.constant dense<[0, 1, 8, -9, 0]> : tensor<5xi32>
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/convolution.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @main() {
%0 = pphlo.constant dense<[[[[ 1.0, 2.0, 3.0, 4.0],
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/cosine.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @cosine_op_test_f16_f16_p() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/divide.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @divide_op_test_i64_i64_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/dot_general.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @dot_general_op_test_si64() {
%lhs = pphlo.constant dense<[[[1, 2], [3, 4]],
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/dynamic_slice.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @dynamic_slice() {
%operand = pphlo.constant dense<[[1, 1, 1],
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/dynamic_update_slice.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s

func.func @dynamic_update_slice() {
%operand = pphlo.constant dense<[[1, 1, 1, 1],
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/equal.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @equal_op_test_i64_i1_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/exponential.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @exponential_op_test_f64_f64_p() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/exponential_minus_one.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @exponential_minus_one_op_test_f64_f64_p() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/floor.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @floor_op_test_f16_f16_p() {
Expand Down
9 changes: 9 additions & 0 deletions libspu/compiler/tests/interpret/generate_mlir_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def TestCase(inputs, expected, checker='expect_eq', tol=None):
"or",
# "popcnt",
"power",
"reciprocal",
"reshape",
"round_afz",
"rsqrt",
Expand Down Expand Up @@ -99,6 +100,14 @@ def TestCase(inputs, expected, checker='expect_eq', tol=None):
f.write(
"// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s\n"
)
f.write(
"// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s\n"
)
# Some test values in max and min are not supported by protocol 5.
if test not in ["max", "min"]:
f.write(
"// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s\n"
)
f.write("// AUTO GENERATED, DO NOT EDIT\n\n")

# Emit cases
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/greater.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @greater_op_test_i64_i1_pp() {
Expand Down
2 changes: 2 additions & 0 deletions libspu/compiler/tests/interpret/greater_equal.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: spu-translate --protocol_kind=1 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=2 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=3 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=4 --interpret -split-input-file %s
// RUN: spu-translate --protocol_kind=5 --interpret -split-input-file %s
// AUTO GENERATED, DO NOT EDIT

func.func @greater_equal_op_test_i64_i1_pp() {
Expand Down
Loading

0 comments on commit 59b6657

Please sign in to comment.