#
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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: GroupNormalizationPlugin
interface: "IPluginV2DynamicExt"
versions:
  "1":
    inputs:
      - input
      - scale
      - bias
    outputs:
      - output
    input_dims:
      input: 4
      scale: 1
      bias: 1
    input_dim_constraints:
      - "input_1 MULTIPLE_OF num_groups_0"
      - "scale_0 == input_1"
      - "bias_0 == scale_0"
    input_dim_range:
      input:
        min: "=1, =1, =1, =1"
        max: "=pinf, =pinf, =pinf, =pinf"
      scale:
        min: "=1"
        max: "=pinf"
      bias:
        min: "=1"
        max: "=pinf"
    supported_input_types:
      - combination1:
          input: float32
          scale: float32
          bias: float32
    output_dims:
      output: "input_0, input_1, input_2, input_3"
    attributes:
      - eps
      - num_groups
    attribute_types:
      eps: float32
      num_groups: int32
    attribute_length:
      eps: 1
      num_groups: 1
    attribute_dim_range:
      eps:
        min: "=1"
        max: "=1"
      num_groups:
        min: "=1"
        max: "=1"
    attribute_options:
      eps:
        min: "0"
        max: "=pinf"
      num_groups:
        min: "=1"
        max: "=pinf"
    attributes_required: []
    abs_tol: 1e-2
    rel_tol: 1e-2
    golden_reference_script: "plugin/GroupNormalizationPlugin_PluginReference.py"
    configs:
      config1:
        input_types:
          input: float32
          scale: float32
          bias: float32
        attribute_options:
          eps:
            value: 0.0001
          num_groups:
            value: 1
      config2:
        input_types:
          input: float32
          scale: float32
          bias: float32
        attribute_options:
          eps:
            value: 0.001
          num_groups:
            value: 2
      config3:
        input_types:
          input: float32
          scale: float32
          bias: float32
        attribute_options:
          eps:
            value: 0.01
          num_groups:
            value: 3
...
