{"id":13642168,"url":"https://github.com/secretflow/spu","last_synced_at":"2026-03-11T13:14:23.736Z","repository":{"id":41557074,"uuid":"509708254","full_name":"secretflow/spu","owner":"secretflow","description":"SPU (Secure Processing Unit) aims to be a provable, measurable secure computation device, which provides computation ability while keeping your private data protected.","archived":false,"fork":false,"pushed_at":"2026-03-04T21:02:19.000Z","size":19989,"stargazers_count":316,"open_issues_count":43,"forks_count":141,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-05T02:40:10.941Z","etag":null,"topics":["privacy-preserving","private-set-intersection","secure-multiparty-computation"],"latest_commit_sha":null,"homepage":"https://www.secretflow.org.cn/docs/spu/en/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secretflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-02T09:05:04.000Z","updated_at":"2026-02-05T06:54:50.000Z","dependencies_parsed_at":"2023-09-22T11:51:39.993Z","dependency_job_id":"b331915c-0bea-4b2a-947f-e733de516683","html_url":"https://github.com/secretflow/spu","commit_stats":null,"previous_names":[],"tags_count":98,"template":false,"template_full_name":null,"purl":"pkg:github/secretflow/spu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fspu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fspu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fspu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fspu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secretflow","download_url":"https://codeload.github.com/secretflow/spu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fspu/sbom","scorecard":{"id":923402,"data":{"date":"2025-08-25T04:18:22Z","repo":{"name":"github.com/secretflow/spu","commit":"6de6330084eeef8348f6b222603ba7952213e3aa"},"scorecard":{"version":"v5.0.0","commit":"ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4"},"score":7.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#branch-protection"}},{"name":"CI-Tests","score":10,"reason":"30 out of 30 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#ci-tests"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#code-review"}},{"name":"Contributors","score":10,"reason":"project has 5 contributing companies or organizations","details":["Info: asterinas contributor org/company found, no affliation contributor org/company found, shanghai jiao tong university (sjtu) contributor org/company found, nvidia contributor org/company found, secretflow contributor org/company found, "],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#contributors"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1","Info: detected update tool: RenovateBot: renovate.json:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#license"}},{"name":"Maintained","score":10,"reason":"22 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs-publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/secretflow/spu/docs-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs-publish.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/secretflow/spu/docs-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs-publish.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/secretflow/spu/docs-publish.yml/main?enable=pin","Warn: containerImage not pinned by hash: .devcontainer/Dockerfile:1: pin your Docker image by updating secretflow/ubuntu-base-ci:latest to secretflow/ubuntu-base-ci:latest@sha256:287cd98a952bd2b6eb08214db8ade6d5b2a287c2221346bdcf54be4980666a3a","Warn: pipCommand not pinned by hash: examples/python/utils/run_protoc.sh:23","Warn: pipCommand not pinned by hash: .github/workflows/docs-publish.yml:39","Warn: pipCommand not pinned by hash: .github/workflows/docs-publish.yml:40","Info:   8 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   6 out of   6 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#sast"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#signed-releases"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:31","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:32","Info: topLevel 'contents' permission set to 'read': .github/workflows/black.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/buildifier.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/clang-format-linter.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:13","Warn: no topLevel permission defined: .github/workflows/docs-publish.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/license-check.yml:11","Warn: no topLevel permission defined: .github/workflows/oscp.yml:1","Info: topLevel permissions set to 'read-all': .github/workflows/publish.yml:19","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18","Warn: no topLevel permission defined: .github/workflows/stale.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/yaml-linter.yml:11","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-25T07:05:13.098Z","repository_id":41557074,"created_at":"2025-08-25T07:05:13.108Z","updated_at":"2025-08-25T07:05:13.108Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["privacy-preserving","private-set-intersection","secure-multiparty-computation"],"created_at":"2024-08-02T01:01:28.142Z","updated_at":"2026-03-11T13:14:23.719Z","avatar_url":"https://github.com/secretflow.png","language":"C++","funding_links":[],"categories":["Other TEEs","C++","Libraries","Software"],"sub_categories":["Memory Protection","New Libraries","Frameworks"],"readme":"# SPU: Secure Processing Unit\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/secretflow/spu/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/secretflow/spu/tree/main)\n[![Python](https://img.shields.io/pypi/pyversions/spu.svg)](https://pypi.org/project/spu/)\n[![PyPI version](https://img.shields.io/pypi/v/spu)](https://pypi.org/project/spu/)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/secretflow/spu/badge)](https://securityscorecards.dev/viewer/?uri=github.com/secretflow/spu)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8311/badge)](https://www.bestpractices.dev/projects/8311)\n\nSPU (Secure Processing Unit) aims to be a `provable`, `measurable` secure computation device,\nwhich provides computation ability while keeping your private data protected.\n\nSPU could be treated as a programmable device, it's not designed to be used directly.\nNormally we use SecretFlow framework, which use SPU as the underline secure computing device.\n\nCurrently, we mainly focus on `provable` security. It contains a secure runtime that evaluates\n[XLA](https://www.tensorflow.org/xla/operation_semantics)-like tensor operations,\nwhich use [MPC](https://en.wikipedia.org/wiki/Secure_multi-party_computation) as the underline\nevaluation engine to protect privacy information.\n\nSPU python package also contains a simple distributed module to demo SPU usage,\nbut it's **NOT designed for production** due to system security and performance concerns,\nplease **DO NOT** use it directly in production.\n\n## Contribution Guidelines\n\nIf you would like to contribute to SPU, please check [Contribution guidelines](CONTRIBUTING.md).\n\nIf you would like to use SPU for research purposes, please check [research development guidelines](docs/SPU_gudience.pdf) from [@fionser](https://github.com/fionser).\n\nThis documentation also contains instructions for [build and testing](CONTRIBUTING.md#build).\n\n## Installation Guidelines\n\n### Supported platforms\n\n|            | Linux x86_64 | Linux aarch64 | macOS x64      | macOS Apple Silicon | Windows x64    | Windows WSL2    x64 |\n|------------|--------------|---------------|----------------|---------------------|----------------|---------------------|\n| CPU        | yes          | yes           | yes\u003csup\u003e1\u003c/sup\u003e| yes                 | no             | yes                 |\n| NVIDIA GPU | experimental | no            | no             | n/a                 | no             | experimental        |\n\n1. Due to CI resource limitation, macOS x64 prebuild binary is no longer available.\n\n### Instructions\n\nPlease follow [Installation Guidelines](INSTALLATION.md) to install SPU.\n\n### Hardware Requirements\n\n| General Features | FourQ based PSI | GPU |\n| ---------------- | --------------- | --- |\n| AVX/ARMv8        | AVX2/ARMv8      | CUDA 11.8+ |\n\n## Citing SPU\n\nIf you think SPU is helpful for your research or development, please consider citing our papers:\n\n[USENIX ATC'23](https://www.usenix.org/conference/atc23/presentation/ma)\n\n```text\n@inproceedings {spu,\n    author = {Junming Ma and Yancheng Zheng and Jun Feng and Derun Zhao and Haoqi Wu and Wenjing Fang and Jin Tan and Chaofan Yu and Benyu Zhang and Lei Wang},\n    title = {{SecretFlow-SPU}: A Performant and {User-Friendly} Framework for {Privacy-Preserving} Machine Learning},\n    booktitle = {2023 USENIX Annual Technical Conference (USENIX ATC 23)},\n    year = {2023},\n    isbn = {978-1-939133-35-9},\n    address = {Boston, MA},\n    pages = {17--33},\n    url = {https://www.usenix.org/conference/atc23/presentation/ma},\n    publisher = {USENIX Association},\n    month = jul,\n}\n```\n\n[ICML'24](https://proceedings.mlr.press/v235/wu24d.html)\n\n```text\n@inproceedings{ditto,\n  title = {Ditto: Quantization-aware Secure Inference of Transformers upon {MPC}},\n  author = {Wu, Haoqi and Fang, Wenjing and Zheng, Yancheng and Ma, Junming and Tan, Jin and Wang, Lei},\n  booktitle = {Proceedings of the 41st International Conference on Machine Learning},\n  pages = {53346--53365},\n  year = {2024},\n  editor = {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix},\n  volume = {235},\n  series = {Proceedings of Machine Learning Research},\n  month = {21--27 Jul},\n  publisher = {PMLR},\n  pdf = {https://raw.githubusercontent.com/mlresearch/v235/main/assets/wu24d/wu24d.pdf},\n  url = {https://proceedings.mlr.press/v235/wu24d.html},\n  abstract = {Due to the rising privacy concerns on sensitive client data and trained models like Transformers, secure multi-party computation (MPC) techniques are employed to enable secure inference despite attendant overhead. Existing works attempt to reduce the overhead using more MPC-friendly non-linear function approximations. However, the integration of quantization widely used in plaintext inference into the MPC domain remains unclear. To bridge this gap, we propose the framework named Ditto to enable more efficient quantization-aware secure Transformer inference. Concretely, we first incorporate an MPC-friendly quantization into Transformer inference and employ a quantization-aware distillation procedure to maintain the model utility. Then, we propose novel MPC primitives to support the type conversions that are essential in quantization and implement the quantization-aware MPC execution of secure quantized inference. This approach significantly decreases both computation and communication overhead, leading to improvements in overall efficiency. We conduct extensive experiments on Bert and GPT2 models to evaluate the performance of Ditto. The results demonstrate that Ditto is about $3.14\\sim 4.40\\times$ faster than MPCFormer (ICLR 2023) and $1.44\\sim 2.35\\times$ faster than the state-of-the-art work PUMA with negligible utility degradation.}\n}\n```\n\n## Acknowledgement\n\nWe thank the significant contributions made by [Alibaba Gemini Lab](https://alibaba-gemini-lab.github.io) and security advisories made by [VUL337@NISL@THU](https://netsec.ccert.edu.cn/vul337).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretflow%2Fspu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecretflow%2Fspu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretflow%2Fspu/lists"}