Skip to content

Add ROCm PQC TrustFlow KEM and signature example#469

Open
firedoil wants to merge 1 commit into
ROCm:amd-stagingfrom
firedoil:add-pqc-trustflow-rocm
Open

Add ROCm PQC TrustFlow KEM and signature example#469
firedoil wants to merge 1 commit into
ROCm:amd-stagingfrom
firedoil:add-pqc-trustflow-rocm

Conversation

@firedoil

Copy link
Copy Markdown

Motivation

This PR adds a ROCm/HIP post-quantum cryptography application example under Applications/pqc_trustflow_rocm.

The example targets two innovation-development goals:

  1. Development of currently unsupported functions:

    • ROCm/HIP batch KEM API for Kyber/Aigis-enc.
    • ROCm/HIP batch signature API for ML-DSA/Aigis-sig.
    • File-level KEM/signature command-line APIs.
    • TrustFlow frontend integration for multi-file secure packaging.
  2. Performance bottleneck localization and optimization:

    • ROCm profiling and tuning scripts.
    • KEM TPB, launch-bound, and buffer-reuse optimization records.
    • Signature resource-aware decomp pipeline and feature-matrix candidates.
    • Quantified evidence summaries and conservative optimization decisions.

Technical Details

This PR adds a new application example:

Applications/pqc_trustflow_rocm

The example is organized into two parts:

  • 01_unsupported_feature_rocm_pqc_api/

    • KEM ROCm/HIP backend and file-level API.
    • Signature ROCm/HIP backend and file-level API.
    • TrustFlow frontend integration.
    • API and quick-start documentation.
  • 02_performance_bottleneck_rocm_optimization/

    • KEM profiling/tuning scripts.
    • Signature feature-matrix and resource-aware optimization scripts.
    • Evidence summaries for bottleneck attribution and optimization results.

Generated binaries, caches, secret files, temporary outputs, and large logs are intentionally excluded.

Test Plan

The example provides smoke-test and profiling entry points:

KEM correctness smoke test:

cd Applications/pqc_trustflow_rocm/01_unsupported_feature_rocm_pqc_api/kem_api
bash build_hip.sh kyber768
bash run_kem_smoke_amd.sh

Test Result

Recorded evidence shows:
KEM correctness smoke tests pass.
Signature policy smoke tests pass.
Kyber-768 profiling identifies the sample/XOF/rejection-sampling stage as the dominant bottleneck.
Kyber-768 encaps throughput improves from about 6.00M ops/s to about 7.10M ops/s after launch-bound tuning.
Signature feature-matrix results show local wins from cp_fuse, wave64_ctrl, tail16, and adaptive candidates, while the stable default keeps the resource-aware decomp pipeline to avoid regressions.

Added/Updated documentation?

  • Yes
  • No, does not apply to this PR.

Included Visual Studio files?

  • Yes
  • No, does not apply to this PR.

Submission Checklist

@firedoil firedoil requested review from a team as code owners June 19, 2026 18:49
@zichguan-amd

Copy link
Copy Markdown
Collaborator

Hi @firedoil, thanks for contributing to rocm-examples! PQC is an interesting topic that we haven't covered yet in the repo, and your PR is a welcomed addition. To align with rocm-examples existing code base and future maintainability, there are some points that need to be addressed for this PR to land:

  • The comments and documentations are not in English.
  • The build system does not integrate with existing CMake and Makefile structures, this is very important for CI testing, please add at least CMake support instead of a bash build script.
  • 2nd part doesn't really fit into this repo. It's meant to showcase HIP applications and API usage, which is what the first part does. I'd distill the research and optimizations into a section of readme and remove the second part all together. Please also remove any performance comparison or benchmark claims.
  • The kem_api source files are .cu files with a rocm_compat.h conversion header, but sign_api seems to be purely ROCm. Please standardize the sources to HIP files that runs on amd backend. Compatibility with cuda backend is a plus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants