Skip to content

Commit

Permalink
repo-sync-2024-03-13T19:54:00+0800 (#131)
Browse files Browse the repository at this point in the history
* repo-sync-2024-03-13T19:54:00+0800

* repo-sync-2024-03-13T20:19:27+0800

* Update .bazelrc

* Update WORKSPACE
  • Loading branch information
usafchn authored Mar 14, 2024
1 parent 8c1a18a commit dc90361
Show file tree
Hide file tree
Showing 314 changed files with 6,914 additions and 2,776 deletions.
7 changes: 6 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ build:ubsan --linkopt -fsanitize=undefined

test --keep_going
test --test_output=errors
test --test_timeout=360
test --test_timeout=600

coverage --test_timeout=1800

# delete this line when YACL repo is synced
build:linux --cxxopt -Wno-error=mismatched-new-delete
14 changes: 14 additions & 0 deletions .circleci/continue-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
Expand Down
14 changes: 14 additions & 0 deletions .circleci/release-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
Expand Down
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ IncludeCategories:
SeparateDefinitionBlocks: Always
EmptyLineBeforeAccessModifier: LogicalBlock
InsertNewlineAtEOF: true

DerivePointerAlignment: false
PointerAlignment: Right
ReferenceAlignment: Pointer
QualifierAlignment: Left
14 changes: 14 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: Python Linter
on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/buildifier.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: Bazel files linter
on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: CLA Assistant
on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/clang-format-linter.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: Run clang-format Linter
on:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/trigger-circleci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Publish Python Package"
on:
release:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/yaml-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: Yaml Lint
on:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ Architecture Transition Milestones:

- [x] HE SPI: Designed a unified interface that supports all PHE/FHE algorithms.
- [ ] Implementation of SPI Sketches. (in progress)
- [ ] Migration of existing algorithms to SPI.
- [ ] Automated testing framework for PHE/FHE algorithms.
- [ ] Migration of existing algorithms to SPI. (in progress)
- [ ] Automated testing framework for PHE/FHE algorithms. (in progress)
- [ ] Transition of Tensor Lib's underlying layer from Dispatcher to SPI.
- [ ] Transition of PyLib's underlying layer from Dispatcher to SPI.

Expand Down
6 changes: 3 additions & 3 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ https://www.secretflow.org.cn/docs/heu/
架构切换里程碑:

- [x] HE SPI:设计一套大一统接口,同时支持所有的 PHE/FHE 算法
- [ ] 实现 SPI Sketches (doing)
- [ ] 存量算法迁移至 SPI
- [ ] HE 算法自动化测试框架
- [ ] 实现 SPI Sketches (in progress)
- [ ] 存量算法迁移至 SPI (in progress)
- [ ] HE 算法自动化测试框架 (in progress)
- [ ] Tensor Lib 底层从 Dispatcher 切到 SPI
- [ ] PyLib 底层从 Dispatcher 切到 SPI

Expand Down
8 changes: 7 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

SECRETFLOW_GIT = "https://github.com/secretflow"

YACL_COMMIT_ID = "cbe5436f27ff9c4c9c7f7f6664f9fb9f6c852ec2"
YACL_COMMIT_ID = "9a74ab6f4bb0c9c21171e945a379e27fde482cea"

git_repository(
name = "yacl",
Expand Down Expand Up @@ -107,3 +107,9 @@ load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains",
rules_cuda_dependencies()

register_detected_cuda_toolchains()

#### for other third-party libs ####

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()
16 changes: 16 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright 2024 Ant Group Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

html[data-theme="light"] {
--pst-color-primary: rgb(22 119 255);
--pst-color-secondary: rgb(22 255 201);
Expand Down
14 changes: 14 additions & 0 deletions heu/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:public"])

### global configs ###
Expand Down
26 changes: 26 additions & 0 deletions heu/algorithms/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@yacl//bazel:yacl.bzl", "yacl_cc_library")
load("@bazel_skylib//lib:subpackages.bzl", "subpackages")

package(default_visibility = ["//visibility:public"])

# A collection of all implementation libraries.
# doc of @bazel_skylib//lib:subpackages.bzl:
# https://github.com/bazelbuild/bazel-skylib/blob/main/docs/subpackages_doc.md
yacl_cc_library(
name = "algorithms",
deps = subpackages.all(exclude = ["common"]),
)
23 changes: 23 additions & 0 deletions heu/algorithms/common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test")

package(default_visibility = ["//visibility:public"])

yacl_cc_library(
name = "type_alias",
hdrs = ["type_alias.h"],
deps = ["@yacl//yacl/math/mpint"],
)
14 changes: 7 additions & 7 deletions heu/spi/he/he_kit.cc → heu/algorithms/common/type_alias.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "heu/spi/he/he_kit.h"
#pragma once

namespace heu::lib::spi {
#include "yacl/math/mpint/mp_int.h"

HeFactory& HeFactory::Instance() {
static HeFactory factory;
return factory;
}
namespace heu::algos {

} // namespace heu::lib::spi
using yacl::math::MPInt;
using yacl::math::PrimeType;

} // namespace heu::algos
67 changes: 67 additions & 0 deletions heu/algorithms/mock_phe/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2024 Ant Group Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test")

package(default_visibility = ["//visibility:public"])

yacl_cc_library(
name = "mock_phe",
srcs = ["he_kit.cc"],
hdrs = ["he_kit.h"],
deps = [
":decryptor",
":encryptor",
":evaluator",
"@yacl//yacl/utils:serializer",
],
alwayslink = 1,
)

yacl_cc_library(
name = "base",
srcs = ["base.cc"],
hdrs = ["base.h"],
deps = [
"//heu/spi/he/sketches/scalar/phe",
"@com_github_msgpack_msgpack//:msgpack",
],
)

yacl_cc_library(
name = "encryptor",
srcs = ["encryptor.cc"],
hdrs = ["encryptor.h"],
deps = [
":base",
],
)

yacl_cc_library(
name = "decryptor",
srcs = ["decryptor.cc"],
hdrs = ["decryptor.h"],
deps = [
":base",
],
)

yacl_cc_library(
name = "evaluator",
srcs = ["evaluator.cc"],
hdrs = ["evaluator.h"],
deps = [
":base",
],
)
Loading

0 comments on commit dc90361

Please sign in to comment.