Skip to content

Rmsnorm - #136

Merged
Xeratec merged 11 commits into
pulp-platform:develfrom
lee2716:rmsnorm
Dec 8, 2025
Merged

Rmsnorm#136
Xeratec merged 11 commits into
pulp-platform:develfrom
lee2716:rmsnorm

Conversation

@lee2716

@lee2716 lee2716 commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Describe the intent of your PR here.

This PR adds support for RMSNorm (Root Mean Square Normalization) operation to the Deeploy framework's Generic platform. RMSNorm is a critical normalization technique used in modern Transformer architectures and large language models. To enable RMSNorm deployment on embedded systems, this PR implements the necessary mathematical primitives (Pow and Sqrt operations) and integrates them into Deeploy's compilation pipeline.

The implementation follows Deeploy's operator decomposition approach, where RMSNorm is constructed from basic mathematical operations rather than as a monolithic kernel. This design provides flexibility and maintainability while supporting both float32 and float16 precision for resource-constrained embedded devices.

Added

  • Pow (Power) operation support

    • FloatPowTemplate.py: Mako template for C code generation
    • Pow_fp32.c Kernel implementations for both precisions
    • kernel/Pow.h: Kernel interface definitions
    • Parser, Layer, and Binding classes for framework integration
  • Sqrt (Square Root) operation support

    • FloatSqrtTemplate.py: Mako template for C code generation
    • Sqrt_fp32.c : Kernel implementations
    • kernel/Sqrt.h: Kernel interface definitions
    • Complete framework integration components
  • Comprehensive test suites

    • testFloatPow : Pow operator tests with ONNX models and reference data
    • testFloatSqrt : Sqrt operator tests
    • testFloatRMSNorm: End-to-end RMSNorm tests demonstrating operator composition

Changed

  • Framework integration files

    • Deeploy/Targets/Generic/Parsers.py: Added PowParser and SqrtParser for ONNX graph parsing
    • Deeploy/Targets/Generic/Layers.py: Added corresponding Layer classes for both operations
    • Deeploy/Targets/Generic/Bindings.py: Added type checking and binding registration
    • Deeploy/Targets/Generic/Platform.py: Registered new operations in platform mapping
  • Runtime library headers

    • TargetLibraries/Generic/inc/DeeployBasicMath.h: Extended with Pow and Sqrt function declarations
    • TargetLibraries/Generic/inc/types.h: Updated type definitions for consistency
  • CI/CD configuration

    • .github/workflows/ci-platform-generic.yml: Updated to include new test cases in automated testing pipeline

Fixed

  • N/A (This is a feature addition PR with no bug fixes)

PR Merge Checklist

  1. The PR is rebased on the latest devel commit and pointing to devel.
  2. Your PR reviewed and approved.
  3. All checks are passing.
  4. The CHANGELOG.md file has been updated.
  5. If the docker was modified, change back its link after review.

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

Labels

Feature Addition of new features

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants